From 31926f88355c3c4ec5b6168852dcb79b19f10f7d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sun, 24 Sep 2023 14:55:26 +0200 Subject: [PATCH] :core:interfaces cleanup --- app/src/main/kotlin/app/aaps/MainActivity.kt | 38 +- app/src/main/kotlin/app/aaps/MainApp.kt | 28 +- .../aaps/activities/HistoryBrowseActivity.kt | 36 +- .../app/aaps/activities/HistoryBrowserData.kt | 20 +- .../aaps/activities/MyPreferenceFragment.kt | 30 +- app/src/main/kotlin/app/aaps/di/AppModule.kt | 8 +- .../kotlin/app/aaps/di/PluginsListModule.kt | 2 +- .../app/aaps/implementations/ConfigImpl.kt | 4 +- .../aaps/implementations/InstantiatorImpl.kt | 10 +- .../aaps/implementations/UiInteractionImpl.kt | 8 +- .../kotlin/app/aaps/receivers/BTReceiver.kt | 4 +- .../app/aaps/receivers}/BundleLogger.kt | 2 +- .../aaps/receivers/ChargingStateReceiver.kt | 10 +- .../kotlin/app/aaps/receivers/DataReceiver.kt | 7 +- .../app/aaps/receivers/KeepAliveWorker.kt | 30 +- .../receivers/TimeDateOrTZChangeReceiver.kt | 11 +- .../aaps/workflow/CalculationWorkflowImpl.kt | 28 +- .../maintenance/MaintenancePluginTest.kt | 12 +- core/interfaces/build.gradle | 2 +- .../app/aaps/annotations/OpenForTesting.kt | 0 .../nightscout/interfaces/actions/Actions.kt | 3 - .../interfaces/constraints/Safety.kt | 5 - .../interfaces/profiling/Profiler.kt | 8 - .../nightscout/interfaces/pump/OmnipodDash.kt | 3 - .../interfaces/pump/defs/DoseSettings.kt | 3 - .../nightscout/interfaces/sync/Tidepool.kt | 3 - .../interfaces/userEntry/UserEntryMapper.kt | 156 --------- .../info/nightscout/rx/events/EventAppExit.kt | 3 - .../rx/events/EventAppInitialized.kt | 3 - .../nightscout/rx/events/EventMobileToWear.kt | 5 - .../rx/events/EventNSClientRestart.kt | 3 - .../rx/events/EventOfflineChange.kt | 3 - .../nightscout/rx/events/EventQueueChanged.kt | 3 - .../nightscout/rx/events/EventRebuildTabs.kt | 3 - .../rx/events/EventRefreshButtonState.kt | 3 - .../rx/events/EventRefreshOverview.kt | 3 - .../nightscout/rx/events/EventThemeSwitch.kt | 3 - .../rx/events/EventWearCwfExported.kt | 5 - .../rx/events/EventWearDataToMobile.kt | 5 - .../nightscout/rx/events/EventWearToMobile.kt | 5 - .../app/aaps/interfaces/actions/Actions.kt | 3 + .../interfaces/alerts}/LocalAlertUtils.kt | 2 +- .../androidPermissions}/AndroidPermission.kt | 4 +- .../app/aaps}/interfaces/aps/APS.kt | 2 +- .../app/aaps}/interfaces/aps/APSResult.kt | 7 +- .../app/aaps/interfaces/aps}/ApsMode.kt | 2 +- .../app/aaps}/interfaces/aps/AutosensData.kt | 2 +- .../aaps}/interfaces/aps/AutosensDataStore.kt | 9 +- .../aaps}/interfaces/aps/AutosensResult.kt | 2 +- .../app/aaps}/interfaces/aps/BasalData.kt | 2 +- .../interfaces/aps/DetermineBasalAdapter.kt | 10 +- .../app/aaps}/interfaces/aps/Loop.kt | 8 +- .../app/aaps}/interfaces/aps/SMBDefaults.kt | 7 +- .../app/aaps}/interfaces/aps/Sensitivity.kt | 5 +- .../aps/VariableSensitivityResult.kt | 3 +- .../aaps}/interfaces/automation/Automation.kt | 2 +- .../interfaces/automation/AutomationEvent.kt | 5 +- .../app/aaps}/interfaces/autotune/Autotune.kt | 2 +- .../bgQualityCheck/BgQualityCheck.kt | 2 +- .../aaps/interfaces/configuration}/Config.kt | 5 +- .../configuration}/ConfigBuilder.kt | 6 +- .../configuration}/ConfigExportImport.kt | 2 +- .../interfaces/configuration}/Constants.kt | 2 +- .../interfaces/constraints/Constraint.kt | 2 +- .../constraints/ConstraintsChecker.kt | 4 +- .../interfaces/constraints/Objectives.kt | 2 +- .../constraints/PluginConstraints.kt | 4 +- .../app/aaps/interfaces/constraints/Safety.kt | 5 + .../app/aaps/interfaces/db}/GlucoseUnit.kt | 2 +- .../aaps}/interfaces/db/PersistenceLayer.kt | 4 +- .../aaps/interfaces}/extensions/UIUtils.kt | 2 +- .../app/aaps}/interfaces/insulin/Insulin.kt | 8 +- .../app/aaps}/interfaces/iob/CobInfo.kt | 2 +- .../app/aaps}/interfaces/iob/GlucoseStatus.kt | 2 +- .../interfaces/iob/GlucoseStatusProvider.kt | 3 +- .../interfaces/iob/InMemoryGlucoseValue.kt | 4 +- .../app/aaps}/interfaces/iob/Iob.kt | 18 +- .../aaps}/interfaces/iob/IobCobCalculator.kt | 12 +- .../app/aaps}/interfaces/iob/IobTotal.kt | 3 +- .../app/aaps}/interfaces/iob/MealData.kt | 2 +- .../aaps/interfaces}/logging/AAPSLogger.kt | 3 +- .../app/aaps/interfaces/logging}/L.kt | 3 +- .../app/aaps/interfaces}/logging/LTag.kt | 4 +- .../aaps/interfaces/logging}/LogElement.kt | 2 +- .../aaps}/interfaces/logging/LoggerUtils.kt | 2 +- .../interfaces/logging/UserEntryLogger.kt | 6 +- .../maintenance/ImportExportPrefs.kt | 4 +- .../maintenance/PrefFileListProvider.kt | 4 +- .../interfaces/maintenance/PrefMetadata.kt | 2 +- .../aaps}/interfaces/maintenance/PrefsFile.kt | 2 +- .../interfaces/maintenance/PrefsImportDir.kt | 2 +- .../maintenance/PrefsMetadataKey.kt | 2 +- .../interfaces/maintenance/PrefsStatus.kt | 2 +- .../interfaces/notifications/Notification.kt | 2 +- .../notifications}/NotificationHolder.kt | 7 +- .../notifications/NotificationUserMessage.kt | 2 +- .../app/aaps}/interfaces/nsclient/NSAlarm.kt | 2 +- .../interfaces/nsclient/NSSettingsStatus.kt | 2 +- .../app/aaps}/interfaces/nsclient/NSSgv.kt | 2 +- .../nsclient/ProcessedDeviceStatusData.kt | 12 +- .../interfaces/nsclient/StoreDataForDb.kt | 3 +- .../aaps/interfaces/objects}/Instantiator.kt | 7 +- .../app/aaps/interfaces/overview}/Overview.kt | 7 +- .../interfaces/overview/OverviewMenus.kt | 2 +- .../aaps}/interfaces/plugin/ActivePlugin.kt | 28 +- .../interfaces/plugin/OwnDatabasePlugin.kt | 3 +- .../app/aaps}/interfaces/plugin/PluginBase.kt | 11 +- .../interfaces/plugin/PluginDescription.kt | 2 +- .../aaps}/interfaces/plugin/PluginFragment.kt | 3 +- .../app/aaps}/interfaces/plugin/PluginType.kt | 3 +- .../interfaces/profile/DefaultValueHelper.kt | 2 +- .../app/aaps}/interfaces/profile/Profile.kt | 18 +- .../interfaces/profile/ProfileFunction.kt | 6 +- .../aaps}/interfaces/profile/ProfileSource.kt | 19 +- .../aaps}/interfaces/profile/ProfileStore.kt | 3 +- .../aaps/interfaces/profile}/ProfileUtil.kt | 6 +- .../aaps}/interfaces/profile/PureProfile.kt | 4 +- .../app/aaps/interfaces/profiling/Profiler.kt | 8 + .../interfaces/protection/PasswordCheck.kt | 2 +- .../interfaces/protection/ProtectionCheck.kt | 2 +- .../app/aaps}/interfaces/pump/BlePreCheck.kt | 3 +- .../interfaces/pump/BolusProgressData.kt | 3 +- .../app/aaps}/interfaces/pump/Dana.kt | 2 +- .../interfaces/pump/DetailedBolusInfo.kt | 4 +- .../pump/DetailedBolusInfoStorage.kt | 2 +- .../app/aaps}/interfaces/pump/Diaconn.kt | 2 +- .../app/aaps}/interfaces/pump/Insight.kt | 2 +- .../app/aaps}/interfaces/pump/Medtrum.kt | 2 +- .../app/aaps/interfaces/pump/OmnipodDash.kt | 3 + .../app/aaps}/interfaces/pump/OmnipodEros.kt | 2 +- .../app/aaps}/interfaces/pump/Pump.kt | 19 +- .../aaps}/interfaces/pump/PumpEnactResult.kt | 2 +- .../aaps}/interfaces/pump/PumpPluginBase.kt | 16 +- .../app/aaps}/interfaces/pump/PumpSync.kt | 12 +- .../interfaces/pump/TemporaryBasalStorage.kt | 2 +- .../app/aaps}/interfaces/pump/VirtualPump.kt | 3 +- .../app/aaps}/interfaces/pump/WarnColors.kt | 3 +- .../interfaces/pump/actions/CustomAction.kt | 2 +- .../pump/actions/CustomActionType.kt | 3 +- .../aaps/interfaces/pump/defs/DoseSettings.kt | 3 + .../interfaces/pump/defs/DoseStepSize.kt | 63 ++-- .../interfaces/pump/defs/ManufacturerType.kt | 2 +- .../interfaces/pump/defs/PumpCapability.kt | 4 +- .../interfaces/pump/defs/PumpDescription.kt | 3 +- .../interfaces/pump/defs/PumpTempBasalType.kt | 2 +- .../aaps}/interfaces/pump/defs/PumpType.kt | 9 +- .../app/aaps}/interfaces/queue/Callback.kt | 4 +- .../app/aaps}/interfaces/queue/Command.kt | 6 +- .../aaps}/interfaces/queue/CommandQueue.kt | 8 +- .../aaps}/interfaces/queue/CustomCommand.kt | 6 +- .../app/aaps}/interfaces/receivers/Intents.kt | 2 +- .../receivers/ReceiverStatusStore.kt | 6 +- .../interfaces/resources}/ResourceHelper.kt | 13 +- .../app/aaps/interfaces}/rx/AapsSchedulers.kt | 2 +- .../app/aaps/interfaces}/rx/bus/RxBus.kt | 4 +- .../app/aaps/interfaces}/rx/events/Event.kt | 2 +- .../rx/events/EventAcceptOpenLoopChange.kt | 2 +- .../aaps/interfaces/rx/events/EventAppExit.kt | 3 + .../rx/events/EventAppInitialized.kt | 3 + .../EventAutosensCalculationFinished.kt | 2 +- .../interfaces}/rx/events/EventBTChange.kt | 2 +- .../rx/events/EventBucketedDataCreated.kt | 2 +- .../rx/events/EventChargingState.kt | 2 +- .../rx/events/EventConfigBuilderChange.kt | 2 +- .../rx/events/EventCustomActionsChanged.kt | 2 +- .../events/EventCustomCalculationFinished.kt | 2 +- .../rx/events/EventDanaRSyncStatus.kt | 2 +- .../rx/events/EventDeviceStatusChange.kt | 2 +- .../rx/events/EventDiaconnG8PumpLogReset.kt | 2 +- .../EventDismissBolusProgressIfRunning.kt | 2 +- .../rx/events/EventDismissNotification.kt | 2 +- .../EventEffectiveProfileSwitchChanged.kt | 2 +- .../rx/events/EventExtendedBolusChange.kt | 2 +- .../rx/events/EventFoodDatabaseChanged.kt | 2 +- .../rx/events/EventInitializationChanged.kt | 2 +- .../rx/events/EventLocalProfileChanged.kt | 2 +- .../aaps/interfaces}/rx/events/EventLoop.kt | 2 +- .../rx/events/EventLoopUpdateGui.kt | 2 +- .../rx/events/EventMobileDataToWear.kt | 4 +- .../interfaces/rx/events/EventMobileToWear.kt | 5 + .../rx/events/EventNSClientNewLog.kt | 3 +- .../rx/events/EventNSClientRestart.kt | 3 + .../rx/events/EventNetworkChange.kt | 2 +- .../aaps/interfaces}/rx/events/EventNewBG.kt | 2 +- .../rx/events/EventNewHistoryData.kt | 2 +- .../rx/events/EventNewOpenLoopNotification.kt | 2 +- .../interfaces}/rx/events/EventNtpStatus.kt | 2 +- .../rx/events/EventOfflineChange.kt | 3 + .../rx/events/EventOverviewBolusProgress.kt | 4 +- .../rx/events/EventPreferenceChange.kt | 2 +- .../rx/events/EventProfileStoreChanged.kt | 2 +- .../rx/events/EventProfileSwitchChanged.kt | 2 +- .../rx/events/EventPumpStatusChanged.kt | 4 +- .../interfaces/rx/events/EventQueueChanged.kt | 3 + .../interfaces/rx/events/EventRebuildTabs.kt | 3 + .../rx/events/EventRefreshButtonState.kt | 3 + .../rx/events/EventRefreshOverview.kt | 3 + .../interfaces}/rx/events/EventSWRLStatus.kt | 2 +- .../rx/events/EventSWSyncStatus.kt | 2 +- .../interfaces}/rx/events/EventSWUpdate.kt | 2 +- .../aaps/interfaces}/rx/events/EventScale.kt | 2 +- .../aaps/interfaces}/rx/events/EventStatus.kt | 5 +- .../rx/events/EventTempBasalChange.kt | 2 +- .../rx/events/EventTempTargetChange.kt | 2 +- .../interfaces/rx/events/EventThemeSwitch.kt | 3 + .../rx/events/EventTherapyEventChange.kt | 2 +- .../rx/events/EventTreatmentChange.kt | 2 +- .../interfaces}/rx/events/EventUpdateGui.kt | 2 +- .../events/EventUpdateOverviewCalcProgress.kt | 2 +- .../rx/events/EventUpdateOverviewGraph.kt | 2 +- .../rx/events/EventUpdateOverviewIobCob.kt | 2 +- .../events/EventUpdateOverviewSensitivity.kt | 2 +- .../rx/events/EventWearCwfExported.kt | 5 + .../rx/events/EventWearDataToMobile.kt | 5 + .../interfaces/rx/events/EventWearToMobile.kt | 5 + .../rx/events/EventWearUpdateGui.kt | 4 +- .../interfaces}/rx/events/EventXdripNewLog.kt | 3 +- .../rx/weardata/CustomWatchfaceFormat.kt | 8 +- .../aaps/interfaces}/rx/weardata/EventData.kt | 4 +- .../aaps/interfaces}/sharedPreferences/SP.kt | 4 +- .../aaps}/interfaces/smoothing/Smoothing.kt | 5 +- .../aaps}/interfaces/smsCommunicator/Sms.kt | 2 +- .../smsCommunicator/SmsCommunicator.kt | 2 +- .../app/aaps}/interfaces/source/BgSource.kt | 2 +- .../aaps}/interfaces/source/DexcomBoyda.kt | 2 +- .../aaps}/interfaces/source/NSClientSource.kt | 3 +- .../aaps}/interfaces/source/XDripSource.kt | 3 +- .../app/aaps}/interfaces/stats/DexcomTIR.kt | 4 +- .../interfaces/stats/DexcomTirCalculator.kt | 2 +- .../app/aaps}/interfaces/stats/TIR.kt | 6 +- .../aaps}/interfaces/stats/TddCalculator.kt | 2 +- .../aaps}/interfaces/stats/TirCalculator.kt | 2 +- .../app/aaps}/interfaces/storage/Storage.kt | 2 +- .../aaps}/interfaces/sync/DataSyncSelector.kt | 2 +- .../interfaces/sync/DataSyncSelectorXdrip.kt | 2 +- .../app/aaps}/interfaces/sync/NsClient.kt | 8 +- .../app/aaps}/interfaces/sync/Sync.kt | 2 +- .../app/aaps/interfaces/sync/Tidepool.kt | 3 + .../aaps/interfaces/sync}/XDripBroadcast.kt | 10 +- .../app/aaps}/interfaces/ui/IconsProvider.kt | 3 +- .../app/aaps}/interfaces/ui/UiInteraction.kt | 8 +- .../interfaces/userEntry/UserEntryMapper.kt | 156 +++++++++ .../userEntry/UserEntryPresentationHelper.kt | 2 +- .../userEntry/ValueWithUnitMapper.kt | 11 +- .../app/aaps/interfaces}/utils/DateUtil.kt | 4 +- .../interfaces/utils/DecimalFormatter.kt | 2 +- .../app/aaps}/interfaces/utils/HardLimits.kt | 2 +- .../aaps}/interfaces/utils/MidnightTime.kt | 2 +- .../app/aaps}/interfaces/utils/Round.kt | 2 +- .../app/aaps/interfaces/utils}/SafeParse.kt | 2 +- .../app/aaps/interfaces}/utils/T.kt | 2 +- .../aaps}/interfaces/utils/TimeChangeType.kt | 2 +- .../app/aaps/interfaces/utils}/Translator.kt | 2 +- .../aaps}/interfaces/utils/TrendCalculator.kt | 9 +- .../versionChecker/VersionCheckerUtils.kt | 2 +- .../app/aaps/annotations/OpenForTesting.kt | 0 .../aaps/interfaces}/rx/RxSchedulerRule.kt | 2 +- .../interfaces}/rx/weardata/EventDataTest.kt | 2 +- .../aaps/interfaces/utils}/SafeParseTest.kt | 2 +- .../core/constraints/ConstraintObject.kt | 6 +- .../core/di/CoreDataClassesModule.kt | 2 +- .../events/EventIobCalculationProgress.kt | 2 +- .../core/events/EventNewNotification.kt | 4 +- .../core/extensions/BlockExtension.kt | 4 +- .../core/extensions/BolusExtension.kt | 8 +- .../core/extensions/ExtendedBolusExtension.kt | 14 +- .../core/extensions/GlucoseValueExtension.kt | 8 +- .../core/extensions/ProfileSwitchExtension.kt | 12 +- .../extensions/TemporaryBasalExtension.kt | 14 +- .../extensions/TemporaryTargetExtension.kt | 10 +- .../core/extensions/TherapyEventExtension.kt | 4 +- .../nightscout/core/graph/ActivityGraph.kt | 4 +- .../core/graph/BasalProfileGraph.kt | 4 +- .../nightscout/core/graph/IcProfileGraph.kt | 4 +- .../nightscout/core/graph/IsfProfileGraph.kt | 8 +- .../nightscout/core/graph/OverviewData.kt | 12 +- .../core/graph/TargetBgProfileGraph.kt | 8 +- .../core/graph/data/BolusDataPoint.kt | 8 +- .../core/graph/data/CarbsDataPoint.kt | 2 +- .../data/EffectiveProfileSwitchDataPoint.kt | 6 +- .../core/graph/data/ExtendedBolusDataPoint.kt | 4 +- .../core/graph/data/GlucoseValueDataPoint.kt | 8 +- .../core/graph/data/HeartRateDataPoint.kt | 2 +- .../data/InMemoryGlucoseValueDataPoint.kt | 14 +- .../core/graph/data/TherapyEventDataPoint.kt | 8 +- .../nightscout/core/iob/CobInfoExtension.kt | 6 +- .../core/iob/GlucoseStatusExtension.kt | 6 +- .../nightscout/core/iob/IobTotalExtension.kt | 6 +- .../nightscout/core/profile/ProfileSealed.kt | 35 +- .../core/pump/PumpEnactResultExtension.kt | 6 +- .../nightscout/core/pump/PumpTypeExtension.kt | 2 +- .../nightscout/core/utils/ActionModeHelper.kt | 2 +- .../info/nightscout/core/utils/CryptoUtil.kt | 2 +- .../core/utils/extensions/HtmlString.kt | 2 +- .../core/utils/extensions/JSONObjectExt.kt | 4 +- .../core/utils/fabric/FabricPrivacy.kt | 9 +- .../core/utils/worker/LoggingWorker.kt | 4 +- .../nightscout/core/wizard/BolusWizard.kt | 58 ++-- .../nightscout/core/wizard/QuickWizard.kt | 2 +- .../core/wizard/QuickWizardEntry.kt | 20 +- .../core/workflow/CalculationWorkflow.kt | 4 +- .../core/data/DetailedBolusInfoTest.kt | 2 +- .../java/info/nightscout/core/data/IobTest.kt | 17 +- .../info/nightscout/core/data/IobTotalTest.kt | 4 +- .../info/nightscout/core/data/MealDataTest.kt | 2 +- .../info/nightscout/core/data/ProfileTest.kt | 12 +- .../core/extensions/BlockExtensionKtTest.kt | 2 +- .../data/InMemoryGlucoseValueDataPointTest.kt | 11 +- .../core/interfaces/PluginDescriptionTest.kt | 6 +- .../core/interfaces/PumpDescriptionTest.kt | 8 +- .../nightscout/core/utils/DateUtilTest.kt | 6 +- .../nightscout/core/utils/MidnightTimeTest.kt | 2 +- .../info/nightscout/core/utils/RoundTest.kt | 2 +- .../java/info/nightscout/core/utils/TTest.kt | 2 +- .../nightscout/core/wizard/QuickWizardTest.kt | 6 +- .../validators/DefaultEditTextValidator.kt | 123 ++++--- .../ValidatingEditTextPreference.kt | 4 +- .../validators/validators/BgRangeValidator.kt | 2 +- .../validators/FloatNumericRangeValidator.kt | 2 +- .../implementation/DefaultValueHelperImpl.kt | 10 +- .../implementation/HardLimitsImpl.kt | 10 +- .../implementation/LocalAlertUtilsImpl.kt | 37 +- .../implementation/TranslatorImpl.kt | 48 +-- .../implementation/TrendCalculatorImpl.kt | 10 +- .../implementation/UserEntryLoggerImpl.kt | 12 +- .../NotificationHolderImpl.kt | 8 +- .../implementation/db/CompatDBHelper.kt | 32 +- .../implementation/db/PersistenceLayerImpl.kt | 10 +- .../implementation/di/ImplementationModule.kt | 62 ++-- .../iob/GlucoseStatusProviderImpl.kt | 14 +- .../lifecycle/ProcessLifecycleListener.kt | 2 +- .../implementation/logging/LoggerUtilsImpl.kt | 4 +- .../overview/OverviewDataImpl.kt | 30 +- .../implementation/plugin/PluginStore.kt | 42 +-- .../profile/ProfileFunctionImpl.kt | 34 +- .../profile/ProfileStoreObject.kt | 18 +- .../implementation/profile/ProfileUtilImpl.kt | 8 +- .../implementation/profiling/ProfilerImpl.kt | 6 +- .../protection/BiometricCheck.kt | 16 +- .../protection/PasswordCheckImpl.kt | 10 +- .../protection/ProtectionCheckImpl.kt | 28 +- .../implementation/pump/BlePreCheckImpl.kt | 4 +- .../pump/DetailedBolusInfoStorageImpl.kt | 14 +- .../pump/PumpSyncImplementation.kt | 30 +- .../pump/TemporaryBasalStorageImpl.kt | 10 +- .../implementation/pump/WarnColorsImpl.kt | 6 +- .../queue/CommandQueueImplementation.kt | 61 ++-- .../implementation/queue/QueueThread.kt | 31 +- .../queue/commands/CommandBolus.kt | 18 +- .../commands/CommandCancelExtendedBolus.kt | 12 +- .../queue/commands/CommandCancelTempBasal.kt | 10 +- .../queue/commands/CommandClearAlarms.kt | 14 +- .../queue/commands/CommandCustomCommand.kt | 12 +- .../queue/commands/CommandDeactivate.kt | 14 +- .../queue/commands/CommandExtendedBolus.kt | 12 +- .../CommandInsightSetTBROverNotification.kt | 14 +- .../queue/commands/CommandLoadEvents.kt | 16 +- .../queue/commands/CommandLoadHistory.kt | 14 +- .../queue/commands/CommandLoadTDDs.kt | 10 +- .../queue/commands/CommandReadStatus.kt | 14 +- .../queue/commands/CommandSMBBolus.kt | 16 +- .../queue/commands/CommandSetProfile.kt | 22 +- .../queue/commands/CommandSetUserSettings.kt | 16 +- .../queue/commands/CommandStartPump.kt | 12 +- .../queue/commands/CommandStopPump.kt | 12 +- .../commands/CommandTempBasalAbsolute.kt | 14 +- .../queue/commands/CommandTempBasalPercent.kt | 14 +- .../queue/commands/CommandUpdateTime.kt | 14 +- .../receivers/NetworkChangeReceiver.kt | 11 +- .../receivers/ReceiverStatusStoreImpl.kt | 8 +- .../resources/IconsProviderImplementation.kt | 8 +- .../resources/ResourceHelperImpl.kt | 2 +- .../stats/DexcomTirCalculatorImpl.kt | 12 +- .../implementation/stats/DexcomTirImpl.kt | 31 +- .../implementation/stats/TddCalculatorImpl.kt | 22 +- .../implementation/stats/TirCalculatorImpl.kt | 16 +- .../implementation/stats/TirImpl.kt | 46 ++- .../stats/TotalDailyDoseExtension.kt | 55 ++- .../implementation/storage/FileStorage.kt | 4 +- .../UserEntryPresentationHelperImpl.kt | 20 +- .../utils/DecimalFormatterImpl.kt | 4 +- .../implementation/iob/GlucoseStatusTest.kt | 10 +- .../overview/OverviewDataImplTest.kt | 10 +- .../profile/ProfileStoreTest.kt | 2 +- .../profile/ProfileUtilImplTest.kt | 6 +- .../pump/DetailedBolusInfoStorageTest.kt | 6 +- .../pump/TemporaryBasalStorageTest.kt | 2 +- .../queue/CommandQueueImplementationTest.kt | 40 +-- .../implementation/queue/QueueThreadTest.kt | 14 +- .../utils/DecimalFormatterTest.kt | 4 +- .../implementation/wizard/BolusWizardTest.kt | 16 +- .../pump/insight/InsightAlertService.java | 6 +- .../pump/insight/LocalInsightFragment.java | 16 +- .../pump/insight/LocalInsightPlugin.java | 62 ++-- .../activities/InsightPairingActivity.java | 7 +- .../InsightConnectionService.java | 7 +- .../events/EventLocalInsightUpdateGUI.kt | 2 +- .../plugins/pump/insight/utils/AlertUtils.kt | 118 ++++--- .../nightscout/plugins/aps/APSResultObject.kt | 28 +- .../nightscout/plugins/aps/OpenAPSFragment.kt | 16 +- .../nightscout/plugins/aps/di/ApsModule.kt | 5 +- .../aps/events/EventOpenAPSUpdateGui.kt | 2 +- .../aps/events/EventResetOpenAPSGui.kt | 2 +- .../plugins/aps/logger/LoggerCallback.kt | 4 +- .../aps/loop/CarbSuggestionReceiver.kt | 3 +- .../plugins/aps/loop/LoopFragment.kt | 18 +- .../nightscout/plugins/aps/loop/LoopPlugin.kt | 84 ++--- .../aps/loop/events/EventLoopSetLastRunGui.kt | 2 +- .../extensions/PumpEnactResultExtension.kt | 8 +- .../openAPSAMA/DetermineBasalAdapterAMAJS.kt | 26 +- .../aps/openAPSAMA/DetermineBasalResultAMA.kt | 2 +- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 46 +-- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 30 +- .../aps/openAPSSMB/DetermineBasalResultSMB.kt | 4 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 58 ++-- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 37 +- .../OpenAPSSMBDynamicISFPlugin.kt | 32 +- .../plugins/aps/utils/JSONFormatter.kt | 2 +- .../plugins/general/autotune/AutotuneCore.kt | 4 +- .../plugins/general/autotune/AutotuneFS.kt | 4 +- .../general/autotune/AutotuneFragment.kt | 114 +++--- .../plugins/general/autotune/AutotuneIob.kt | 25 +- .../general/autotune/AutotunePlugin.kt | 40 +-- .../plugins/general/autotune/AutotunePrep.kt | 10 +- .../general/autotune/data/ATProfile.kt | 36 +- .../plugins/general/autotune/data/BGDatum.kt | 4 +- .../plugins/general/autotune/data/CRDatum.kt | 2 +- .../general/autotune/data/LocalInsulin.kt | 6 +- .../general/autotune/data/PreppedGlucose.kt | 2 +- .../autotune/events/EventAutotuneUpdateGui.kt | 2 +- .../plugins/aps/loop/LoopPluginTest.kt | 30 +- .../general/autotune/AutotuneCoreTest.kt | 8 +- .../general/autotune/AutotunePrepTest.kt | 16 +- .../nightscout/automation/AutomationEvent.kt | 12 +- .../automation/AutomationFragment.kt | 16 +- .../nightscout/automation/AutomationPlugin.kt | 46 +-- .../nightscout/automation/actions/Action.kt | 6 +- .../automation/actions/ActionAlarm.kt | 10 +- .../actions/ActionCarePortalEvent.kt | 16 +- .../automation/actions/ActionDummy.kt | 2 +- .../automation/actions/ActionLoopDisable.kt | 20 +- .../automation/actions/ActionLoopEnable.kt | 18 +- .../automation/actions/ActionLoopResume.kt | 18 +- .../automation/actions/ActionLoopSuspend.kt | 12 +- .../automation/actions/ActionNotification.kt | 10 +- .../automation/actions/ActionProfileSwitch.kt | 14 +- .../actions/ActionProfileSwitchPercent.kt | 10 +- .../automation/actions/ActionRunAutotune.kt | 16 +- .../automation/actions/ActionSendSMS.kt | 6 +- .../actions/ActionStartTempTarget.kt | 20 +- .../actions/ActionStopProcessing.kt | 4 +- .../actions/ActionStopTempTarget.kt | 10 +- .../automation/di/AutomationModule.kt | 2 +- .../automation/dialogs/BaseDialog.kt | 4 +- .../automation/dialogs/ChooseActionDialog.kt | 2 +- .../dialogs/ChooseOperationDialog.kt | 2 +- .../automation/dialogs/EditActionDialog.kt | 2 +- .../automation/dialogs/EditEventDialog.kt | 6 +- .../automation/dialogs/EditTriggerDialog.kt | 4 +- .../automation/elements/Comparator.kt | 2 +- .../automation/elements/ComparatorConnect.kt | 2 +- .../automation/elements/ComparatorExists.kt | 2 +- .../nightscout/automation/elements/InputBg.kt | 4 +- .../elements/InputCarePortalMenu.kt | 2 +- .../automation/elements/InputDateTime.kt | 4 +- .../automation/elements/InputDelta.kt | 2 +- .../automation/elements/InputDropdownMenu.kt | 2 +- .../automation/elements/InputLocationMode.kt | 2 +- .../automation/elements/InputProfileName.kt | 4 +- .../automation/elements/InputTempTarget.kt | 6 +- .../automation/elements/InputTime.kt | 7 +- .../automation/elements/InputTimeRange.kt | 6 +- .../automation/elements/LabelWithElement.kt | 2 +- .../automation/elements/StaticLabel.kt | 2 +- .../events/EventAutomationAddAction.kt | 2 +- .../events/EventAutomationDataChanged.kt | 2 +- .../events/EventAutomationUpdateAction.kt | 2 +- .../events/EventAutomationUpdateGui.kt | 2 +- .../events/EventAutomationUpdateTrigger.kt | 2 +- .../automation/events/EventLocationChange.kt | 2 +- .../automation/events/EventTriggerChanged.kt | 2 +- .../automation/events/EventTriggerClone.kt | 2 +- .../automation/events/EventTriggerRemove.kt | 2 +- .../automation/services/LocationService.kt | 16 +- .../services/LocationServiceHelper.kt | 2 +- .../nightscout/automation/triggers/Trigger.kt | 22 +- .../triggers/TriggerAutosensValue.kt | 2 +- .../automation/triggers/TriggerBTDevice.kt | 4 +- .../automation/triggers/TriggerBg.kt | 4 +- .../automation/triggers/TriggerBolusAgo.kt | 4 +- .../automation/triggers/TriggerCOB.kt | 2 +- .../automation/triggers/TriggerConnector.kt | 4 +- .../automation/triggers/TriggerDelta.kt | 5 +- .../automation/triggers/TriggerHeartRate.kt | 2 +- .../automation/triggers/TriggerIob.kt | 2 +- .../automation/triggers/TriggerLocation.kt | 2 +- .../triggers/TriggerProfilePercent.kt | 2 +- .../triggers/TriggerPumpLastConnection.kt | 2 +- .../triggers/TriggerRecurringTime.kt | 4 +- .../automation/triggers/TriggerTempTarget.kt | 2 +- .../triggers/TriggerTempTargetValue.kt | 5 +- .../automation/triggers/TriggerTime.kt | 4 +- .../automation/triggers/TriggerTimeRange.kt | 4 +- .../automation/triggers/TriggerWifiSsid.kt | 4 +- .../automation/AutomationEventTest.kt | 6 +- .../automation/BolusTimerImplTest.kt | 18 +- .../automation/CarbTimerImplTest.kt | 18 +- .../automation/actions/ActionAlarmTest.kt | 10 +- .../actions/ActionCarePortalEventTest.kt | 4 +- .../actions/ActionLoopDisableTest.kt | 4 +- .../actions/ActionLoopEnableTest.kt | 4 +- .../actions/ActionLoopResumeTest.kt | 2 +- .../actions/ActionLoopSuspendTest.kt | 2 +- .../actions/ActionNotificationTest.kt | 8 +- .../actions/ActionProfileSwitchPercentTest.kt | 2 +- .../actions/ActionProfileSwitchTest.kt | 2 +- .../automation/actions/ActionSendSMSTest.kt | 2 +- .../actions/ActionStartTempTargetTest.kt | 4 +- .../actions/ActionStopProcessingTest.kt | 2 +- .../actions/ActionStopTempTargetTest.kt | 2 +- .../automation/actions/ActionsTestBase.kt | 30 +- .../automation/elements/InputBgTest.kt | 2 +- .../elements/InputTempTargetTest.kt | 2 +- .../automation/triggers/TriggerBgTest.kt | 6 +- .../automation/triggers/TriggerCOBTest.kt | 2 +- .../automation/triggers/TriggerDeltaTest.kt | 8 +- .../automation/triggers/TriggerIobTest.kt | 2 +- .../triggers/TriggerRecurringTimeTest.kt | 4 +- .../triggers/TriggerTempTargetValueTest.kt | 2 +- .../automation/triggers/TriggerTestBase.kt | 4 +- .../triggers/TriggerTimeRangeTest.kt | 2 +- .../automation/triggers/TriggerTimeTest.kt | 2 +- .../triggers/TriggerWifiSsidTest.kt | 2 +- .../configuration/AndroidPermissionImpl.kt | 12 +- .../DaggerAppCompatActivityWithResult.kt | 12 +- .../activities/SingleFragmentActivity.kt | 8 +- .../configBuilder/ConfigBuilderFragment.kt | 20 +- .../configBuilder/ConfigBuilderPlugin.kt | 52 +-- .../configBuilder/RunningConfigurationImpl.kt | 34 +- .../events/EventConfigBuilderUpdateGui.kt | 2 +- .../configuration/di/ConfigurationModule.kt | 8 +- .../maintenance/ImportExportPrefsImpl.kt | 52 +-- .../maintenance/MaintenanceFragment.kt | 39 ++- .../maintenance/MaintenancePlugin.kt | 20 +- .../maintenance/PrefFileListProviderImpl.kt | 28 +- .../maintenance/PrefsFileContract.kt | 2 +- .../maintenance/PrefsMetadataKeyImpl.kt | 2 +- .../CustomWatchfaceImportListActivity.kt | 42 +-- .../activities/LogSettingActivity.kt | 6 +- .../activities/PrefImportListActivity.kt | 6 +- .../maintenance/data/PrefsFormat.kt | 6 +- .../dialogs/PrefImportSummaryDialog.kt | 6 +- .../formats/EncryptedPrefsFormat.kt | 10 +- .../configuration/setupwizard/SWDefinition.kt | 48 +-- .../setupwizard/SWEventListener.kt | 4 +- .../configuration/setupwizard/SWScreen.kt | 2 +- .../setupwizard/SetupWizardActivity.kt | 18 +- .../elements/SWEditEncryptedPassword.kt | 2 +- .../setupwizard/elements/SWEditIntNumber.kt | 2 +- .../setupwizard/elements/SWEditNumber.kt | 2 +- .../elements/SWEditNumberWithUnits.kt | 8 +- .../setupwizard/elements/SWItem.kt | 16 +- .../setupwizard/elements/SWPlugin.kt | 10 +- .../setupwizard/elements/SWPreference.kt | 2 +- .../setupwizard/events/EventSWLabel.kt | 2 +- .../formats/EncryptedPrefsFormatTest.kt | 4 +- .../formats/SingleStringStorage.kt | 2 +- .../constraints/ConstraintsCheckerImpl.kt | 12 +- .../bgQualityCheck/BgQualityCheckPlugin.kt | 32 +- .../di/PluginsConstraintsModule.kt | 6 +- .../constraints/dstHelper/DstHelperPlugin.kt | 26 +- .../objectives/ObjectivesFragment.kt | 20 +- .../objectives/ObjectivesPlugin.kt | 36 +- .../constraints/objectives/SntpClient.kt | 327 +++++++++--------- .../activities/ObjectivesExamDialog.kt | 14 +- .../objectives/dialogs/NtpProgressDialog.kt | 42 +-- .../events/EventObjectivesUpdateGui.kt | 2 +- .../objectives/objectives/Objective.kt | 13 +- .../objectives/objectives/Objective0.kt | 14 +- .../objectives/objectives/Objective1.kt | 6 +- .../objectives/objectives/Objective10.kt | 2 +- .../objectives/objectives/Objective11.kt | 2 +- .../objectives/objectives/Objective3.kt | 4 +- .../objectives/objectives/Objective4.kt | 8 +- .../objectives/objectives/Objective5.kt | 4 +- .../objectives/objectives/Objective6.kt | 6 +- .../objectives/objectives/Objective7.kt | 2 +- .../objectives/objectives/Objective9.kt | 2 +- .../phoneChecker/PhoneCheckerPlugin.kt | 12 +- .../constraints/safety/SafetyPlugin.kt | 44 +-- .../SignatureVerifierPlugin.kt | 20 +- .../storage/StorageConstraintPlugin.kt | 22 +- .../versionChecker/VersionCheckerPlugin.kt | 28 +- .../versionChecker/VersionCheckerUtilsImpl.kt | 22 +- .../constraints/ConstraintsCheckerImplTest.kt | 34 +- .../BgQualityCheckPluginTest.kt | 16 +- .../dstHelper/DstHelperPluginTest.kt | 8 +- .../objectives/ObjectivesPluginTest.kt | 12 +- .../constraints/objectives/SntpClientTest.kt | 2 +- .../constraints/safety/SafetyPluginTest.kt | 22 +- .../VersionCheckerUtilsKtTest.kt | 14 +- .../storage/StorageConstraintPluginTest.kt | 6 +- .../nightscout/insulin/InsulinFragment.kt | 10 +- .../insulin/InsulinLyumjevPlugin.kt | 16 +- .../insulin/InsulinOrefBasePlugin.kt | 28 +- .../insulin/InsulinOrefFreePeakPlugin.kt | 18 +- .../insulin/InsulinOrefRapidActingPlugin.kt | 16 +- .../InsulinOrefUltraRapidActingPlugin.kt | 16 +- .../insulin/InsulinLyumjevPluginTest.kt | 16 +- .../insulin/InsulinOrefBasePluginTest.kt | 18 +- .../insulin/InsulinOrefFreePeakPluginTest.kt | 14 +- .../InsulinOrefRapidActingPluginTest.kt | 16 +- .../InsulinOrefUltraRapidActingPluginTest.kt | 16 +- .../nightscout/plugins/di/OverviewModule.kt | 2 +- .../nightscout/plugins/di/PluginsModule.kt | 5 +- .../nightscout/plugins/di/ProfileModule.kt | 2 +- .../general/actions/ActionsFragment.kt | 48 +-- .../plugins/general/actions/ActionsPlugin.kt | 14 +- .../plugins/general/food/FoodFragment.kt | 20 +- .../plugins/general/food/FoodPlugin.kt | 22 +- .../general/overview/OverviewFragment.kt | 107 +++--- .../general/overview/OverviewMenusImpl.kt | 131 +++++-- .../general/overview/OverviewPlugin.kt | 32 +- .../general/overview/graphData/GraphData.kt | 12 +- .../DismissNotificationService.kt | 5 +- .../notifications/NotificationStore.kt | 20 +- .../notifications/NotificationWithAction.kt | 18 +- .../events/EventUpdateOverviewNotification.kt | 2 +- .../general/overview/ui/StatusLightHandler.kt | 66 +++- .../persistentNotification/DummyService.kt | 27 +- .../DummyServiceHelper.kt | 2 +- .../PersistentNotificationPlugin.kt | 40 +-- .../general/smsCommunicator/AuthRequest.kt | 18 +- .../SmsCommunicatorFragment.kt | 10 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 72 ++-- .../activities/SmsCommunicatorOtpActivity.kt | 6 +- .../events/EventSmsCommunicatorUpdateGui.kt | 2 +- .../smsCommunicator/otp/OneTimePassword.kt | 8 +- .../general/themes/ThemeSwitcherPlugin.kt | 28 +- .../plugins/general/wear/WearFragment.kt | 38 +- .../plugins/general/wear/WearPlugin.kt | 38 +- .../wear/activities/CwfInfosActivity.kt | 34 +- .../wear/wearintegration/DataHandlerMobile.kt | 78 ++--- .../DataLayerListenerServiceMobile.kt | 39 ++- .../DataLayerListenerServiceMobileHelper.kt | 2 +- .../IobCobCalculatorPlugin.kt | 62 ++-- .../data/AutosensDataObject.kt | 18 +- .../data/AutosensDataStoreObject.kt | 14 +- .../plugins/profile/ProfileFragment.kt | 45 +-- .../plugins/profile/ProfilePlugin.kt | 50 +-- .../plugins/profile/ui/TimeListEdit.kt | 6 +- .../nightscout/plugins/skins/SkinButtonsOn.kt | 2 +- .../nightscout/plugins/skins/SkinClassic.kt | 2 +- .../plugins/skins/SkinLargeDisplay.kt | 2 +- .../nightscout/plugins/skins/SkinLowRes.kt | 2 +- .../nightscout/plugins/skins/SkinProvider.kt | 2 +- .../core/extensions/BolusExtensionKtTest.kt | 8 +- .../ExtendedBolusExtensionKtTest.kt | 12 +- .../extensions/GlucoseValueExtensionKtTest.kt | 4 +- .../TemporaryBasalExtensionKtTest.kt | 12 +- .../TemporaryTargetExtensionKtTest.kt | 2 +- .../extensions/TherapyEventExtensionKtTest.kt | 2 +- .../smsCommunicator/AuthRequestTest.kt | 12 +- .../SmsCommunicatorPluginTest.kt | 36 +- .../general/smsCommunicator/SmsTest.kt | 2 +- .../plugins/iob/AutosensDataStoreTest.kt | 12 +- .../sensitivity/AbstractSensitivityPlugin.kt | 52 +-- .../sensitivity/SensitivityAAPSPlugin.kt | 24 +- .../sensitivity/SensitivityOref1Plugin.kt | 30 +- .../SensitivityWeightedAveragePlugin.kt | 24 +- .../extensions/ProfileSwitchExtensions.kt | 2 +- .../extensions/TherapyEventExtensions.kt | 2 +- .../AbstractSensitivityPluginTest.kt | 14 +- .../smoothing/AvgSmoothingPlugin.kt | 18 +- .../smoothing/ExponentialSmoothingPlugin.kt | 14 +- .../nightscout/smoothing/NoSmoothingPlugin.kt | 14 +- .../info/nightscout/source/AidexPlugin.kt | 20 +- .../nightscout/source/BGSourceFragment.kt | 30 +- .../info/nightscout/source/DexcomPlugin.kt | 28 +- .../info/nightscout/source/EversensePlugin.kt | 16 +- .../info/nightscout/source/GlimpPlugin.kt | 14 +- .../info/nightscout/source/GlunovoPlugin.kt | 24 +- .../info/nightscout/source/IntelligoPlugin.kt | 24 +- .../info/nightscout/source/MM640gPlugin.kt | 16 +- .../nightscout/source/NSClientSourcePlugin.kt | 16 +- .../info/nightscout/source/PoctechPlugin.kt | 18 +- .../info/nightscout/source/RandomBgPlugin.kt | 20 +- .../info/nightscout/source/TomatoPlugin.kt | 16 +- .../nightscout/source/XdripSourcePlugin.kt | 18 +- .../info/nightscout/source/di/SourceModule.kt | 6 +- .../info/nightscout/source/GlimpPluginTest.kt | 2 +- .../nightscout/source/MM640GPluginTest.kt | 2 +- .../nightscout/source/NSClientPluginTest.kt | 4 +- .../source/XdripSourcePluginTest.kt | 2 +- .../dataBroadcaster/DataBroadcastPlugin.kt | 48 +-- .../nightscout/plugins/sync/di/SyncModule.kt | 11 +- .../plugins/sync/nsShared/NSAlarm.kt | 2 +- .../plugins/sync/nsShared/NSClientFragment.kt | 28 +- .../nightscout/plugins/sync/nsShared/NSSgv.kt | 2 +- .../sync/nsShared/NsIncomingDataProcessor.kt | 32 +- .../sync/nsShared/StoreDataForDbImpl.kt | 29 +- .../events/EventConnectivityOptionChanged.kt | 2 +- .../nsShared/events/EventNSClientStatus.kt | 4 +- .../events/EventNSClientUpdateGuiData.kt | 2 +- .../events/EventNSClientUpdateGuiQueue.kt | 2 +- .../events/EventNSClientUpdateGuiStatus.kt | 2 +- .../sync/nsclient/DataSyncSelectorV1.kt | 20 +- .../plugins/sync/nsclient/NSClientPlugin.kt | 48 +-- .../plugins/sync/nsclient/ReceiverDelegate.kt | 16 +- .../plugins/sync/nsclient/acks/NSAddAck.kt | 12 +- .../plugins/sync/nsclient/acks/NSAuthAck.kt | 4 +- .../plugins/sync/nsclient/acks/NSUpdateAck.kt | 12 +- .../nsclient/data/NSDeviceStatusHandler.kt | 8 +- .../nsclient/data/NSSettingsStatusImpl.kt | 24 +- .../data/ProcessedDeviceStatusDataImpl.kt | 27 +- .../BolusCalculatorResultExtension.kt | 4 +- .../nsclient/extensions/BolusExtension.kt | 2 +- .../nsclient/extensions/CarbsExtension.kt | 2 +- .../extensions/DeviceStatusExtension.kt | 4 +- .../EffectiveProfileSwitchExtension.kt | 4 +- .../extensions/ExtendedBolusExtension.kt | 6 +- .../extensions/OfflineEventExtension.kt | 4 +- .../extensions/ProfileSwitchExtension.kt | 8 +- .../extensions/TemporaryBasalExtension.kt | 6 +- .../extensions/TemporaryTargetExtension.kt | 10 +- .../extensions/TherapyEventExtension.kt | 7 +- .../sync/nsclient/services/NSClientService.kt | 28 +- .../nsclient/workers/NSClientAddAckWorker.kt | 64 ++-- .../workers/NSClientAddUpdateWorker.kt | 18 +- .../nsclient/workers/NSClientMbgWorker.kt | 6 +- .../workers/NSClientUpdateRemoveAckWorker.kt | 54 +-- .../sync/nsclientV3/DataSyncSelectorV3.kt | 22 +- .../sync/nsclientV3/NSClientV3Plugin.kt | 74 ++-- .../BolusCalculatorResultExtension.kt | 2 +- .../nsclientV3/extensions/BolusExtension.kt | 2 +- .../nsclientV3/extensions/CarbsExtension.kt | 2 +- .../EffectiveProfileSwitchExtension.kt | 6 +- .../extensions/ExtendedBolusExtension.kt | 4 +- .../extensions/GlucoseValueExtension.kt | 2 +- .../extensions/OfflineEventExtension.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 8 +- .../extensions/TemporaryBasalExtension.kt | 4 +- .../extensions/TemporaryTargetExtension.kt | 2 +- .../extensions/TherapyEventExtension.kt | 2 +- .../sync/nsclientV3/workers/DataSyncWorker.kt | 6 +- .../sync/nsclientV3/workers/LoadBgWorker.kt | 16 +- .../workers/LoadDeviceStatusWorker.kt | 8 +- .../nsclientV3/workers/LoadFoodsWorker.kt | 10 +- .../workers/LoadLastModificationWorker.kt | 6 +- .../workers/LoadProfileStoreWorker.kt | 10 +- .../nsclientV3/workers/LoadStatusWorker.kt | 6 +- .../workers/LoadTreatmentsWorker.kt | 12 +- .../openhumans/OpenHumansUploaderPlugin.kt | 26 +- .../sync/openhumans/OpenHumansWorker.kt | 5 +- .../openhumans/delegates/OHAppIDDelegate.kt | 5 +- .../openhumans/delegates/OHCounterDelegate.kt | 3 +- .../openhumans/delegates/OHStateDelegate.kt | 2 +- .../plugins/sync/tidepool/TidepoolFragment.kt | 8 +- .../plugins/sync/tidepool/TidepoolPlugin.kt | 36 +- .../sync/tidepool/comm/InfoInterceptor.kt | 4 +- .../sync/tidepool/comm/TidepoolCallback.kt | 6 +- .../sync/tidepool/comm/TidepoolUploader.kt | 20 +- .../plugins/sync/tidepool/comm/UploadChunk.kt | 18 +- .../sync/tidepool/elements/BasalElement.kt | 7 +- .../sync/tidepool/elements/BaseElement.kt | 13 +- .../tidepool/elements/BloodGlucoseElement.kt | 4 +- .../sync/tidepool/elements/BolusElement.kt | 5 +- .../sync/tidepool/elements/ProfileElement.kt | 60 ++-- .../tidepool/elements/SensorGlucoseElement.kt | 6 +- .../sync/tidepool/elements/WizardElement.kt | 5 +- .../tidepool/events/EventTidepoolDoUpload.kt | 2 +- .../tidepool/events/EventTidepoolResetData.kt | 2 +- .../tidepool/events/EventTidepoolStatus.kt | 2 +- .../tidepool/events/EventTidepoolUpdateGUI.kt | 2 +- .../tidepool/messages/AuthRequestMessage.kt | 2 +- .../messages/OpenDatasetRequestMessage.kt | 6 +- .../plugins/sync/tidepool/utils/RateLimit.kt | 6 +- .../sync/xdrip/DataSyncSelectorXdripImpl.kt | 20 +- .../plugins/sync/xdrip/XdripFragment.kt | 16 +- .../plugins/sync/xdrip/XdripPlugin.kt | 58 ++-- .../sync/xdrip/events/EventXdripUpdateGUI.kt | 2 +- .../sync/xdrip/workers/XdripDataSyncWorker.kt | 6 +- .../DataBroadcastPluginTest.kt | 26 +- .../sync/nsclient/ReceiverDelegateTest.kt | 10 +- .../sync/nsclientV3/NSClientV3PluginTest.kt | 16 +- .../extensions/DeviceStatusExtensionKtTest.kt | 12 +- .../EffectiveProfileSwitchExtensionKtTest.kt | 2 +- .../ProfileSwitchExtensionKtTest.kt | 2 +- .../nsclientV3/workers/DataSyncWorkerTest.kt | 4 +- .../nsclientV3/workers/LoadBgWorkerTest.kt | 18 +- .../nightscout/pump/combo/ComboFragment.kt | 14 +- .../nightscout/pump/combo/ComboPlugin.java | 56 +-- .../pump/combo/data/ComboErrorUtil.kt | 2 +- .../combo/events/EventComboPumpUpdateGUI.kt | 2 +- .../combo/ruffyscripter/RuffyScripter.java | 4 +- .../ruffyscripter/commands/BolusCommand.java | 6 +- .../commands/CancelTbrCommand.java | 6 +- .../commands/ReadBasalProfileCommand.java | 6 +- .../commands/ReadHistoryCommand.java | 4 +- .../commands/ReadQuickInfoCommand.java | 4 +- .../commands/SetBasalProfileCommand.java | 4 +- .../ruffyscripter/commands/SetTbrCommand.java | 4 +- .../nightscout/pump/combo/ComboPluginTest.kt | 18 +- .../pump/combov2/AAPSComboCtlLogger.kt | 11 +- .../pump/combov2/AAPSPumpStateStore.kt | 43 ++- .../pump/combov2/ComboV2Fragment.kt | 61 ++-- .../nightscout/pump/combov2/ComboV2Plugin.kt | 66 ++-- .../info/nightscout/pump/combov2/Delegates.kt | 7 +- .../nightscout/pump/combov2/InternalSP.kt | 15 +- .../info/nightscout/pump/combov2/Utility.kt | 10 +- .../activities/ComboV2PairingActivity.kt | 38 +- .../info/nightscout/pump/dana/DanaFragment.kt | 56 +-- .../info/nightscout/pump/dana/DanaPump.kt | 33 +- .../dana/activities/DanaHistoryActivity.kt | 32 +- .../activities/DanaUserOptionsActivity.kt | 25 +- .../pump/dana/events/EventDanaRNewStatus.kt | 2 +- .../info/nightscout/pump/dana/DanaPumpTest.kt | 2 +- .../danaRKorean/DanaRKoreanPlugin.kt | 44 +-- .../danaRKorean/comm/MsgCheckValue_k.kt | 2 +- .../comm/MsgInitConnStatusBasic_k.kt | 6 +- .../comm/MsgInitConnStatusBolus_k.kt | 6 +- .../comm/MsgInitConnStatusTime_k.kt | 8 +- .../comm/MsgSettingBasalProfileAll_k.kt | 7 +- .../danaRKorean/comm/MsgSettingBasal_k.kt | 2 +- .../danaRKorean/comm/MsgStatusBasic_k.kt | 3 +- .../danaRKorean/comm/MsgStatus_k.kt | 3 +- .../services/DanaRKoreanExecutionService.java | 44 +-- .../androidaps/danaRv2/DanaRv2Plugin.java | 46 +-- .../danaRv2/comm/MsgCheckValue_v2.kt | 8 +- .../danaRv2/comm/MsgHistoryEventsV2.kt | 13 +- .../comm/MsgSetAPSTempBasalStart_v2.kt | 3 +- .../danaRv2/comm/MsgSetHistoryEntry_v2.kt | 2 +- .../danaRv2/comm/MsgStatusAPS_v2.kt | 3 +- .../services/DanaRv2ExecutionService.java | 52 +-- .../androidaps/danar/AbstractDanaRPlugin.java | 60 ++-- .../androidaps/danar/DanaRPlugin.java | 42 +-- .../androidaps/danar/SerialIOThread.java | 4 +- .../androidaps/danar/comm/MessageBase.kt | 26 +- .../androidaps/danar/comm/MsgBolusProgress.kt | 4 +- .../androidaps/danar/comm/MsgBolusStart.kt | 2 +- .../danar/comm/MsgBolusStartWithSpeed.kt | 2 +- .../androidaps/danar/comm/MsgBolusStop.kt | 4 +- .../androidaps/danar/comm/MsgCheckValue.kt | 3 +- .../androidaps/danar/comm/MsgError.kt | 4 +- .../androidaps/danar/comm/MsgHistoryAlarm.kt | 3 +- .../androidaps/danar/comm/MsgHistoryAll.kt | 6 +- .../danar/comm/MsgHistoryAllDone.kt | 3 +- .../danar/comm/MsgHistoryBasalHour.kt | 3 +- .../androidaps/danar/comm/MsgHistoryBolus.kt | 3 +- .../androidaps/danar/comm/MsgHistoryCarbo.kt | 3 +- .../danar/comm/MsgHistoryDailyInsulin.kt | 3 +- .../androidaps/danar/comm/MsgHistoryDone.kt | 3 +- .../androidaps/danar/comm/MsgHistoryError.kt | 3 +- .../danar/comm/MsgHistoryGlucose.kt | 3 +- .../androidaps/danar/comm/MsgHistoryNew.kt | 3 +- .../danar/comm/MsgHistoryNewDone.kt | 3 +- .../androidaps/danar/comm/MsgHistoryRefill.kt | 3 +- .../danar/comm/MsgHistorySuspend.kt | 3 +- .../danar/comm/MsgInitConnStatusBasic.kt | 3 +- .../danar/comm/MsgInitConnStatusBolus.kt | 6 +- .../danar/comm/MsgInitConnStatusOption.kt | 6 +- .../danar/comm/MsgInitConnStatusTime.kt | 8 +- .../androidaps/danar/comm/MsgPCCommStart.kt | 5 +- .../androidaps/danar/comm/MsgPCCommStop.kt | 3 +- .../danar/comm/MsgSetActivateBasalProfile.kt | 3 +- .../danar/comm/MsgSetBasalProfile.kt | 4 +- .../androidaps/danar/comm/MsgSetCarbsEntry.kt | 2 +- .../danar/comm/MsgSetExtendedBolusStart.kt | 2 +- .../danar/comm/MsgSetExtendedBolusStop.kt | 3 +- .../danar/comm/MsgSetSingleBasalProfile.kt | 4 +- .../danar/comm/MsgSetTempBasalStart.kt | 3 +- .../danar/comm/MsgSetTempBasalStop.kt | 3 +- .../androidaps/danar/comm/MsgSetTime.kt | 3 +- .../danar/comm/MsgSetUserOptions.kt | 5 +- .../danar/comm/MsgSettingActiveProfile.kt | 3 +- .../androidaps/danar/comm/MsgSettingBasal.kt | 2 +- .../danar/comm/MsgSettingBasalProfileAll.kt | 7 +- .../danar/comm/MsgSettingGlucose.kt | 3 +- .../danar/comm/MsgSettingMaxValues.kt | 3 +- .../androidaps/danar/comm/MsgSettingMeal.kt | 6 +- .../danar/comm/MsgSettingProfileRatios.kt | 3 +- .../danar/comm/MsgSettingProfileRatiosAll.kt | 3 +- .../danar/comm/MsgSettingPumpTime.kt | 2 +- .../danar/comm/MsgSettingShippingInfo.kt | 3 +- .../danar/comm/MsgSettingUserOptions.kt | 3 +- .../androidaps/danar/comm/MsgStatus.kt | 3 +- .../androidaps/danar/comm/MsgStatusBasic.kt | 3 +- .../danar/comm/MsgStatusBolusExtended.kt | 4 +- .../androidaps/danar/comm/MsgStatusProfile.kt | 3 +- .../danar/comm/MsgStatusTempBasal.kt | 4 +- .../AbstractDanaRExecutionService.java | 34 +- .../danar/services/DanaRExecutionService.java | 30 +- .../nightscout/pump/danaR/DanaRPluginTest.kt | 12 +- .../pump/danaR/comm/DanaRTestBase.kt | 14 +- .../pump/danaR/comm/MsgBolusProgressTest.kt | 2 +- .../pump/danaR/comm/MsgBolusStopTest.kt | 2 +- .../pump/danaR/comm/MsgSettingBasalTest.kt | 2 +- .../danaR/comm/MsgStatusBolusExtendedTest.kt | 2 +- .../pump/danaRKorean/DanaRKoreanPluginTest.kt | 12 +- .../pump/danaRv2/DanaRv2PluginTest.kt | 16 +- .../nightscout/pump/danars/DanaRSPlugin.kt | 72 ++-- .../pump/danars/activities/BLEScanActivity.kt | 8 +- .../danars/activities/EnterPinActivity.kt | 13 +- .../pump/danars/comm/DanaRSPacket.kt | 6 +- .../DanaRSPacketAPSBasalSetTemporaryBasal.kt | 2 +- .../comm/DanaRSPacketAPSHistoryEvents.kt | 27 +- .../comm/DanaRSPacketAPSSetEventHistory.kt | 2 +- .../comm/DanaRSPacketBasalGetBasalRate.kt | 10 +- .../comm/DanaRSPacketBasalGetProfileNumber.kt | 2 +- ...anaRSPacketBasalSetCancelTemporaryBasal.kt | 2 +- .../DanaRSPacketBasalSetProfileBasalRate.kt | 2 +- .../comm/DanaRSPacketBasalSetProfileNumber.kt | 2 +- .../comm/DanaRSPacketBasalSetSuspendOff.kt | 2 +- .../comm/DanaRSPacketBasalSetSuspendOn.kt | 2 +- .../DanaRSPacketBasalSetTemporaryBasal.kt | 2 +- .../comm/DanaRSPacketBolusGet24CIRCFArray.kt | 2 +- .../comm/DanaRSPacketBolusGetBolusOption.kt | 10 +- .../comm/DanaRSPacketBolusGetCIRCFArray.kt | 2 +- ...aRSPacketBolusGetCalculationInformation.kt | 2 +- ...anaRSPacketBolusGetStepBolusInformation.kt | 2 +- .../comm/DanaRSPacketBolusSet24CIRCFArray.kt | 8 +- .../comm/DanaRSPacketBolusSetBolusOption.kt | 2 +- .../comm/DanaRSPacketBolusSetExtendedBolus.kt | 2 +- ...DanaRSPacketBolusSetExtendedBolusCancel.kt | 2 +- .../DanaRSPacketBolusSetStepBolusStart.kt | 4 +- .../comm/DanaRSPacketBolusSetStepBolusStop.kt | 8 +- .../comm/DanaRSPacketEtcKeepConnection.kt | 2 +- .../comm/DanaRSPacketEtcSetHistorySave.kt | 2 +- .../comm/DanaRSPacketGeneralGetPumpCheck.kt | 10 +- ...naRSPacketGeneralGetShippingInformation.kt | 2 +- .../DanaRSPacketGeneralGetShippingVersion.kt | 2 +- ...anaRSPacketGeneralGetUserTimeChangeFlag.kt | 2 +- ...RSPacketGeneralInitialScreenInformation.kt | 2 +- ...DanaRSPacketGeneralSetHistoryUploadMode.kt | 2 +- ...PacketGeneralSetUserTimeChangeFlagClear.kt | 2 +- .../pump/danars/comm/DanaRSPacketHistory.kt | 10 +- .../danars/comm/DanaRSPacketHistoryAlarm.kt | 4 +- .../comm/DanaRSPacketHistoryAllHistory.kt | 2 +- .../danars/comm/DanaRSPacketHistoryBasal.kt | 4 +- .../comm/DanaRSPacketHistoryBloodGlucose.kt | 4 +- .../danars/comm/DanaRSPacketHistoryBolus.kt | 2 +- .../comm/DanaRSPacketHistoryCarbohydrate.kt | 4 +- .../danars/comm/DanaRSPacketHistoryDaily.kt | 4 +- .../danars/comm/DanaRSPacketHistoryPrime.kt | 4 +- .../danars/comm/DanaRSPacketHistoryRefill.kt | 4 +- .../danars/comm/DanaRSPacketHistorySuspend.kt | 4 +- .../comm/DanaRSPacketHistoryTemporary.kt | 2 +- .../danars/comm/DanaRSPacketNotifyAlarm.kt | 22 +- .../DanaRSPacketNotifyDeliveryComplete.kt | 8 +- .../DanaRSPacketNotifyDeliveryRateDisplay.kt | 8 +- .../DanaRSPacketNotifyMissedBolusAlarm.kt | 2 +- .../comm/DanaRSPacketOptionGetPumpTime.kt | 2 +- ...DanaRSPacketOptionGetPumpUTCAndTimeZone.kt | 2 +- .../comm/DanaRSPacketOptionGetUserOption.kt | 2 +- .../comm/DanaRSPacketOptionSetPumpTime.kt | 2 +- ...DanaRSPacketOptionSetPumpUTCAndTimeZone.kt | 2 +- .../comm/DanaRSPacketOptionSetUserOption.kt | 5 +- .../danars/comm/DanaRSPacketReviewBolusAvg.kt | 2 +- .../comm/DanaRSPacketReviewGetPumpDecRatio.kt | 2 +- .../danars/dialogs/PairingProgressDialog.kt | 6 +- .../danars/events/EventDanaRSDeviceChange.kt | 2 +- .../events/EventDanaRSPairingSuccess.kt | 2 +- .../pump/danars/services/BLEComm.kt | 81 ++--- .../pump/danars/services/DanaRSService.kt | 105 +++--- .../pump/danars/DanaRSPluginTest.kt | 12 +- .../nightscout/pump/danars/DanaRSTestBase.kt | 4 +- .../DanaRSPacketNotifyDeliveryCompleteTest.kt | 2 +- .../danars/comm/DanaRsMessageHashTableTest.kt | 2 +- .../comm/DanaRsPacketApsHistoryEventsTest.kt | 6 +- .../DanaRsPacketBolusSetStepBolusStartTest.kt | 10 +- .../DanaRsPacketBolusSetStepBolusStopTest.kt | 2 +- .../comm/DanaRsPacketNotifyAlarmTest.kt | 2 +- ...naRsPacketNotifyDeliveryRateDisplayTest.kt | 12 +- .../pump/diaconn/DiaconnG8Fragment.kt | 49 +-- .../pump/diaconn/DiaconnG8Plugin.kt | 76 ++-- .../nightscout/pump/diaconn/DiaconnG8Pump.kt | 37 +- .../activities/DiaconnG8BLEScanActivity.kt | 6 +- .../activities/DiaconnG8HistoryActivity.kt | 34 +- .../DiaconnG8UserOptionsActivity.kt | 16 +- .../pump/diaconn/api/DiaconnLogUploader.kt | 8 +- .../events/EventDiaconnG8DeviceChange.kt | 2 +- .../diaconn/events/EventDiaconnG8NewStatus.kt | 2 +- .../diaconn/packet/AppCancelSettingPacket.kt | 7 +- .../packet/AppCancelSettingResponsePacket.kt | 12 +- .../diaconn/packet/AppConfirmSettingPacket.kt | 7 +- .../packet/AppConfirmSettingResponsePacket.kt | 16 +- .../diaconn/packet/BasalLimitInquirePacket.kt | 7 +- .../packet/BasalLimitInquireResponsePacket.kt | 18 +- .../diaconn/packet/BasalPauseReportPacket.kt | 9 +- .../diaconn/packet/BasalPauseSettingPacket.kt | 9 +- .../packet/BasalPauseSettingResponsePacket.kt | 11 +- .../pump/diaconn/packet/BasalSettingPacket.kt | 7 +- .../packet/BasalSettingReportPacket.kt | 7 +- .../packet/BasalSettingResponsePacket.kt | 11 +- .../packet/BatteryWarningReportPacket.kt | 7 +- .../packet/BigAPSMainInfoInquirePacket.kt | 7 +- .../BigAPSMainInfoInquireResponsePacket.kt | 66 ++-- .../diaconn/packet/BigLogInquirePacket.kt | 13 +- .../packet/BigLogInquireResponsePacket.kt | 26 +- .../packet/BigMainInfoInquirePacket.kt | 7 +- .../BigMainInfoInquireResponsePacket.kt | 56 +-- .../diaconn/packet/BolusSpeedInquirePacket.kt | 8 +- .../packet/BolusSpeedInquireResponsePacket.kt | 11 +- .../diaconn/packet/BolusSpeedSettingPacket.kt | 5 +- .../packet/BolusSpeedSettingReportPacket.kt | 10 +- .../packet/BolusSpeedSettingResponsePacket.kt | 10 +- .../diaconn/packet/ConfirmReportPacket.kt | 10 +- .../pump/diaconn/packet/DiaconnG8Packet.java | 100 +++--- .../packet/DisplayTimeInquirePacket.kt | 7 +- .../DisplayTimeInquireResponsePacket.kt | 11 +- .../packet/DisplayTimeoutSettingPacket.kt | 7 +- .../DisplayTimeoutSettingResponsePacket.kt | 10 +- .../packet/IncarnationInquirePacket.kt | 9 +- .../IncarnationInquireResponsePacket.kt | 13 +- .../packet/InjectionBasalReportPacket.kt | 8 +- .../packet/InjectionBasalSettingPacket.kt | 10 +- .../InjectionBasalSettingResponsePacket.kt | 10 +- .../packet/InjectionBlockReportPacket.kt | 7 +- .../packet/InjectionCancelSettingPacket.kt | 7 +- .../InjectionCancelSettingResponsePacket.kt | 10 +- ...njectionExtendedBolusResultReportPacket.kt | 10 +- .../InjectionExtendedBolusSettingPacket.kt | 10 +- ...ctionExtendedBolusSettingResponsePacket.kt | 10 +- .../packet/InjectionMealSettingPacket.kt | 12 +- .../InjectionMealSettingResponsePacket.kt | 10 +- .../packet/InjectionProgressReportPacket.kt | 16 +- .../packet/InjectionSnackInquirePacket.kt | 8 +- .../InjectionSnackInquireResponsePacket.kt | 9 +- .../InjectionSnackResultReportPacket.kt | 14 +- .../packet/InjectionSnackSettingPacket.kt | 10 +- .../InjectionSnackSettingResponsePacket.kt | 10 +- .../diaconn/packet/InsulinLackReportPacket.kt | 5 +- .../diaconn/packet/LanguageInquirePacket.kt | 7 +- .../packet/LanguageInquireResponsePacket.kt | 11 +- .../diaconn/packet/LanguageSettingPacket.kt | 7 +- .../packet/LanguageSettingResponsePacket.kt | 12 +- .../diaconn/packet/LogStatusInquirePacket.kt | 9 +- .../packet/LogStatusInquireResponsePacket.kt | 10 +- .../pump/diaconn/packet/RejectReportPacket.kt | 14 +- .../diaconn/packet/SerialNumInquirePacket.kt | 9 +- .../packet/SerialNumInquireResponsePacket.kt | 13 +- .../diaconn/packet/SneckLimitInquirePacket.kt | 7 +- .../packet/SneckLimitInquireResponsePacket.kt | 13 +- .../pump/diaconn/packet/SoundInquirePacket.kt | 7 +- .../packet/SoundInquireResponsePacket.kt | 13 +- .../pump/diaconn/packet/SoundSettingPacket.kt | 7 +- .../packet/SoundSettingResponsePacket.kt | 12 +- .../diaconn/packet/TempBasalInquirePacket.kt | 7 +- .../packet/TempBasalInquireResponsePacket.kt | 11 +- .../diaconn/packet/TempBasalReportPacket.kt | 6 +- .../diaconn/packet/TempBasalSettingPacket.kt | 9 +- .../packet/TempBasalSettingResponsePacket.kt | 12 +- .../pump/diaconn/packet/TimeInquirePacket.kt | 7 +- .../packet/TimeInquireResponsePacket.kt | 7 +- .../pump/diaconn/packet/TimeReportPacket.kt | 24 +- .../pump/diaconn/packet/TimeSettingPacket.kt | 9 +- .../packet/TimeSettingResponsePacket.kt | 10 +- .../pump/diaconn/service/BLECommonService.kt | 12 +- .../pump/diaconn/service/DiaconnG8Service.kt | 68 ++-- .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 60 ++-- .../plugins/pump/eopatch/RxAction.kt | 5 +- .../pump/eopatch/alarm/AlarmManager.kt | 63 ++-- .../pump/eopatch/alarm/AlarmProcess.kt | 26 +- .../pump/eopatch/alarm/AlarmRegistry.kt | 12 +- .../pump/eopatch/ble/IPatchManager.java | 9 +- .../pump/eopatch/ble/PatchManager.java | 22 +- .../pump/eopatch/ble/PatchManagerImpl.java | 12 +- .../pump/eopatch/ble/PatchStateManager.java | 14 +- .../pump/eopatch/ble/PreferenceManager.kt | 42 +-- .../pump/eopatch/ble/task/ActivateTask.java | 2 +- .../pump/eopatch/ble/task/DeactivateTask.java | 4 +- .../pump/eopatch/ble/task/FetchAlarmTask.java | 8 +- .../eopatch/ble/task/GetPatchInfoTask.java | 18 +- .../eopatch/ble/task/InfoReminderTask.java | 6 +- .../ble/task/InternalSuspendedTask.java | 42 +-- .../eopatch/ble/task/NeedleSensingTask.java | 2 +- .../pump/eopatch/ble/task/PauseBasalTask.java | 51 ++- .../pump/eopatch/ble/task/PrimingTask.java | 2 +- .../ble/task/ReadBolusFinishTimeTask.java | 2 +- .../ble/task/ReadTempBasalFinishTimeTask.java | 6 +- .../eopatch/ble/task/ResumeBasalTask.java | 2 +- .../pump/eopatch/ble/task/SelfTestTask.java | 14 +- .../eopatch/ble/task/SetGlobalTimeTask.java | 8 +- .../eopatch/ble/task/SetLowReservoirTask.java | 6 +- .../pump/eopatch/ble/task/StartBondTask.java | 3 +- .../eopatch/ble/task/StartCalcBolusTask.java | 8 +- .../ble/task/StartNormalBasalTask.java | 14 +- .../eopatch/ble/task/StartQuickBolusTask.java | 2 +- .../eopatch/ble/task/StartTempBasalTask.java | 4 +- .../pump/eopatch/ble/task/StopBasalTask.java | 42 +-- .../eopatch/ble/task/StopComboBolusTask.java | 12 +- .../eopatch/ble/task/StopExtBolusTask.java | 10 +- .../eopatch/ble/task/StopNowBolusTask.java | 12 +- .../eopatch/ble/task/StopTempBasalTask.java | 10 +- .../pump/eopatch/ble/task/TaskBase.java | 4 +- .../pump/eopatch/ble/task/TaskQueue.java | 6 +- .../ble/task/UpdateConnectionTask.java | 6 +- .../pump/eopatch/event/EoPatchEvents.kt | 2 +- .../eopatch/extension/ObservableExtension.kt | 24 +- .../pump/eopatch/extension/SingleExtension.kt | 8 +- .../pump/eopatch/ui/AlarmHelperActivity.kt | 56 +-- .../plugins/pump/eopatch/ui/EoBaseActivity.kt | 4 +- .../eopatch/ui/EopatchOverviewFragment.kt | 30 +- .../ui/dialogs/ActivationNotCompleteDialog.kt | 10 +- .../pump/eopatch/ui/dialogs/AlarmDialog.kt | 58 ++-- .../pump/eopatch/ui/dialogs/CommonDialog.kt | 22 +- .../ui/viewmodel/EopatchOverviewViewModel.kt | 187 +++++----- .../eopatch/ui/viewmodel/EopatchViewModel.kt | 323 +++++++++-------- .../plugins/pump/eopatch/vo/Alarms.kt | 24 +- .../plugins/pump/eopatch/vo/BolusCurrent.kt | 18 +- .../plugins/pump/eopatch/vo/IPreference.kt | 5 +- .../pump/eopatch/vo/NormalBasalManager.kt | 43 +-- .../plugins/pump/eopatch/vo/PatchConfig.kt | 44 ++- .../plugins/pump/eopatch/vo/PatchState.kt | 33 +- .../pump/eopatch/vo/TempBasalManager.kt | 11 +- .../pump/medtronic/MedtronicFragment.kt | 36 +- .../pump/medtronic/MedtronicPumpPlugin.kt | 56 +-- .../comm/MedtronicCommunicationManager.kt | 8 +- .../pump/medtronic/comm/MedtronicConverter.kt | 6 +- .../comm/history/MedtronicHistoryDecoder.kt | 4 +- .../medtronic/comm/history/RawHistoryPage.kt | 4 +- .../cgms/MedtronicCGMSHistoryDecoder.kt | 6 +- .../pump/MedtronicPumpHistoryDecoder.kt | 4 +- .../comm/history/pump/PumpHistoryResult.kt | 4 +- .../medtronic/comm/message/PumpMessage.kt | 4 +- .../pump/medtronic/comm/ui/MedtronicUIComm.kt | 4 +- .../comm/ui/MedtronicUIPostprocessor.kt | 6 +- .../pump/medtronic/comm/ui/MedtronicUITask.kt | 6 +- .../medtronic/data/MedtronicHistoryData.kt | 22 +- .../pump/medtronic/data/dto/BasalProfile.kt | 6 +- .../medtronic/data/dto/BasalProfileEntry.kt | 13 +- .../data/dto/RLHistoryItemMedtronic.kt | 2 +- .../pump/medtronic/data/dto/TempBasalPair.kt | 4 +- .../medtronic/data/dto/TempBasalProcessDTO.kt | 20 +- .../defs/MedtronicCustomActionType.kt | 2 +- .../defs/MedtronicNotificationType.kt | 17 +- .../dialog/MedtronicHistoryActivity.kt | 8 +- .../medtronic/driver/MedtronicPumpStatus.kt | 8 +- .../EventMedtronicPumpConfigurationChanged.kt | 2 +- .../events/EventMedtronicPumpValuesChanged.kt | 2 +- .../service/RileyLinkMedtronicService.kt | 2 +- .../pump/medtronic/util/MedtronicUtil.kt | 12 +- .../pump/medtronic/MedtronicTestBase.kt | 8 +- .../comm/MedtronicHistoryDataUTest.kt | 2 +- .../pump/MedtronicPumpHistoryDecoderUTest.kt | 2 +- .../data/MedtronicHistoryDataUTest.kt | 2 +- .../nightscout/pump/medtrum/MedtrumPlugin.kt | 66 ++-- .../nightscout/pump/medtrum/MedtrumPump.kt | 27 +- .../medtrum/comm/packets/ActivatePacket.kt | 8 +- .../medtrum/comm/packets/AuthorizePacket.kt | 2 +- .../comm/packets/CancelTempBasalPacket.kt | 4 +- .../medtrum/comm/packets/GetRecordPacket.kt | 14 +- .../medtrum/comm/packets/MedtrumPacket.kt | 4 +- .../comm/packets/NotificationPacket.kt | 4 +- .../comm/packets/SetTempBasalPacket.kt | 4 +- .../medtrum/comm/packets/SetTimeZonePacket.kt | 9 +- .../medtrum/comm/packets/SynchronizePacket.kt | 2 +- .../pump/medtrum/services/BLEComm.kt | 12 +- .../pump/medtrum/services/MedtrumService.kt | 50 +-- .../ui/MedtrumActivateCompleteFragment.kt | 6 +- .../medtrum/ui/MedtrumActivateFragment.kt | 6 +- .../medtrum/ui/MedtrumAttachPatchFragment.kt | 6 +- .../pump/medtrum/ui/MedtrumBaseActivity.kt | 7 +- .../ui/MedtrumDeactivatePatchFragment.kt | 6 +- .../ui/MedtrumDeactivationCompleteFragment.kt | 4 +- .../medtrum/ui/MedtrumOverviewFragment.kt | 12 +- .../ui/MedtrumPreparePatchConnectFragment.kt | 6 +- .../medtrum/ui/MedtrumPreparePatchFragment.kt | 4 +- .../ui/MedtrumPrimeCompleteFragment.kt | 6 +- .../pump/medtrum/ui/MedtrumPrimeFragment.kt | 6 +- .../pump/medtrum/ui/MedtrumPrimingFragment.kt | 6 +- .../MedtrumRetryActivationConnectFragment.kt | 6 +- .../ui/MedtrumRetryActivationFragment.kt | 6 +- .../ui/MedtrumStartDeactivationFragment.kt | 6 +- .../ui/viewmodel/MedtrumOverviewViewModel.kt | 26 +- .../medtrum/ui/viewmodel/MedtrumViewModel.kt | 10 +- .../pump/medtrum/MedtrumPumpTest.kt | 12 +- .../pump/medtrum/MedtrumTestBase.kt | 6 +- .../comm/packets/GetRecordPacketTest.kt | 8 +- .../comm/packets/NotificationPacketTest.kt | 2 +- .../queue/command/CommandDeactivatePod.java | 2 +- .../command/CommandDisableSuspendAlerts.kt | 4 +- .../command/CommandHandleTimeChange.java | 2 +- .../queue/command/CommandPlayTestBeep.java | 2 +- .../queue/command/CommandResumeDelivery.java | 2 +- .../queue/command/CommandSilenceAlerts.java | 2 +- .../queue/command/CommandSuspendDelivery.java | 2 +- .../CommandUpdateAlertConfiguration.java | 2 +- .../action/InitializePodViewModel.kt | 4 +- .../action/InsertCannulaViewModel.kt | 4 +- .../PodActivationActionViewModelBase.kt | 4 +- .../common/fragment/ActionFragmentBase.kt | 2 +- .../common/fragment/WizardFragmentBase.kt | 2 +- .../common/viewmodel/ActionViewModelBase.kt | 8 +- .../action/DeactivatePodViewModel.kt | 4 +- .../dash/EventOmnipodDashPumpValuesChanged.kt | 2 +- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 76 ++-- .../dash/di/OmnipodDashHistoryModule.kt | 2 +- .../dash/driver/OmnipodDashManagerImpl.kt | 8 +- .../driver/comm/OmnipodDashBleManagerImpl.kt | 36 +- .../dash/driver/comm/ServiceDiscoverer.kt | 4 +- .../driver/comm/callbacks/BleCommCallbacks.kt | 13 +- .../dash/driver/comm/endecrypt/EnDecrypt.kt | 4 +- .../pump/omnipod/dash/driver/comm/io/BleIO.kt | 10 +- .../omnipod/dash/driver/comm/io/CmdBleIO.kt | 2 +- .../omnipod/dash/driver/comm/io/DataBleIO.kt | 2 +- .../dash/driver/comm/message/MessageIO.kt | 21 +- .../dash/driver/comm/pair/KeyExchange.kt | 6 +- .../dash/driver/comm/pair/LTKExchanger.kt | 7 +- .../dash/driver/comm/scan/PodScanner.kt | 4 +- .../dash/driver/comm/scan/ScanCollector.kt | 4 +- .../dash/driver/comm/session/Connection.kt | 15 +- .../dash/driver/comm/session/EapMessage.kt | 5 +- .../dash/driver/comm/session/Milenage.kt | 7 +- .../dash/driver/comm/session/Session.kt | 8 +- .../driver/comm/session/SessionEstablisher.kt | 14 +- .../pod/state/OmnipodDashPodStateManager.kt | 16 +- .../state/OmnipodDashPodStateManagerImpl.kt | 12 +- .../pump/omnipod/dash/history/DashHistory.kt | 14 +- .../pump/omnipod/dash/history/data/Record.kt | 7 +- .../dash/history/database/Converters.kt | 2 +- .../omnipod/dash/ui/DashPodHistoryActivity.kt | 88 +++-- .../dash/ui/DashPodManagementActivity.kt | 16 +- .../dash/ui/OmnipodDashOverviewFragment.kt | 49 ++- .../DashPodActivationWizardActivity.kt | 2 +- .../action/DashInitializePodViewModel.kt | 12 +- .../action/DashInsertCannulaViewModel.kt | 26 +- .../action/DashDeactivatePodViewModel.kt | 16 +- .../pump/omnipod/dash/util/Functions.kt | 4 +- .../plugins/pump/omnipod/dash/util/I8n.kt | 11 +- .../dash/driver/comm/pair/KeyExchangeTest.kt | 2 +- .../dash/driver/comm/session/MilenageTest.kt | 2 +- .../pump/omnipod/dash/util/FunctionsTest.kt | 6 +- .../omnipod/eros/OmnipodErosPumpPlugin.java | 74 ++-- .../eros/data/RLHistoryItemOmnipod.java | 2 +- .../action/AssignAddressAction.kt | 2 +- .../communication/action/SetupPodAction.java | 2 +- .../communication/message/OmnipodMessage.java | 4 +- .../driver/manager/ErosPodStateManager.java | 5 +- .../eros/driver/manager/OmnipodManager.java | 6 +- .../EventOmnipodErosActiveAlertsChanged.kt | 2 +- .../EventOmnipodErosFaultEventChanged.kt | 2 +- .../EventOmnipodErosPumpValuesChanged.kt | 2 +- .../eros/event/EventOmnipodErosTbrChanged.kt | 2 +- .../EventOmnipodErosUncertainTbrRecovered.kt | 2 +- .../extensions/DetailedBolusInfoExtension.kt | 2 +- .../eros/extensions/PumpStateExtension.kt | 2 +- .../eros/manager/AapsErosPodStateManager.java | 10 +- .../eros/manager/AapsOmnipodErosManager.java | 36 +- .../queue/command/CommandGetPodStatus.java | 2 +- .../queue/command/CommandReadPulseLog.java | 2 +- .../OmnipodRileyLinkCommunicationManager.java | 2 +- .../service/RileyLinkOmnipodService.java | 2 +- .../omnipod/eros/ui/ErosPodHistoryActivity.kt | 10 +- .../eros/ui/ErosPodManagementActivity.kt | 30 +- .../eros/ui/OmnipodErosOverviewFragment.kt | 98 ++++-- .../action/ErosInitializePodViewModel.kt | 6 +- .../action/ErosInsertCannulaViewModel.kt | 8 +- .../action/ErosDeactivatePodViewModel.kt | 10 +- .../omnipod/eros/util/AapsOmnipodUtil.java | 2 +- .../omnipod/eros/util/OmnipodAlertUtil.java | 2 +- .../omnipod/eros/OmnipodErosPumpPluginTest.kt | 16 +- .../AapsOmnipodErosManagerTest.kt | 6 +- .../manager/AapsErosPodStateManagerTest.kt | 2 +- .../pump/common/PumpPluginAbstract.kt | 50 +-- .../pump/common/ble/BondStateReceiver.kt | 10 +- .../nightscout/pump/common/data/PumpStatus.kt | 2 +- .../pump/common/defs/PumpDriverState.kt | 4 +- .../pump/common/defs/PumpHistoryEntryGroup.kt | 2 +- .../pump/common/di/PumpCommonModule.kt | 6 +- .../driver/ble/PumpBLESelectorAbstract.kt | 12 +- .../common/driver/history/PumpHistoryEntry.kt | 2 +- .../pump/common/events/EventBondChanged.kt | 2 +- .../pump/common/events/EventPumpChanged.kt | 10 +- .../EventPumpConnectionParametersChanged.kt | 2 +- .../events/EventPumpFragmentValuesChanged.kt | 2 +- .../pump/common/sync/PumpDbEntry.kt | 127 ++++--- .../common/sync/PumpSyncEntriesCreator.kt | 2 +- .../pump/common/sync/PumpSyncStorage.kt | 10 +- .../pump/common/ui/PumpBLEConfigActivity.kt | 14 +- .../pump/common/ui/PumpHistoryActivity.kt | 7 +- .../pump/common/utils/ProfileUtil.kt | 6 +- .../dialog/RileyLinkBLEConfigActivity.kt | 12 +- .../EventRileyLinkDeviceStatusChange.kt | 2 +- .../RileyLinkCommunicationManager.java | 13 +- .../common/hw/rileylink/RileyLinkUtil.java | 2 +- .../pump/common/hw/rileylink/ble/RFSpy.java | 12 +- .../common/hw/rileylink/ble/RFSpyReader.kt | 4 +- .../common/hw/rileylink/ble/RileyLinkBLE.kt | 8 +- .../hw/rileylink/ble/data/RadioResponse.java | 4 +- .../data/encoding/Encoding4b6bAbstract.java | 2 +- .../ble/data/encoding/Encoding4b6bGeoff.java | 2 +- .../ble/defs/RileyLinkEncodingType.java | 2 +- .../hw/rileylink/ble/device/OrangeLinkImpl.kt | 6 +- .../CharacteristicReadOperation.java | 4 +- .../CharacteristicWriteOperation.java | 4 +- .../operations/DescriptorWriteOperation.java | 4 +- .../hw/rileylink/data/RLHistoryItem.java | 2 +- .../dialog/RileyLinkStatusActivity.kt | 2 +- .../dialog/RileyLinkStatusGeneralFragment.kt | 10 +- .../dialog/RileyLinkStatusHistoryFragment.kt | 4 +- .../RileyLinkBluetoothStateReceiver.kt | 5 +- .../service/RileyLinkBroadcastReceiver.kt | 8 +- .../hw/rileylink/service/RileyLinkService.kt | 12 +- .../rileylink/service/RileyLinkServiceData.kt | 6 +- .../service/tasks/DiscoverGattServicesTask.kt | 2 +- .../tasks/InitializePumpManagerTask.kt | 12 +- .../tasks/ResetRileyLinkConfigurationTask.kt | 4 +- .../hw/rileylink/service/tasks/ServiceTask.kt | 4 +- .../service/tasks/ServiceTaskExecutor.kt | 4 +- .../service/tasks/WakeAndTuneTask.kt | 4 +- .../pump/virtual/VirtualPumpFragment.kt | 26 +- .../pump/virtual/VirtualPumpPlugin.kt | 62 ++-- .../pump/virtual/di/VirtualPumpModule.kt | 2 +- .../events/EventVirtualPumpUpdateGui.kt | 2 +- .../extensions/PumpEnactResultExtension.kt | 4 +- .../pump/virtual/VirtualPumpPluginUTest.kt | 22 +- .../aaps/shared/impl/di/SharedImplModule.kt | 12 +- .../impl/logging/AAPSLoggerProduction.kt | 6 +- .../app/aaps/shared/impl/logging/LImpl.kt | 8 +- .../aaps/shared/impl/rx/AapsSchedulersImpl.kt | 2 +- .../app/aaps/shared/impl/rx/bus/RxBusImpl.kt | 10 +- .../sharedPreferences/SPImplementation.kt | 4 +- .../aaps/shared/impl/utils/DateUtilImpl.kt | 10 +- .../app/aaps/shared/impl/logging/LImplTest.kt | 4 +- .../app/aaps/shared/tests/AAPSLoggerTest.kt | 4 +- .../app/aaps/shared/tests/HardLimitsMock.kt | 6 +- .../kotlin/app/aaps/shared/tests/TestBase.kt | 4 +- .../aaps/shared/tests/TestBaseWithProfile.kt | 24 +- .../app/aaps/shared/tests/TestPumpPlugin.kt | 18 +- .../shared/tests/rx/TestAapsSchedulers.kt | 2 +- .../ui/activities/ErrorHelperActivity.kt | 2 +- .../ui/activities/ProfileHelperActivity.kt | 32 +- .../ui/activities/QuickWizardListActivity.kt | 18 +- .../nightscout/ui/activities/StatsActivity.kt | 12 +- .../ui/activities/SurveyActivity.kt | 44 +-- .../ui/activities/TDDStatsActivity.kt | 28 +- .../ui/activities/TreatmentsActivity.kt | 8 +- .../fragments/TreatmentsBolusCarbsFragment.kt | 28 +- .../fragments/TreatmentsCareportalFragment.kt | 26 +- .../TreatmentsExtendedBolusesFragment.kt | 31 +- .../TreatmentsProfileSwitchFragment.kt | 34 +- .../fragments/TreatmentsTempTargetFragment.kt | 30 +- .../TreatmentsTemporaryBasalsFragment.kt | 35 +- .../fragments/TreatmentsUserEntryFragment.kt | 22 +- .../ui/activityMonitor/ActivityMonitor.kt | 16 +- .../nightscout/ui/alertDialogs/ErrorDialog.kt | 8 +- .../ui/defaultProfile/DefaultProfile.kt | 10 +- .../ui/defaultProfile/DefaultProfileDPV.kt | 8 +- .../ui/dialogs/BolusProgressDialog.kt | 22 +- .../ui/dialogs/CalibrationDialog.kt | 12 +- .../info/nightscout/ui/dialogs/CarbsDialog.kt | 44 +-- .../info/nightscout/ui/dialogs/CareDialog.kt | 22 +- .../ui/dialogs/DialogFragmentWithDate.kt | 10 +- .../ui/dialogs/EditQuickWizardDialog.kt | 12 +- .../ui/dialogs/ExtendedBolusDialog.kt | 20 +- .../info/nightscout/ui/dialogs/FillDialog.kt | 24 +- .../nightscout/ui/dialogs/InsulinDialog.kt | 60 ++-- .../info/nightscout/ui/dialogs/LoopDialog.kt | 52 +-- .../ui/dialogs/ProfileSwitchDialog.kt | 28 +- .../ui/dialogs/ProfileViewerDialog.kt | 26 +- .../nightscout/ui/dialogs/TempBasalDialog.kt | 26 +- .../nightscout/ui/dialogs/TempTargetDialog.kt | 20 +- .../nightscout/ui/dialogs/TreatmentDialog.kt | 28 +- .../nightscout/ui/dialogs/WizardDialog.kt | 46 +-- .../nightscout/ui/dialogs/WizardInfoDialog.kt | 8 +- .../ui/elements/EmptyRecyclerView.kt | 4 +- .../ui/events/EventQuickWizardChange.kt | 2 +- .../ui/extensions/DoubleToSignedString.kt | 4 +- .../ui/services/AlarmSoundService.kt | 13 +- .../ui/services/AlarmSoundServiceHelper.kt | 6 +- .../info/nightscout/ui/tabs/TabPageAdapter.kt | 6 +- .../java/info/nightscout/ui/widget/Widget.kt | 40 +-- .../ui/widget/WidgetConfigureActivity.kt | 2 +- .../ui/defaultProfile/DefaultProfileTest.kt | 2 +- .../info/nightscout/androidaps/WearApp.kt | 6 +- .../androidaps/comm/DataHandlerWear.kt | 20 +- .../comm/DataLayerListenerServiceWear.kt | 43 ++- .../androidaps/comm/ExceptionHandlerWear.kt | 6 +- .../androidaps/comm/IntentWearToMobile.kt | 2 +- .../BaseComplicationProviderService.kt | 11 +- .../complications/BrCobIobComplication.kt | 3 +- .../complications/CobDetailedComplication.kt | 3 +- .../complications/CobIconComplication.kt | 3 +- .../complications/CobIobComplication.kt | 3 +- .../ComplicationTapBroadcastReceiver.kt | 9 +- .../complications/IobDetailedComplication.kt | 3 +- .../complications/IobIconComplication.kt | 3 +- .../complications/LongStatusComplication.kt | 3 +- .../LongStatusFlippedComplication.kt | 3 +- .../complications/SgvComplication.kt | 3 +- .../UploaderBatteryComplication.kt | 3 +- .../complications/WallpaperComplication.kt | 3 +- .../androidaps/data/RawDisplayData.kt | 5 +- .../events/EventWearPreferenceChange.kt | 2 +- .../androidaps/heartrate/HeartRateListener.kt | 21 +- .../interaction/ConfigurationActivity.kt | 4 +- .../interaction/TileConfigurationActivity.kt | 5 +- .../WatchfaceConfigurationActivity.kt | 8 +- .../actions/BackgroundActionActivity.kt | 11 +- .../interaction/actions/BolusActivity.kt | 10 +- .../interaction/actions/CarbActivity.kt | 6 +- .../interaction/actions/ECarbActivity.kt | 8 +- .../interaction/actions/FillActivity.kt | 6 +- .../actions/ProfileSwitchActivity.kt | 6 +- .../actions/QuickSnoozeActivity.kt | 6 +- .../interaction/actions/TempTargetActivity.kt | 6 +- .../interaction/actions/TreatmentActivity.kt | 12 +- .../actions/ViewSelectorActivity.kt | 4 +- .../interaction/actions/WizardActivity.kt | 6 +- .../interaction/menus/FillMenuActivity.kt | 4 +- .../interaction/menus/MainMenuActivity.kt | 7 +- .../interaction/menus/StatusMenuActivity.kt | 8 +- .../interaction/utils/DisplayFormat.kt | 8 +- .../utils/EditPlusMinusViewAdapter.kt | 5 +- .../interaction/utils/Inevitable.kt | 6 +- .../interaction/utils/MenuListActivity.kt | 22 +- .../interaction/utils/Persistence.kt | 16 +- .../androidaps/interaction/utils/WearUtil.kt | 4 +- .../nightscout/androidaps/tile/TileBase.kt | 17 +- .../androidaps/tile/source/ActionSource.kt | 13 +- .../tile/source/QuickWizardSource.kt | 13 +- .../tile/source/StaticTileSource.kt | 6 +- .../tile/source/TempTargetSource.kt | 6 +- .../androidaps/watchfaces/CircleWatchface.kt | 19 +- .../androidaps/watchfaces/CustomWatchface.kt | 44 ++- .../watchfaces/DigitalStyleWatchface.kt | 2 +- .../watchfaces/SteampunkWatchface.kt | 4 +- .../watchfaces/utils/BaseWatchFace.kt | 29 +- .../watchfaces/utils/BgGraphBuilder.kt | 12 +- .../androidaps/watchfaces/utils/SimpleUi.kt | 6 +- .../nightscout/androidaps/WearTestBase.kt | 4 +- .../heartrate/HeartRateListenerTest.kt | 4 +- .../testing/mockers/RawDataMocker.kt | 10 +- .../nightscout/workflow/InvokeLoopWorker.kt | 8 +- .../nightscout/workflow/LoadBgDataWorker.kt | 19 +- .../workflow/PrepareBasalDataWorker.kt | 16 +- .../workflow/PrepareBgDataWorker.kt | 12 +- .../workflow/PrepareBucketedDataWorker.kt | 10 +- .../PrepareIobAutosensGraphDataWorker.kt | 24 +- .../workflow/PreparePredictionsWorker.kt | 16 +- .../PrepareTemporaryTargetDataWorker.kt | 12 +- .../workflow/PrepareTreatmentsDataWorker.kt | 20 +- .../nightscout/workflow/UpdateGraphWorker.kt | 6 +- .../workflow/UpdateIobCobSensWorker.kt | 8 +- .../nightscout/workflow/UpdateWidgetWorker.kt | 2 +- .../workflow/iob/CarbsInPastExtension.kt | 16 +- .../workflow/iob/IobCobOref1Worker.kt | 86 ++--- .../workflow/iob/IobCobOrefWorker.kt | 82 ++--- 1449 files changed, 9249 insertions(+), 8682 deletions(-) rename {core/interfaces/src/main/java/info/nightscout/rx/logging => app/src/main/kotlin/app/aaps/receivers}/BundleLogger.kt (91%) rename core/interfaces/src/debug/{java => kotlin}/app/aaps/annotations/OpenForTesting.kt (100%) delete mode 100644 core/interfaces/src/main/java/info/nightscout/interfaces/actions/Actions.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Safety.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/interfaces/profiling/Profiler.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/interfaces/pump/OmnipodDash.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseSettings.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/interfaces/sync/Tidepool.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryMapper.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventAppExit.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventAppInitialized.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventMobileToWear.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventNSClientRestart.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventOfflineChange.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventQueueChanged.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventRebuildTabs.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventRefreshButtonState.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventRefreshOverview.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventThemeSwitch.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventWearCwfExported.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventWearDataToMobile.kt delete mode 100644 core/interfaces/src/main/java/info/nightscout/rx/events/EventWearToMobile.kt create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/actions/Actions.kt rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/alerts}/LocalAlertUtils.kt (92%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/androidPermissions}/AndroidPermission.kt (88%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/APS.kt (87%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/APSResult.kt (88%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/aps}/ApsMode.kt (86%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/AutosensData.kt (97%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/AutosensDataStore.kt (88%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/AutosensResult.kt (88%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/BasalData.kt (73%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/DetermineBasalAdapter.kt (79%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/Loop.kt (85%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/SMBDefaults.kt (92%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/Sensitivity.kt (88%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/aps/VariableSensitivityResult.kt (64%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/automation/Automation.kt (94%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/automation/AutomationEvent.kt (55%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/autotune/Autotune.kt (84%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/bgQualityCheck/BgQualityCheck.kt (86%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/configuration}/Config.kt (89%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/configuration}/ConfigBuilder.kt (92%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/configuration}/ConfigExportImport.kt (88%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/configuration}/Constants.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/constraints/Constraint.kt (93%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/constraints/ConstraintsChecker.kt (93%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/constraints/Objectives.kt (93%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/constraints/PluginConstraints.kt (94%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Safety.kt rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/db}/GlucoseUnit.kt (91%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/db/PersistenceLayer.kt (92%) rename core/interfaces/src/main/{java/info/nightscout/shared => kotlin/app/aaps/interfaces}/extensions/UIUtils.kt (88%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/insulin/Insulin.kt (81%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/iob/CobInfo.kt (81%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/iob/GlucoseStatus.kt (84%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/iob/GlucoseStatusProvider.kt (79%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/iob/InMemoryGlucoseValue.kt (93%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/iob/Iob.kt (63%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/iob/IobCobCalculator.kt (92%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/iob/IobTotal.kt (92%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/iob/MealData.kt (85%) rename core/interfaces/src/main/{java/info/nightscout/rx => kotlin/app/aaps/interfaces}/logging/AAPSLogger.kt (97%) rename core/interfaces/src/main/{java/info/nightscout/rx/interfaces => kotlin/app/aaps/interfaces/logging}/L.kt (77%) rename core/interfaces/src/main/{java/info/nightscout/rx => kotlin/app/aaps/interfaces}/logging/LTag.kt (85%) rename core/interfaces/src/main/{java/info/nightscout/rx/interfaces => kotlin/app/aaps/interfaces/logging}/LogElement.kt (80%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/logging/LoggerUtils.kt (64%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/logging/UserEntryLogger.kt (87%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/maintenance/ImportExportPrefs.kt (88%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/maintenance/PrefFileListProvider.kt (87%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/maintenance/PrefMetadata.kt (79%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/maintenance/PrefsFile.kt (89%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/maintenance/PrefsImportDir.kt (54%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/maintenance/PrefsMetadataKey.kt (79%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/maintenance/PrefsStatus.kt (65%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/notifications/Notification.kt (99%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/notifications}/NotificationHolder.kt (72%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/notifications/NotificationUserMessage.kt (85%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/nsclient/NSAlarm.kt (94%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/nsclient/NSSettingsStatus.kt (87%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/nsclient/NSSgv.kt (90%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/nsclient/ProcessedDeviceStatusData.kt (81%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/nsclient/StoreDataForDb.kt (98%) rename core/interfaces/src/main/{java/info/nightscout/interfaces/profile => kotlin/app/aaps/interfaces/objects}/Instantiator.kt (56%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/overview}/Overview.kt (88%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/overview/OverviewMenus.kt (91%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/plugin/ActivePlugin.kt (76%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/plugin/OwnDatabasePlugin.kt (57%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/plugin/PluginBase.kt (92%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/plugin/PluginDescription.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/plugin/PluginFragment.kt (57%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/plugin/PluginType.kt (84%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/profile/DefaultValueHelper.kt (95%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/profile/Profile.kt (89%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/profile/ProfileFunction.kt (93%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/profile/ProfileSource.kt (80%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/profile/ProfileStore.kt (89%) rename core/interfaces/src/main/{java/info/nightscout/shared/interfaces => kotlin/app/aaps/interfaces/profile}/ProfileUtil.kt (96%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/profile/PureProfile.kt (84%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/profiling/Profiler.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/protection/PasswordCheck.kt (96%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/protection/ProtectionCheck.kt (92%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/BlePreCheck.kt (77%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/BolusProgressData.kt (67%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/Dana.kt (89%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/DetailedBolusInfo.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/DetailedBolusInfoStorage.kt (81%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/Diaconn.kt (78%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/Insight.kt (80%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/Medtrum.kt (91%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/OmnipodDash.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/OmnipodEros.kt (61%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/Pump.kt (94%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/PumpEnactResult.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/PumpPluginBase.kt (60%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/PumpSync.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/TemporaryBasalStorage.kt (82%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/VirtualPump.kt (68%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/WarnColors.kt (91%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/actions/CustomAction.kt (76%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/actions/CustomActionType.kt (53%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/DoseSettings.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/defs/DoseStepSize.kt (52%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/defs/ManufacturerType.kt (87%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/defs/PumpCapability.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/defs/PumpDescription.kt (99%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/defs/PumpTempBasalType.kt (57%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/pump/defs/PumpType.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/queue/Callback.kt (66%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/queue/Command.kt (88%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/queue/CommandQueue.kt (90%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/queue/CustomCommand.kt (62%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/receivers/Intents.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/receivers/ReceiverStatusStore.kt (67%) rename core/interfaces/src/main/{java/info/nightscout/shared/interfaces => kotlin/app/aaps/interfaces/resources}/ResourceHelper.kt (86%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/AapsSchedulers.kt (87%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/bus/RxBus.kt (79%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/Event.kt (92%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventAcceptOpenLoopChange.kt (52%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAppExit.kt create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAppInitialized.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventAutosensCalculationFinished.kt (65%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventBTChange.kt (82%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventBucketedDataCreated.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventChargingState.kt (68%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventConfigBuilderChange.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventCustomActionsChanged.kt (52%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventCustomCalculationFinished.kt (55%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventDanaRSyncStatus.kt (60%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventDeviceStatusChange.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventDiaconnG8PumpLogReset.kt (53%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventDismissBolusProgressIfRunning.kt (71%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventDismissNotification.kt (59%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventEffectiveProfileSwitchChanged.kt (80%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventExtendedBolusChange.kt (54%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventFoodDatabaseChanged.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventInitializationChanged.kt (53%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventLocalProfileChanged.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventLoop.kt (77%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventLoopUpdateGui.kt (69%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventMobileDataToWear.kt (50%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventMobileToWear.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventNSClientNewLog.kt (93%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNSClientRestart.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventNetworkChange.kt (86%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventNewBG.kt (63%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventNewHistoryData.kt (93%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventNewOpenLoopNotification.kt (54%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventNtpStatus.kt (64%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventOfflineChange.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventOverviewBolusProgress.kt (52%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventPreferenceChange.kt (86%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventProfileStoreChanged.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventProfileSwitchChanged.kt (52%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventPumpStatusChanged.kt (95%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventQueueChanged.kt create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRebuildTabs.kt create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRefreshButtonState.kt create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRefreshOverview.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventSWRLStatus.kt (83%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventSWSyncStatus.kt (83%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventSWUpdate.kt (57%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventScale.kt (53%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventStatus.kt (53%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventTempBasalChange.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventTempTargetChange.kt (50%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventThemeSwitch.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventTherapyEventChange.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventTreatmentChange.kt (51%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventUpdateGui.kt (74%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventUpdateOverviewCalcProgress.kt (63%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventUpdateOverviewGraph.kt (60%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventUpdateOverviewIobCob.kt (61%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventUpdateOverviewSensitivity.kt (63%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearCwfExported.kt create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearDataToMobile.kt create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearToMobile.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventWearUpdateGui.kt (56%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/events/EventXdripNewLog.kt (94%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/weardata/CustomWatchfaceFormat.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/weardata/EventData.kt (99%) rename core/interfaces/src/main/{java/info/nightscout/shared => kotlin/app/aaps/interfaces}/sharedPreferences/SP.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/smoothing/Smoothing.kt (67%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/smsCommunicator/Sms.kt (95%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/smsCommunicator/SmsCommunicator.kt (78%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/source/BgSource.kt (89%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/source/DexcomBoyda.kt (76%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/source/NSClientSource.kt (79%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/source/XDripSource.kt (56%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/stats/DexcomTIR.kt (82%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/stats/DexcomTirCalculator.kt (81%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/stats/TIR.kt (77%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/stats/TddCalculator.kt (93%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/stats/TirCalculator.kt (86%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/storage/Storage.kt (83%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/sync/DataSyncSelector.kt (98%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/sync/DataSyncSelectorXdrip.kt (56%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/sync/NsClient.kt (93%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/sync/Sync.kt (72%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/Tidepool.kt rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/sync}/XDripBroadcast.kt (75%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/ui/IconsProvider.kt (69%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/ui/UiInteraction.kt (93%) create mode 100644 core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/UserEntryMapper.kt rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/userEntry/UserEntryPresentationHelper.kt (94%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/userEntry/ValueWithUnitMapper.kt (94%) rename core/interfaces/src/main/{java/info/nightscout/shared => kotlin/app/aaps/interfaces}/utils/DateUtil.kt (97%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/utils/DecimalFormatter.kt (94%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/utils/HardLimits.kt (97%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/utils/MidnightTime.kt (97%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/utils/Round.kt (95%) rename core/interfaces/src/main/{java/info/nightscout/shared => kotlin/app/aaps/interfaces/utils}/SafeParse.kt (98%) rename core/interfaces/src/main/{java/info/nightscout/shared => kotlin/app/aaps/interfaces}/utils/T.kt (95%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/utils/TimeChangeType.kt (67%) rename core/interfaces/src/main/{java/info/nightscout/interfaces => kotlin/app/aaps/interfaces/utils}/Translator.kt (95%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/utils/TrendCalculator.kt (89%) rename core/interfaces/src/main/{java/info/nightscout => kotlin/app/aaps}/interfaces/versionChecker/VersionCheckerUtils.kt (83%) rename core/interfaces/src/release/{java => kotlin}/app/aaps/annotations/OpenForTesting.kt (100%) rename core/interfaces/src/test/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/RxSchedulerRule.kt (97%) rename core/interfaces/src/test/{java/info/nightscout => kotlin/app/aaps/interfaces}/rx/weardata/EventDataTest.kt (99%) rename core/interfaces/src/test/{java/info/nightscout/shared => kotlin/app/aaps/interfaces/utils}/SafeParseTest.kt (99%) diff --git a/app/src/main/kotlin/app/aaps/MainActivity.kt b/app/src/main/kotlin/app/aaps/MainActivity.kt index 15e99b10a6..115ffb43c1 100644 --- a/app/src/main/kotlin/app/aaps/MainActivity.kt +++ b/app/src/main/kotlin/app/aaps/MainActivity.kt @@ -34,6 +34,25 @@ import app.aaps.activities.PreferencesActivity import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult import app.aaps.configuration.activities.SingleFragmentActivity import app.aaps.configuration.setupwizard.SetupWizardActivity +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.maintenance.PrefFileListProvider +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventAppInitialized +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventRebuildTabs +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.interfaces.ui.IconsProvider +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.tabs.TabLayoutMediator import com.google.firebase.crashlytics.FirebaseCrashlytics @@ -51,26 +70,7 @@ import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.utils.isRunningRealPumpTest import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.maintenance.PrefFileListProvider -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator -import info.nightscout.interfaces.ui.IconsProvider -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventAppInitialized -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventRebuildTabs -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import info.nightscout.ui.activities.ProfileHelperActivity import info.nightscout.ui.activities.StatsActivity import info.nightscout.ui.activities.TreatmentsActivity diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index 76e24a0b1a..dd9e4b7126 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -14,6 +14,20 @@ import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.PeriodicWorkRequest import androidx.work.WorkManager import app.aaps.di.DaggerAppComponent +import app.aaps.interfaces.alerts.LocalAlertUtils +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.extensions.runOnUiThread +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import app.aaps.receivers.BTReceiver import app.aaps.receivers.ChargingStateReceiver import app.aaps.receivers.KeepAliveWorker @@ -32,23 +46,9 @@ import info.nightscout.implementation.db.CompatDBHelper import info.nightscout.implementation.lifecycle.ProcessLifecycleListener import info.nightscout.implementation.plugin.PluginStore import info.nightscout.implementation.receivers.NetworkChangeReceiver -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.plugins.aps.utils.StaticInjector 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.extensions.runOnUiThread -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import info.nightscout.ui.activityMonitor.ActivityMonitor import info.nightscout.ui.widget.Widget import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt b/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt index 371b02a9c4..5a95f5295a 100644 --- a/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/kotlin/app/aaps/activities/HistoryBrowseActivity.kt @@ -8,6 +8,24 @@ import android.view.ViewGroup import android.widget.LinearLayout import android.widget.RelativeLayout import android.widget.TextView +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.extensions.toVisibilityKeepSpace +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.overview.OverviewMenus +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAutosensCalculationFinished +import app.aaps.interfaces.rx.events.EventCustomCalculationFinished +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.rx.events.EventScale +import app.aaps.interfaces.rx.events.EventUpdateOverviewGraph +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import com.google.android.material.datepicker.MaterialDatePicker import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector @@ -16,25 +34,7 @@ import info.nightscout.core.events.EventIobCalculationProgress import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.workflow.CalculationWorkflow -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.overview.OverviewMenus -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.DefaultValueHelper import info.nightscout.plugins.general.overview.graphData.GraphData -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAutosensCalculationFinished -import info.nightscout.rx.events.EventCustomCalculationFinished -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.events.EventScale -import info.nightscout.rx.events.EventUpdateOverviewGraph -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.extensions.toVisibilityKeepSpace -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.Calendar diff --git a/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt b/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt index ababb434a2..e76d845c04 100644 --- a/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt +++ b/app/src/main/kotlin/app/aaps/activities/HistoryBrowserData.kt @@ -1,22 +1,22 @@ package app.aaps.activities +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import dagger.android.HasAndroidInjector import info.nightscout.core.graph.OverviewData import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.workflow.CalculationWorkflow import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.overview.OverviewDataImpl -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin -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.Inject import javax.inject.Singleton diff --git a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt index 0917cc5438..cff37f0d3f 100644 --- a/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/kotlin/app/aaps/activities/MyPreferenceFragment.kt @@ -16,6 +16,21 @@ import androidx.preference.PreferenceManager import androidx.preference.PreferenceScreen import androidx.preference.size import app.aaps.configuration.maintenance.MaintenancePlugin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.protection.PasswordCheck +import app.aaps.interfaces.protection.ProtectionCheck.ProtectionType.BIOMETRIC +import app.aaps.interfaces.protection.ProtectionCheck.ProtectionType.CUSTOM_PASSWORD +import app.aaps.interfaces.protection.ProtectionCheck.ProtectionType.CUSTOM_PIN +import app.aaps.interfaces.protection.ProtectionCheck.ProtectionType.NONE +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventRebuildTabs +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.SafeParse import dagger.android.support.AndroidSupportInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin @@ -28,14 +43,6 @@ import info.nightscout.automation.AutomationPlugin import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.implementation.plugin.PluginStore import info.nightscout.insulin.InsulinOrefFreePeakPlugin -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.protection.PasswordCheck -import info.nightscout.interfaces.protection.ProtectionCheck.ProtectionType.BIOMETRIC -import info.nightscout.interfaces.protection.ProtectionCheck.ProtectionType.CUSTOM_PASSWORD -import info.nightscout.interfaces.protection.ProtectionCheck.ProtectionType.CUSTOM_PIN -import info.nightscout.interfaces.protection.ProtectionCheck.ProtectionType.NONE import info.nightscout.plugins.aps.loop.LoopPlugin import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin @@ -54,16 +61,9 @@ import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.diaconn.DiaconnG8Plugin import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventRebuildTabs import info.nightscout.sensitivity.SensitivityAAPSPlugin import info.nightscout.sensitivity.SensitivityOref1Plugin import info.nightscout.sensitivity.SensitivityWeightedAveragePlugin -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import info.nightscout.source.AidexPlugin import info.nightscout.source.DexcomPlugin import info.nightscout.source.EversensePlugin diff --git a/app/src/main/kotlin/app/aaps/di/AppModule.kt b/app/src/main/kotlin/app/aaps/di/AppModule.kt index 6e1c200eb4..bf8aa21803 100644 --- a/app/src/main/kotlin/app/aaps/di/AppModule.kt +++ b/app/src/main/kotlin/app/aaps/di/AppModule.kt @@ -5,6 +5,10 @@ import app.aaps.MainApp import app.aaps.implementations.ConfigImpl import app.aaps.implementations.InstantiatorImpl import app.aaps.implementations.UiInteractionImpl +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.ui.UiInteraction import app.aaps.workflow.CalculationWorkflowImpl import dagger.Binds import dagger.Lazy @@ -12,10 +16,6 @@ import dagger.Module import dagger.Provides import dagger.android.HasAndroidInjector import info.nightscout.core.workflow.CalculationWorkflow -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.ui.UiInteraction @Suppress("unused") @Module( diff --git a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt index 04bcbd58a2..b857a8f30d 100644 --- a/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt +++ b/app/src/main/kotlin/app/aaps/di/PluginsListModule.kt @@ -2,6 +2,7 @@ package app.aaps.di import app.aaps.configuration.configBuilder.ConfigBuilderPlugin import app.aaps.configuration.maintenance.MaintenancePlugin +import app.aaps.interfaces.plugin.PluginBase import dagger.Binds import dagger.Module import dagger.multibindings.IntKey @@ -19,7 +20,6 @@ import info.nightscout.insulin.InsulinLyumjevPlugin import info.nightscout.insulin.InsulinOrefFreePeakPlugin import info.nightscout.insulin.InsulinOrefRapidActingPlugin import info.nightscout.insulin.InsulinOrefUltraRapidActingPlugin -import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.aps.loop.LoopPlugin import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin diff --git a/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt b/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt index 885214e5b9..62d5f5650b 100644 --- a/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt @@ -1,10 +1,10 @@ package app.aaps.implementations import android.os.Build +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.maintenance.PrefFileListProvider import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.maintenance.PrefFileListProvider import java.io.File import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt b/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt index ee37851dc0..e19b821688 100644 --- a/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/InstantiatorImpl.kt @@ -1,15 +1,15 @@ package app.aaps.implementations +import app.aaps.interfaces.aps.APSResult +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.profile.ProfileStore +import app.aaps.interfaces.utils.DateUtil import dagger.Reusable import dagger.android.HasAndroidInjector import info.nightscout.implementation.profile.ProfileStoreObject -import info.nightscout.interfaces.aps.APSResult -import info.nightscout.interfaces.aps.AutosensData -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.plugins.aps.APSResultObject import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataObject -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import javax.inject.Inject diff --git a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt index 3d456c2ae9..b39b93a777 100644 --- a/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/UiInteractionImpl.kt @@ -11,15 +11,15 @@ import app.aaps.activities.HistoryBrowseActivity import app.aaps.activities.MyPreferenceFragment import app.aaps.activities.PreferencesActivity import app.aaps.configuration.activities.SingleFragmentActivity +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.nsclient.NSAlarm +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.core.events.EventNewNotification import info.nightscout.core.ui.toast.ToastUtils -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.nsclient.NSAlarm -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.general.overview.notifications.NotificationWithAction -import info.nightscout.rx.bus.RxBus import info.nightscout.ui.activities.BolusProgressHelperActivity import info.nightscout.ui.activities.ErrorHelperActivity import info.nightscout.ui.activities.QuickWizardListActivity diff --git a/app/src/main/kotlin/app/aaps/receivers/BTReceiver.kt b/app/src/main/kotlin/app/aaps/receivers/BTReceiver.kt index 4b0c20e089..3c32d96677 100644 --- a/app/src/main/kotlin/app/aaps/receivers/BTReceiver.kt +++ b/app/src/main/kotlin/app/aaps/receivers/BTReceiver.kt @@ -3,10 +3,10 @@ package app.aaps.receivers import android.bluetooth.BluetoothDevice import android.content.Context import android.content.Intent +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventBTChange import dagger.android.DaggerBroadcastReceiver import info.nightscout.core.utils.extensions.safeGetParcelableExtra -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventBTChange import javax.inject.Inject class BTReceiver : DaggerBroadcastReceiver() { diff --git a/core/interfaces/src/main/java/info/nightscout/rx/logging/BundleLogger.kt b/app/src/main/kotlin/app/aaps/receivers/BundleLogger.kt similarity index 91% rename from core/interfaces/src/main/java/info/nightscout/rx/logging/BundleLogger.kt rename to app/src/main/kotlin/app/aaps/receivers/BundleLogger.kt index 89f32df356..64108e2062 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/logging/BundleLogger.kt +++ b/app/src/main/kotlin/app/aaps/receivers/BundleLogger.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.logging +package app.aaps.receivers import android.os.Bundle diff --git a/app/src/main/kotlin/app/aaps/receivers/ChargingStateReceiver.kt b/app/src/main/kotlin/app/aaps/receivers/ChargingStateReceiver.kt index 1512b74b9a..b55abb0ed9 100644 --- a/app/src/main/kotlin/app/aaps/receivers/ChargingStateReceiver.kt +++ b/app/src/main/kotlin/app/aaps/receivers/ChargingStateReceiver.kt @@ -4,12 +4,12 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter import android.os.BatteryManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventChargingState import dagger.android.DaggerBroadcastReceiver -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventChargingState -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject class ChargingStateReceiver : DaggerBroadcastReceiver() { diff --git a/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt b/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt index b5645e1b3d..130b041fa8 100644 --- a/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt +++ b/app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt @@ -5,16 +5,15 @@ import android.content.Intent import android.provider.Telephony import androidx.work.Data import androidx.work.OneTimeWorkRequest +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.receivers.Intents import dagger.android.DaggerBroadcastReceiver import info.nightscout.core.utils.extensions.copyDouble import info.nightscout.core.utils.extensions.copyLong import info.nightscout.core.utils.extensions.copyString import info.nightscout.core.utils.receivers.DataWorkerStorage -import info.nightscout.interfaces.receivers.Intents import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.BundleLogger -import info.nightscout.rx.logging.LTag import info.nightscout.source.AidexPlugin import info.nightscout.source.DexcomPlugin import info.nightscout.source.EversensePlugin diff --git a/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt b/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt index d27510edfa..d7064ed260 100644 --- a/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/kotlin/app/aaps/receivers/KeepAliveWorker.kt @@ -10,26 +10,26 @@ import androidx.work.WorkQuery import androidx.work.WorkerParameters import androidx.work.workDataOf import app.aaps.configuration.maintenance.MaintenancePlugin +import app.aaps.interfaces.alerts.LocalAlertUtils +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import com.google.common.util.concurrent.ListenableFuture import info.nightscout.androidaps.R import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventProfileSwitchChanged -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 kotlinx.coroutines.Dispatchers import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/kotlin/app/aaps/receivers/TimeDateOrTZChangeReceiver.kt b/app/src/main/kotlin/app/aaps/receivers/TimeDateOrTZChangeReceiver.kt index aeb888a30a..52a597e6ec 100644 --- a/app/src/main/kotlin/app/aaps/receivers/TimeDateOrTZChangeReceiver.kt +++ b/app/src/main/kotlin/app/aaps/receivers/TimeDateOrTZChangeReceiver.kt @@ -2,14 +2,13 @@ package app.aaps.receivers import android.content.Context import android.content.Intent +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.utils.TimeChangeType import com.google.gson.Gson import dagger.android.DaggerBroadcastReceiver -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.utils.TimeChangeType -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.BundleLogger -import info.nightscout.rx.logging.LTag import java.util.Date import java.util.TimeZone import javax.inject.Inject diff --git a/app/src/main/kotlin/app/aaps/workflow/CalculationWorkflowImpl.kt b/app/src/main/kotlin/app/aaps/workflow/CalculationWorkflowImpl.kt index 5355224359..46c782c230 100644 --- a/app/src/main/kotlin/app/aaps/workflow/CalculationWorkflowImpl.kt +++ b/app/src/main/kotlin/app/aaps/workflow/CalculationWorkflowImpl.kt @@ -7,6 +7,20 @@ import androidx.work.ExistingWorkPolicy import androidx.work.OneTimeWorkRequest import androidx.work.WorkInfo import androidx.work.WorkManager +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.Event +import app.aaps.interfaces.rx.events.EventAppInitialized +import app.aaps.interfaces.rx.events.EventNewHistoryData +import app.aaps.interfaces.rx.events.EventOfflineChange +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventTherapyEventChange +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.core.graph.OverviewData import info.nightscout.core.utils.fabric.FabricPrivacy @@ -16,21 +30,7 @@ import info.nightscout.core.workflow.CalculationWorkflow import info.nightscout.core.workflow.CalculationWorkflow.Companion.JOB import info.nightscout.core.workflow.CalculationWorkflow.Companion.MAIN_CALCULATION import info.nightscout.core.workflow.CalculationWorkflow.Companion.PASS -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.Event -import info.nightscout.rx.events.EventAppInitialized -import info.nightscout.rx.events.EventNewHistoryData -import info.nightscout.rx.events.EventOfflineChange -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventTherapyEventChange -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import info.nightscout.workflow.DummyWorker import info.nightscout.workflow.InvokeLoopWorker import info.nightscout.workflow.LoadBgDataWorker diff --git a/app/src/test/kotlin/app/aaps/configuration/maintenance/MaintenancePluginTest.kt b/app/src/test/kotlin/app/aaps/configuration/maintenance/MaintenancePluginTest.kt index e6c268757a..14f91da86c 100644 --- a/app/src/test/kotlin/app/aaps/configuration/maintenance/MaintenancePluginTest.kt +++ b/app/src/test/kotlin/app/aaps/configuration/maintenance/MaintenancePluginTest.kt @@ -1,15 +1,15 @@ package app.aaps.configuration.maintenance import android.content.Context +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.LoggerUtils +import app.aaps.interfaces.maintenance.PrefFileListProvider +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.logging.LoggerUtils -import info.nightscout.interfaces.maintenance.PrefFileListProvider -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/core/interfaces/build.gradle b/core/interfaces/build.gradle index 3cc11c5d58..80c2e5ef58 100644 --- a/core/interfaces/build.gradle +++ b/core/interfaces/build.gradle @@ -15,7 +15,7 @@ apply from: "${project.rootDir}/core/main/jacoco_global.gradle" android { - namespace 'info.nightscout.interfaces' + namespace 'app.aaps.interfaces' defaultConfig { minSdkVersion 25 // for wear } diff --git a/core/interfaces/src/debug/java/app/aaps/annotations/OpenForTesting.kt b/core/interfaces/src/debug/kotlin/app/aaps/annotations/OpenForTesting.kt similarity index 100% rename from core/interfaces/src/debug/java/app/aaps/annotations/OpenForTesting.kt rename to core/interfaces/src/debug/kotlin/app/aaps/annotations/OpenForTesting.kt diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/actions/Actions.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/actions/Actions.kt deleted file mode 100644 index 5aea890d62..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/actions/Actions.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.interfaces.actions - -interface Actions \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Safety.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Safety.kt deleted file mode 100644 index 277d6ba07c..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Safety.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.interfaces.constraints - -import info.nightscout.interfaces.ConfigExportImport - -interface Safety : ConfigExportImport \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/profiling/Profiler.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/profiling/Profiler.kt deleted file mode 100644 index fb931e3bb5..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/profiling/Profiler.kt +++ /dev/null @@ -1,8 +0,0 @@ -package info.nightscout.interfaces.profiling - -import info.nightscout.rx.logging.LTag - -interface Profiler { - - fun log(lTag: LTag, function: String, start: Long) -} \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/OmnipodDash.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/pump/OmnipodDash.kt deleted file mode 100644 index 62052fedf9..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/OmnipodDash.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.interfaces.pump - -interface OmnipodDash \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseSettings.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseSettings.kt deleted file mode 100644 index 2447c3d99f..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseSettings.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.interfaces.pump.defs - -class DoseSettings constructor(val step: Double, val durationStep: Int, val maxDuration: Int, val minDose: Double, val maxDose: Double = Double.MAX_VALUE) \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/Tidepool.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/sync/Tidepool.kt deleted file mode 100644 index b49a390793..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/Tidepool.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.interfaces.sync - -interface Tidepool : Sync \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryMapper.kt b/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryMapper.kt deleted file mode 100644 index c295bcbe01..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryMapper.kt +++ /dev/null @@ -1,156 +0,0 @@ -package info.nightscout.interfaces.userEntry - -import info.nightscout.database.entities.UserEntry - -class UserEntryMapper { - enum class Action (val db: UserEntry.Action) { - BOLUS (UserEntry.Action.BOLUS), - SMB (UserEntry.Action.SMB), - BOLUS_ADVISOR (UserEntry.Action.BOLUS_ADVISOR), - EXTENDED_BOLUS (UserEntry.Action.EXTENDED_BOLUS), - SUPERBOLUS_TBR (UserEntry.Action.SUPERBOLUS_TBR), - CARBS (UserEntry.Action.CARBS), - EXTENDED_CARBS (UserEntry.Action.EXTENDED_CARBS), - TEMP_BASAL (UserEntry.Action.TEMP_BASAL), - TT (UserEntry.Action.TT), - NEW_PROFILE (UserEntry.Action.NEW_PROFILE), - CLONE_PROFILE (UserEntry.Action.CLONE_PROFILE), - STORE_PROFILE (UserEntry.Action.STORE_PROFILE), - PROFILE_SWITCH (UserEntry.Action.PROFILE_SWITCH), - PROFILE_SWITCH_CLONED (UserEntry.Action.PROFILE_SWITCH_CLONED), - CLOSED_LOOP_MODE (UserEntry.Action.CLOSED_LOOP_MODE), - LGS_LOOP_MODE (UserEntry.Action.LGS_LOOP_MODE), - OPEN_LOOP_MODE (UserEntry.Action.OPEN_LOOP_MODE), - LOOP_DISABLED (UserEntry.Action.LOOP_DISABLED), - LOOP_ENABLED (UserEntry.Action.LOOP_ENABLED), - RECONNECT (UserEntry.Action.RECONNECT), - DISCONNECT (UserEntry.Action.DISCONNECT), - RESUME (UserEntry.Action.RESUME), - SUSPEND (UserEntry.Action.SUSPEND), - HW_PUMP_ALLOWED (UserEntry.Action.HW_PUMP_ALLOWED), - CLEAR_PAIRING_KEYS (UserEntry.Action.CLEAR_PAIRING_KEYS), - ACCEPTS_TEMP_BASAL (UserEntry.Action.ACCEPTS_TEMP_BASAL), - CANCEL_TEMP_BASAL (UserEntry.Action.CANCEL_TEMP_BASAL), - CANCEL_BOLUS (UserEntry.Action.CANCEL_BOLUS), - CANCEL_EXTENDED_BOLUS (UserEntry.Action.CANCEL_EXTENDED_BOLUS), - CANCEL_TT (UserEntry.Action.CANCEL_TT), - CAREPORTAL (UserEntry.Action.CAREPORTAL), - SITE_CHANGE (UserEntry.Action.SITE_CHANGE), - RESERVOIR_CHANGE (UserEntry.Action.RESERVOIR_CHANGE), - CALIBRATION (UserEntry.Action.CALIBRATION), - PRIME_BOLUS (UserEntry.Action.PRIME_BOLUS), - TREATMENT (UserEntry.Action.TREATMENT), - CAREPORTAL_NS_REFRESH (UserEntry.Action.CAREPORTAL_NS_REFRESH), - PROFILE_SWITCH_NS_REFRESH (UserEntry.Action.PROFILE_SWITCH_NS_REFRESH), - TREATMENTS_NS_REFRESH (UserEntry.Action.TREATMENTS_NS_REFRESH), - TT_NS_REFRESH (UserEntry.Action.TT_NS_REFRESH), - AUTOMATION_REMOVED (UserEntry.Action.AUTOMATION_REMOVED), - BG_REMOVED (UserEntry.Action.BG_REMOVED), - CAREPORTAL_REMOVED (UserEntry.Action.CAREPORTAL_REMOVED), - EXTENDED_BOLUS_REMOVED (UserEntry.Action.EXTENDED_BOLUS_REMOVED), - FOOD_REMOVED (UserEntry.Action.FOOD_REMOVED), - PROFILE_REMOVED (UserEntry.Action.PROFILE_REMOVED), - PROFILE_SWITCH_REMOVED (UserEntry.Action.PROFILE_SWITCH_REMOVED), - RESTART_EVENTS_REMOVED (UserEntry.Action.RESTART_EVENTS_REMOVED), - TREATMENT_REMOVED (UserEntry.Action.TREATMENT_REMOVED), - BOLUS_REMOVED (UserEntry.Action.BOLUS_REMOVED), - CARBS_REMOVED (UserEntry.Action.CARBS_REMOVED), - TEMP_BASAL_REMOVED (UserEntry.Action.TEMP_BASAL_REMOVED), - TT_REMOVED (UserEntry.Action.TT_REMOVED), - NS_PAUSED (UserEntry.Action.NS_PAUSED), - NS_RESUME (UserEntry.Action.NS_RESUME), - NS_QUEUE_CLEARED (UserEntry.Action.NS_QUEUE_CLEARED), - NS_SETTINGS_COPIED (UserEntry.Action.NS_SETTINGS_COPIED), - ERROR_DIALOG_OK (UserEntry.Action.ERROR_DIALOG_OK), - ERROR_DIALOG_MUTE (UserEntry.Action.ERROR_DIALOG_MUTE), - ERROR_DIALOG_MUTE_5MIN (UserEntry.Action.ERROR_DIALOG_MUTE_5MIN), - OBJECTIVE_STARTED (UserEntry.Action.OBJECTIVE_STARTED), - OBJECTIVE_UNSTARTED (UserEntry.Action.OBJECTIVE_UNSTARTED), - OBJECTIVES_SKIPPED (UserEntry.Action.OBJECTIVES_SKIPPED), - STAT_RESET (UserEntry.Action.STAT_RESET), - DELETE_LOGS (UserEntry.Action.DELETE_LOGS), - DELETE_FUTURE_TREATMENTS (UserEntry.Action.DELETE_FUTURE_TREATMENTS), - EXPORT_SETTINGS (UserEntry.Action.EXPORT_SETTINGS), - IMPORT_SETTINGS (UserEntry.Action.IMPORT_SETTINGS), - RESET_DATABASES (UserEntry.Action.RESET_DATABASES), - EXPORT_DATABASES (UserEntry.Action.EXPORT_DATABASES), - IMPORT_DATABASES (UserEntry.Action.IMPORT_DATABASES), - OTP_EXPORT (UserEntry.Action.OTP_EXPORT), - OTP_RESET (UserEntry.Action.OTP_RESET), - STOP_SMS (UserEntry.Action.STOP_SMS), - FOOD (UserEntry.Action.FOOD), - EXPORT_CSV (UserEntry.Action.EXPORT_CSV), - START_AAPS (UserEntry.Action.START_AAPS), - EXIT_AAPS (UserEntry.Action.EXIT_AAPS), - UNKNOWN (UserEntry.Action.UNKNOWN) - ; - } - - enum class Sources (val db: UserEntry.Sources) { - TreatmentDialog (UserEntry.Sources.TreatmentDialog), - InsulinDialog (UserEntry.Sources.InsulinDialog), - CarbDialog (UserEntry.Sources.CarbDialog), - WizardDialog (UserEntry.Sources.WizardDialog), - QuickWizard (UserEntry.Sources.QuickWizard), - ExtendedBolusDialog (UserEntry.Sources.ExtendedBolusDialog), - TTDialog (UserEntry.Sources.TTDialog), - ProfileSwitchDialog (UserEntry.Sources.ProfileSwitchDialog), - LoopDialog (UserEntry.Sources.LoopDialog), - TempBasalDialog (UserEntry.Sources.TempBasalDialog), - CalibrationDialog (UserEntry.Sources.CalibrationDialog), - FillDialog (UserEntry.Sources.FillDialog), - BgCheck (UserEntry.Sources.BgCheck), - SensorInsert (UserEntry.Sources.SensorInsert), - BatteryChange (UserEntry.Sources.BatteryChange), - Note (UserEntry.Sources.Note), - Exercise (UserEntry.Sources.Exercise), - Question (UserEntry.Sources.Question), - Announcement (UserEntry.Sources.Announcement), - Actions (UserEntry.Sources.Actions), - Automation (UserEntry.Sources.Automation), - Autotune (UserEntry.Sources.Autotune), - BG (UserEntry.Sources.BG), - Aidex (UserEntry.Sources.Aidex), - Dexcom (UserEntry.Sources.Dexcom), - Eversense (UserEntry.Sources.Eversense), - Glimp (UserEntry.Sources.Glimp), - MM640g (UserEntry.Sources.MM640g), - NSClientSource (UserEntry.Sources.BG), - PocTech (UserEntry.Sources.PocTech), - Tomato (UserEntry.Sources.Tomato), - Xdrip (UserEntry.Sources.Xdrip), - LocalProfile (UserEntry.Sources.LocalProfile), - Loop (UserEntry.Sources.Loop), - Maintenance (UserEntry.Sources.Maintenance), - NSClient (UserEntry.Sources.NSClient), - NSProfile (UserEntry.Sources.NSProfile), - Objectives (UserEntry.Sources.Objectives), - Pump (UserEntry.Sources.Pump), - Dana (UserEntry.Sources.Dana), - DanaR (UserEntry.Sources.DanaR), - DanaRC (UserEntry.Sources.DanaRC), - DanaRv2 (UserEntry.Sources.DanaRv2), - DanaRS (UserEntry.Sources.DanaRS), - DanaI (UserEntry.Sources.DanaI), - DiaconnG8 (UserEntry.Sources.DiaconnG8), - Insight (UserEntry.Sources.Insight), - Combo (UserEntry.Sources.Combo), - Medtronic (UserEntry.Sources.Medtronic), - Omnipod (UserEntry.Sources.Omnipod), - OmnipodEros (UserEntry.Sources.OmnipodEros), - OmnipodDash (UserEntry.Sources.OmnipodDash), - EOPatch2 (UserEntry.Sources.EOPatch2), - MDI (UserEntry.Sources.MDI), - VirtualPump (UserEntry.Sources.VirtualPump), - SMS (UserEntry.Sources.SMS), - Treatments (UserEntry.Sources.Treatments), - Wear (UserEntry.Sources.Wear), - Food (UserEntry.Sources.Food), - ConfigBuilder (UserEntry.Sources.ConfigBuilder), - Overview (UserEntry.Sources.Overview), - Stats (UserEntry.Sources.Stats), - Aaps (UserEntry.Sources.Aaps), - Unknown(UserEntry.Sources.Unknown) - ; - } -} diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventAppExit.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventAppExit.kt deleted file mode 100644 index 1f59fe2547..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventAppExit.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventAppExit : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventAppInitialized.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventAppInitialized.kt deleted file mode 100644 index 60adbf2676..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventAppInitialized.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventAppInitialized : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventMobileToWear.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventMobileToWear.kt deleted file mode 100644 index 681c243be7..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventMobileToWear.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.rx.events - -import info.nightscout.rx.weardata.EventData - -class EventMobileToWear(val payload: EventData) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNSClientRestart.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventNSClientRestart.kt deleted file mode 100644 index d4e7fd4d6b..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNSClientRestart.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventNSClientRestart : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventOfflineChange.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventOfflineChange.kt deleted file mode 100644 index be2abcd52a..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventOfflineChange.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventOfflineChange : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventQueueChanged.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventQueueChanged.kt deleted file mode 100644 index 87f66a61ae..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventQueueChanged.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventQueueChanged : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventRebuildTabs.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventRebuildTabs.kt deleted file mode 100644 index a1e9ababd0..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventRebuildTabs.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventRebuildTabs constructor(var recreate: Boolean = false) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventRefreshButtonState.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventRefreshButtonState.kt deleted file mode 100644 index 5caed262a9..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventRefreshButtonState.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventRefreshButtonState (val newState : Boolean): Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventRefreshOverview.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventRefreshOverview.kt deleted file mode 100644 index 4c0f4222e8..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventRefreshOverview.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventRefreshOverview(var from: String, val now : Boolean = false) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventThemeSwitch.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventThemeSwitch.kt deleted file mode 100644 index 46ac76983c..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventThemeSwitch.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventThemeSwitch : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearCwfExported.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearCwfExported.kt deleted file mode 100644 index 1d95780241..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearCwfExported.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.rx.events - -import info.nightscout.rx.weardata.EventData - -class EventWearCwfExported(val payload: EventData.ActionSetCustomWatchface): Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearDataToMobile.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearDataToMobile.kt deleted file mode 100644 index c26c8fd8b6..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearDataToMobile.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.rx.events - -import info.nightscout.rx.weardata.EventData - -class EventWearDataToMobile(val payload: EventData) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearToMobile.kt b/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearToMobile.kt deleted file mode 100644 index c0d430ea51..0000000000 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearToMobile.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.rx.events - -import info.nightscout.rx.weardata.EventData - -class EventWearToMobile(val payload: EventData) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/actions/Actions.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/actions/Actions.kt new file mode 100644 index 0000000000..773d5d6d55 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/actions/Actions.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.actions + +interface Actions \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/LocalAlertUtils.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/alerts/LocalAlertUtils.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/interfaces/LocalAlertUtils.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/alerts/LocalAlertUtils.kt index bbe73ac48c..a320df1379 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/LocalAlertUtils.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/alerts/LocalAlertUtils.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.alerts interface LocalAlertUtils { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/AndroidPermission.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/androidPermissions/AndroidPermission.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/AndroidPermission.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/androidPermissions/AndroidPermission.kt index 675d1936ea..d8d91007d8 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/AndroidPermission.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/androidPermissions/AndroidPermission.kt @@ -1,8 +1,8 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.androidPermissions import android.content.Context import androidx.fragment.app.FragmentActivity -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.interfaces.smsCommunicator.SmsCommunicator interface AndroidPermission { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/APS.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/APS.kt similarity index 87% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/APS.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/APS.kt index c2b62f3931..62edd45dbf 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/APS.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/APS.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps interface APS { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/APSResult.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/APSResult.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/APSResult.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/APSResult.kt index e3b4882fc0..2b8e046a47 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/APSResult.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/APSResult.kt @@ -1,13 +1,14 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps import android.text.Spanned +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.iob.IobTotal import dagger.android.HasAndroidInjector import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.iob.IobTotal import org.json.JSONObject interface APSResult { + var date: Long var json: JSONObject? var reason: String diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/ApsMode.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/ApsMode.kt similarity index 86% rename from core/interfaces/src/main/java/info/nightscout/interfaces/ApsMode.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/ApsMode.kt index 24ee4b3454..362e78098f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/ApsMode.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/ApsMode.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.aps enum class ApsMode { OPEN, diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensData.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensData.kt similarity index 97% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensData.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensData.kt index b3f9f4abcb..ebb9907da6 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensData.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensData.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps interface AutosensData { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensDataStore.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensDataStore.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensDataStore.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensDataStore.kt index d38a7aef20..67daaa6284 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensDataStore.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensDataStore.kt @@ -1,10 +1,10 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps import androidx.collection.LongSparseArray +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.utils.DateUtil import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.DateUtil interface AutosensDataStore { @@ -21,6 +21,7 @@ interface AutosensDataStore { * @return InMemoryGlucoseValue or null */ fun lastBg(): InMemoryGlucoseValue? + /** * Provide last bucketed InMemoryGlucoseValue or null if none exists within the last 9 minutes * diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensResult.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensResult.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensResult.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensResult.kt index f2dd39f830..9381591031 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/AutosensResult.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/AutosensResult.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps data class AutosensResult( diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/BasalData.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/BasalData.kt similarity index 73% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/BasalData.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/BasalData.kt index 7aa8cb0ffb..c5585a5a20 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/BasalData.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/BasalData.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps class BasalData { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/DetermineBasalAdapter.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/DetermineBasalAdapter.kt similarity index 79% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/DetermineBasalAdapter.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/DetermineBasalAdapter.kt index a4ee6afd34..532b38ec7a 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/DetermineBasalAdapter.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/DetermineBasalAdapter.kt @@ -1,9 +1,9 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.iob.MealData -import info.nightscout.interfaces.profile.Profile +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.iob.MealData +import app.aaps.interfaces.profile.Profile interface DetermineBasalAdapter { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/Loop.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/Loop.kt similarity index 85% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/Loop.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/Loop.kt index cc62767c0a..a5a3e22dd0 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/Loop.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/Loop.kt @@ -1,9 +1,9 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.PumpEnactResult import info.nightscout.database.entities.OfflineEvent -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.PumpEnactResult interface Loop { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/SMBDefaults.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/SMBDefaults.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/SMBDefaults.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/SMBDefaults.kt index 048d79d650..d25a1c13da 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/SMBDefaults.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/SMBDefaults.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps @Suppress("SpellCheckingInspection") object SMBDefaults { @@ -22,13 +22,14 @@ object SMBDefaults { // const val remainingCarbsFraction = 1.0 // fraction of carbs we'll assume will absorb over 4h if we don't yet see carb absorption // USED IN DETERMINE_BASAL - const val low_temptarget_lowers_sensitivity = false // lower sensitivity for temptargets <= 99. + const val low_temptarget_lowers_sensitivity = false // lower sensitivity for temptargets <= 99. const val high_temptarget_raises_sensitivity = false // raise sensitivity for temptargets >= 111. synonym for exercise_mode const val sensitivity_raises_target = true // raise BG target when autosens detects sensitivity const val resistance_lowers_target = false // lower BG target when autosens detects resistance const val adv_target_adjustments = false // lower target automatically when BG and eventualBG are high - const val exercise_mode = false // when true, > 105 mg/dL high temp target adjusts sensitivityRatio for exercise_mode. This majorly changes the behavior of high temp targets from before. synonym for high_temptarget_raises_sensitivity + const val exercise_mode = + false // when true, > 105 mg/dL high temp target adjusts sensitivityRatio for exercise_mode. This majorly changes the behavior of high temp targets from before. synonym for high_temptarget_raises_sensitivity const val half_basal_exercise_target = 160 // when temptarget is 160 mg/dL *and* exercise_mode=true, run 50% basal at this level (120 = 75%; 140 = 60%) // create maxCOB and default it to 120 because that's the most a typical body can absorb over 4 hours. diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/Sensitivity.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/Sensitivity.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/Sensitivity.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/Sensitivity.kt index e6bc828726..7f77672e74 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/Sensitivity.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/Sensitivity.kt @@ -1,6 +1,6 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps -import info.nightscout.interfaces.ConfigExportImport +import app.aaps.interfaces.configuration.ConfigExportImport interface Sensitivity : ConfigExportImport { @@ -23,6 +23,7 @@ interface Sensitivity : ConfigExportImport { val isMinCarbsAbsorptionDynamic: Boolean val isOref1: Boolean + companion object { const val MIN_HOURS = 1.0 diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/VariableSensitivityResult.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/VariableSensitivityResult.kt similarity index 64% rename from core/interfaces/src/main/java/info/nightscout/interfaces/aps/VariableSensitivityResult.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/VariableSensitivityResult.kt index 9e851d8241..70b21a6e25 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/aps/VariableSensitivityResult.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/aps/VariableSensitivityResult.kt @@ -1,5 +1,6 @@ -package info.nightscout.interfaces.aps +package app.aaps.interfaces.aps interface VariableSensitivityResult { + var variableSens: Double? } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/automation/Automation.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/automation/Automation.kt similarity index 94% rename from core/interfaces/src/main/java/info/nightscout/interfaces/automation/Automation.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/automation/Automation.kt index 4ad566d6c1..f68da348e8 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/automation/Automation.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/automation/Automation.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.automation +package app.aaps.interfaces.automation interface Automation { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/automation/AutomationEvent.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/automation/AutomationEvent.kt similarity index 55% rename from core/interfaces/src/main/java/info/nightscout/interfaces/automation/AutomationEvent.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/automation/AutomationEvent.kt index c918d5e133..fab60e1a50 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/automation/AutomationEvent.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/automation/AutomationEvent.kt @@ -1,8 +1,9 @@ -package info.nightscout.interfaces.automation +package app.aaps.interfaces.automation interface AutomationEvent { + var isEnabled: Boolean var title: String fun canRun(): Boolean - fun preconditionCanRun() : Boolean + fun preconditionCanRun(): Boolean } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/autotune/Autotune.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/autotune/Autotune.kt similarity index 84% rename from core/interfaces/src/main/java/info/nightscout/interfaces/autotune/Autotune.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/autotune/Autotune.kt index 01fb0701e7..259ee24ddf 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/autotune/Autotune.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/autotune/Autotune.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.autotune +package app.aaps.interfaces.autotune interface Autotune { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/bgQualityCheck/BgQualityCheck.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/bgQualityCheck/BgQualityCheck.kt similarity index 86% rename from core/interfaces/src/main/java/info/nightscout/interfaces/bgQualityCheck/BgQualityCheck.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/bgQualityCheck/BgQualityCheck.kt index b1731340dd..9cfcde10b7 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/bgQualityCheck/BgQualityCheck.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/bgQualityCheck/BgQualityCheck.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.bgQualityCheck +package app.aaps.interfaces.bgQualityCheck import androidx.annotation.DrawableRes diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/Config.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/Config.kt similarity index 89% rename from core/interfaces/src/main/java/info/nightscout/interfaces/Config.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/Config.kt index a2e08f57d4..fb9b1df7a7 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/Config.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/Config.kt @@ -1,7 +1,8 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.configuration @Suppress("PropertyName") interface Config { + val SUPPORTED_NS_VERSION: Int val APS: Boolean val NSCLIENT: Boolean // aapsclient || aapsclient2 @@ -17,7 +18,7 @@ interface Config { val VERSION: String val APPLICATION_ID: String val DEBUG: Boolean - val currentDeviceModelString : String + val currentDeviceModelString: String val appName: Int var appInitialized: Boolean diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/ConfigBuilder.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/ConfigBuilder.kt index 500c4566ef..00c8a84bc1 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/ConfigBuilder.kt @@ -1,11 +1,11 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.configuration import android.widget.LinearLayout import androidx.annotation.StringRes import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginType +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginType interface ConfigBuilder { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/ConfigExportImport.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/ConfigExportImport.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/ConfigExportImport.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/ConfigExportImport.kt index 51460a50c5..24c5cbd599 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/ConfigExportImport.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/ConfigExportImport.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.configuration import org.json.JSONObject diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/Constants.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/Constants.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/Constants.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/Constants.kt index bd006368ed..4de1c66dc2 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/Constants.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/configuration/Constants.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.configuration /** * Created by mike on 07.06.2016. diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Constraint.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Constraint.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Constraint.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Constraint.kt index e508da3fef..c17b4f2494 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Constraint.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Constraint.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.constraints +package app.aaps.interfaces.constraints interface Constraint> { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/ConstraintsChecker.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/ConstraintsChecker.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/interfaces/constraints/ConstraintsChecker.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/ConstraintsChecker.kt index c1f3dde85d..dae8a06b65 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/ConstraintsChecker.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/ConstraintsChecker.kt @@ -1,6 +1,6 @@ -package info.nightscout.interfaces.constraints +package app.aaps.interfaces.constraints -import info.nightscout.interfaces.profile.Profile +import app.aaps.interfaces.profile.Profile /** * Constraints interface diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Objectives.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Objectives.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Objectives.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Objectives.kt index 88c7d8f6f8..53c546d132 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/Objectives.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Objectives.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.constraints +package app.aaps.interfaces.constraints interface Objectives { companion object { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/PluginConstraints.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/PluginConstraints.kt similarity index 94% rename from core/interfaces/src/main/java/info/nightscout/interfaces/constraints/PluginConstraints.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/PluginConstraints.kt index abc4cb45e3..629a749f91 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/constraints/PluginConstraints.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/PluginConstraints.kt @@ -1,6 +1,6 @@ -package info.nightscout.interfaces.constraints +package app.aaps.interfaces.constraints -import info.nightscout.interfaces.profile.Profile +import app.aaps.interfaces.profile.Profile /** * PluginConstraints interface diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Safety.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Safety.kt new file mode 100644 index 0000000000..ec8e59ea09 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/constraints/Safety.kt @@ -0,0 +1,5 @@ +package app.aaps.interfaces.constraints + +import app.aaps.interfaces.configuration.ConfigExportImport + +interface Safety : ConfigExportImport \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/GlucoseUnit.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/db/GlucoseUnit.kt similarity index 91% rename from core/interfaces/src/main/java/info/nightscout/interfaces/GlucoseUnit.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/db/GlucoseUnit.kt index c0e7fb1d4d..fa787eeb2f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/GlucoseUnit.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/db/GlucoseUnit.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.db @Suppress("SpellCheckingInspection") enum class GlucoseUnit(val asText: String) { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/db/PersistenceLayer.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/db/PersistenceLayer.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/interfaces/db/PersistenceLayer.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/db/PersistenceLayer.kt index 265dfd1e38..83ce689eb2 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/db/PersistenceLayer.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/db/PersistenceLayer.kt @@ -1,5 +1,6 @@ -package info.nightscout.interfaces.db +package app.aaps.interfaces.db +import app.aaps.interfaces.queue.Callback import dagger.android.HasAndroidInjector import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.Bolus @@ -8,7 +9,6 @@ import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry -import info.nightscout.interfaces.queue.Callback import io.reactivex.rxjava3.core.Single interface PersistenceLayer { diff --git a/core/interfaces/src/main/java/info/nightscout/shared/extensions/UIUtils.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/extensions/UIUtils.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/shared/extensions/UIUtils.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/extensions/UIUtils.kt index 431db3162c..aa198ae71e 100644 --- a/core/interfaces/src/main/java/info/nightscout/shared/extensions/UIUtils.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/extensions/UIUtils.kt @@ -1,4 +1,4 @@ -package info.nightscout.shared.extensions +package app.aaps.interfaces.extensions import android.os.Handler import android.os.Looper diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/insulin/Insulin.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/insulin/Insulin.kt similarity index 81% rename from core/interfaces/src/main/java/info/nightscout/interfaces/insulin/Insulin.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/insulin/Insulin.kt index eca31317b8..5fc7089cad 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/insulin/Insulin.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/insulin/Insulin.kt @@ -1,9 +1,9 @@ -package info.nightscout.interfaces.insulin +package app.aaps.interfaces.insulin +import app.aaps.interfaces.configuration.ConfigExportImport +import app.aaps.interfaces.iob.Iob import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.interfaces.ConfigExportImport -import info.nightscout.interfaces.iob.Iob interface Insulin : ConfigExportImport { @@ -32,5 +32,5 @@ interface Insulin : ConfigExportImport { fun iobCalcForTreatment(bolus: Bolus, time: Long, dia: Double): Iob - val insulinConfiguration : InsulinConfiguration + val insulinConfiguration: InsulinConfiguration } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/CobInfo.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/CobInfo.kt similarity index 81% rename from core/interfaces/src/main/java/info/nightscout/interfaces/iob/CobInfo.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/CobInfo.kt index 4a52fefcec..27f943a4bb 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/CobInfo.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/CobInfo.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.iob +package app.aaps.interfaces.iob /** All COB up to now, including carbs not yet processed by IobCob calculation. */ data class CobInfo(val timestamp: Long, val displayCob: Double?, val futureCarbs: Double) \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/GlucoseStatus.kt similarity index 84% rename from core/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/GlucoseStatus.kt index c79917d29f..1e76bff673 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/GlucoseStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.iob +package app.aaps.interfaces.iob data class GlucoseStatus( val glucose: Double, diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatusProvider.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/GlucoseStatusProvider.kt similarity index 79% rename from core/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatusProvider.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/GlucoseStatusProvider.kt index 8dffab46fe..b3fa0cd364 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/GlucoseStatusProvider.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/GlucoseStatusProvider.kt @@ -1,6 +1,7 @@ -package info.nightscout.interfaces.iob +package app.aaps.interfaces.iob interface GlucoseStatusProvider { + val glucoseStatusData: GlucoseStatus? fun getGlucoseStatusData(allowOldData: Boolean = false): GlucoseStatus? } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/InMemoryGlucoseValue.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/InMemoryGlucoseValue.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/interfaces/iob/InMemoryGlucoseValue.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/InMemoryGlucoseValue.kt index 1665add47b..e5ba34852e 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/InMemoryGlucoseValue.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/InMemoryGlucoseValue.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.iob +package app.aaps.interfaces.iob import info.nightscout.database.entities.GlucoseValue @@ -7,7 +7,7 @@ import info.nightscout.database.entities.GlucoseValue * It may correspond to GlucoseValue value in db * but because of 5 min recalculations and smoothing it may not */ -class InMemoryGlucoseValue constructor( +class InMemoryGlucoseValue( var timestamp: Long = 0L, /** * Value in mg/dl diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/Iob.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/Iob.kt similarity index 63% rename from core/interfaces/src/main/java/info/nightscout/interfaces/iob/Iob.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/Iob.kt index fdbd0e0cd0..fef0b68885 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/Iob.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/Iob.kt @@ -1,26 +1,10 @@ -package info.nightscout.interfaces.iob +package app.aaps.interfaces.iob class Iob { var iobContrib = 0.0 var activityContrib = 0.0 - fun iobContrib(iobContrib: Double): Iob { - this.iobContrib = iobContrib - return this - } - - fun activityContrib(activityContrib: Double): Iob { - this.activityContrib = activityContrib - return this - } - - operator fun plus(iob: Iob): Iob { - iobContrib += iob.iobContrib - activityContrib += iob.activityContrib - return this - } - override fun equals(other: Any?): Boolean { if (this === other) return true if (other == null || javaClass != other.javaClass) return false diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/IobCobCalculator.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/IobCobCalculator.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/interfaces/iob/IobCobCalculator.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/IobCobCalculator.kt index 8c0133d51d..aeac669207 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/IobCobCalculator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/IobCobCalculator.kt @@ -1,12 +1,12 @@ -package info.nightscout.interfaces.iob +package app.aaps.interfaces.iob +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.BasalData +import app.aaps.interfaces.profile.Profile import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.interfaces.aps.AutosensData -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.BasalData -import info.nightscout.interfaces.profile.Profile import org.json.JSONArray interface IobCobCalculator { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/IobTotal.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/IobTotal.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/interfaces/iob/IobTotal.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/IobTotal.kt index b15f4210c2..57704c39a5 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/IobTotal.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/IobTotal.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.iob +package app.aaps.interfaces.iob @Suppress("SpellCheckingInspection") open class IobTotal(val time: Long) { @@ -15,5 +15,6 @@ open class IobTotal(val time: Long) { var iobWithZeroTemp: IobTotal? = null var netInsulin = 0.0 // for calculations from temp basals only var extendedBolusInsulin = 0.0 // total insulin for extended bolus + companion object } diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/MealData.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/MealData.kt similarity index 85% rename from core/interfaces/src/main/java/info/nightscout/interfaces/iob/MealData.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/MealData.kt index 1f43ee9678..29e1b3eb60 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/iob/MealData.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/iob/MealData.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.iob +package app.aaps.interfaces.iob class MealData { diff --git a/core/interfaces/src/main/java/info/nightscout/rx/logging/AAPSLogger.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/AAPSLogger.kt similarity index 97% rename from core/interfaces/src/main/java/info/nightscout/rx/logging/AAPSLogger.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/AAPSLogger.kt index 0ced293c52..e33a2c48dd 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/logging/AAPSLogger.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/AAPSLogger.kt @@ -1,10 +1,11 @@ -package info.nightscout.rx.logging +package app.aaps.interfaces.logging /** * Created by adrian on 2019-12-27. */ interface AAPSLogger { + fun debug(message: String) fun debug(enable: Boolean, tag: LTag, message: String) fun debug(tag: LTag, message: String) diff --git a/core/interfaces/src/main/java/info/nightscout/rx/interfaces/L.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/L.kt similarity index 77% rename from core/interfaces/src/main/java/info/nightscout/rx/interfaces/L.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/L.kt index 02b264741e..d9b9796b4b 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/interfaces/L.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/L.kt @@ -1,6 +1,7 @@ -package info.nightscout.rx.interfaces +package app.aaps.interfaces.logging interface L { + fun resetToDefaults() fun findByName(name: String): LogElement fun getLogElements(): List diff --git a/core/interfaces/src/main/java/info/nightscout/rx/logging/LTag.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LTag.kt similarity index 85% rename from core/interfaces/src/main/java/info/nightscout/rx/logging/LTag.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LTag.kt index 7b3d6546e2..f4fa98373e 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/logging/LTag.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LTag.kt @@ -1,6 +1,6 @@ -package info.nightscout.rx.logging +package app.aaps.interfaces.logging -enum class LTag(val tag: String, val defaultValue : Boolean = true, val requiresRestart: Boolean = false) { +enum class LTag(val tag: String, val defaultValue: Boolean = true, val requiresRestart: Boolean = false) { CORE("CORE"), APS("APS"), AUTOSENS("AUTOSENS", defaultValue = false), diff --git a/core/interfaces/src/main/java/info/nightscout/rx/interfaces/LogElement.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LogElement.kt similarity index 80% rename from core/interfaces/src/main/java/info/nightscout/rx/interfaces/LogElement.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LogElement.kt index 9d4699fbc4..f66296e003 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/interfaces/LogElement.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LogElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.interfaces +package app.aaps.interfaces.logging interface LogElement { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/logging/LoggerUtils.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LoggerUtils.kt similarity index 64% rename from core/interfaces/src/main/java/info/nightscout/interfaces/logging/LoggerUtils.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LoggerUtils.kt index 5a4e073c21..70adf5e716 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/logging/LoggerUtils.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/LoggerUtils.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.logging +package app.aaps.interfaces.logging interface LoggerUtils { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/logging/UserEntryLogger.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/UserEntryLogger.kt similarity index 87% rename from core/interfaces/src/main/java/info/nightscout/interfaces/logging/UserEntryLogger.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/UserEntryLogger.kt index 2bd447ca79..62ea19247f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/logging/UserEntryLogger.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/logging/UserEntryLogger.kt @@ -1,11 +1,11 @@ -package info.nightscout.interfaces.logging +package app.aaps.interfaces.logging +import app.aaps.interfaces.userEntry.UserEntryMapper +import app.aaps.interfaces.userEntry.ValueWithUnitMapper import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.userEntry.UserEntryMapper -import info.nightscout.interfaces.userEntry.ValueWithUnitMapper interface UserEntryLogger { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/ImportExportPrefs.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/ImportExportPrefs.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/ImportExportPrefs.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/ImportExportPrefs.kt index c3d7ffdbca..27acb5794e 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/ImportExportPrefs.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/ImportExportPrefs.kt @@ -1,8 +1,8 @@ -package info.nightscout.interfaces.maintenance +package app.aaps.interfaces.maintenance import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity -import info.nightscout.rx.weardata.CwfData +import app.aaps.interfaces.rx.weardata.CwfData interface ImportExportPrefs { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefFileListProvider.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefFileListProvider.kt similarity index 87% rename from core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefFileListProvider.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefFileListProvider.kt index e8f78dfb6f..259a6b71f4 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefFileListProvider.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefFileListProvider.kt @@ -1,6 +1,6 @@ -package info.nightscout.interfaces.maintenance +package app.aaps.interfaces.maintenance -import info.nightscout.rx.weardata.CwfData +import app.aaps.interfaces.rx.weardata.CwfData import java.io.File interface PrefFileListProvider { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefMetadata.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefMetadata.kt similarity index 79% rename from core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefMetadata.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefMetadata.kt index a8953b2fe6..f1f5868da0 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefMetadata.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefMetadata.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.maintenance +package app.aaps.interfaces.maintenance import android.os.Parcelable import kotlinx.parcelize.Parcelize diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFile.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsFile.kt similarity index 89% rename from core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFile.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsFile.kt index 77d205bb0d..d4fe3db6c8 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFile.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsFile.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.maintenance +package app.aaps.interfaces.maintenance import android.os.Parcelable import kotlinx.parcelize.Parcelize diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsImportDir.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsImportDir.kt similarity index 54% rename from core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsImportDir.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsImportDir.kt index eddfc99b5d..e6a871c712 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsImportDir.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsImportDir.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.maintenance +package app.aaps.interfaces.maintenance enum class PrefsImportDir { ROOT_DIR, diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsMetadataKey.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsMetadataKey.kt similarity index 79% rename from core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsMetadataKey.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsMetadataKey.kt index 80c81ec0fb..13028c7495 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsMetadataKey.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsMetadataKey.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.maintenance +package app.aaps.interfaces.maintenance import android.content.Context diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsStatus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsStatus.kt similarity index 65% rename from core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsStatus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsStatus.kt index e3df9f692e..69e408fc23 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsStatus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/maintenance/PrefsStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.maintenance +package app.aaps.interfaces.maintenance import android.os.Parcelable diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/notifications/Notification.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/Notification.kt similarity index 99% rename from core/interfaces/src/main/java/info/nightscout/interfaces/notifications/Notification.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/Notification.kt index 6509fb7f61..ac99dda64c 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/notifications/Notification.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/Notification.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.notifications +package app.aaps.interfaces.notifications import android.content.Context import androidx.annotation.RawRes diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/NotificationHolder.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/NotificationHolder.kt similarity index 72% rename from core/interfaces/src/main/java/info/nightscout/interfaces/NotificationHolder.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/NotificationHolder.kt index 9bbdcd815a..aba92859af 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/NotificationHolder.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/NotificationHolder.kt @@ -1,12 +1,13 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.notifications import android.app.Notification import android.app.PendingIntent import android.content.Context interface NotificationHolder { - val channelID : String - val notificationID : Int + + val channelID: String + val notificationID: Int var notification: Notification fun openAppIntent(context: Context): PendingIntent? diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/notifications/NotificationUserMessage.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/NotificationUserMessage.kt similarity index 85% rename from core/interfaces/src/main/java/info/nightscout/interfaces/notifications/NotificationUserMessage.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/NotificationUserMessage.kt index 3eb2d74945..b5e340bfe8 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/notifications/NotificationUserMessage.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/notifications/NotificationUserMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.notifications +package app.aaps.interfaces.notifications class NotificationUserMessage(text: String) : Notification() { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSAlarm.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSAlarm.kt similarity index 94% rename from core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSAlarm.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSAlarm.kt index d90b10ce02..5047158d10 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSAlarm.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSAlarm.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.nsclient +package app.aaps.interfaces.nsclient interface NSAlarm { /* diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSSettingsStatus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSSettingsStatus.kt similarity index 87% rename from core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSSettingsStatus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSSettingsStatus.kt index 4f9093313f..f48f94d15b 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSSettingsStatus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSSettingsStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.nsclient +package app.aaps.interfaces.nsclient import android.content.Context import org.json.JSONObject diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSSgv.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSSgv.kt similarity index 90% rename from core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSSgv.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSSgv.kt index bf7c81c965..5b8cf9d0c9 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/NSSgv.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/NSSgv.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.nsclient +package app.aaps.interfaces.nsclient /** * diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/ProcessedDeviceStatusData.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/ProcessedDeviceStatusData.kt similarity index 81% rename from core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/ProcessedDeviceStatusData.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/ProcessedDeviceStatusData.kt index 4555a4c946..7230fd649a 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/ProcessedDeviceStatusData.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/ProcessedDeviceStatusData.kt @@ -1,8 +1,8 @@ -package info.nightscout.interfaces.nsclient +package app.aaps.interfaces.nsclient import android.text.Spanned +import app.aaps.interfaces.aps.APSResult import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.aps.APSResult import org.json.JSONObject interface ProcessedDeviceStatusData { @@ -12,14 +12,6 @@ interface ProcessedDeviceStatusData { URGENT(2), WARN(1), INFO(0); - - fun toColor(): String = - when (level) { - INFO.level -> "white" - WARN.level -> "yellow" - URGENT.level -> "red" - else -> "white" - } } class PumpData { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/StoreDataForDb.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/StoreDataForDb.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/StoreDataForDb.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/StoreDataForDb.kt index f8bde64a97..ed971d958b 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/nsclient/StoreDataForDb.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/nsclient/StoreDataForDb.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.nsclient +package app.aaps.interfaces.nsclient import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult @@ -16,6 +16,7 @@ import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.transactions.TransactionGlucoseValue interface StoreDataForDb { + val glucoseValues: MutableList val boluses: MutableList val carbs: MutableList diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/Instantiator.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/objects/Instantiator.kt similarity index 56% rename from core/interfaces/src/main/java/info/nightscout/interfaces/profile/Instantiator.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/objects/Instantiator.kt index e4d88b4eb6..832a9d59d5 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/Instantiator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/objects/Instantiator.kt @@ -1,7 +1,8 @@ -package info.nightscout.interfaces.profile +package app.aaps.interfaces.objects -import info.nightscout.interfaces.aps.APSResult -import info.nightscout.interfaces.aps.AutosensData +import app.aaps.interfaces.aps.APSResult +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.profile.ProfileStore import org.json.JSONObject interface Instantiator { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/Overview.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/overview/Overview.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/Overview.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/overview/Overview.kt index 47c33a3f89..084fc242e9 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/Overview.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/overview/Overview.kt @@ -1,7 +1,8 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.overview import androidx.annotation.StringRes -import info.nightscout.rx.bus.RxBus +import app.aaps.interfaces.configuration.ConfigExportImport +import app.aaps.interfaces.rx.bus.RxBus interface Overview : ConfigExportImport { @@ -17,6 +18,7 @@ interface Overview : ConfigExportImport { * @message Dialog body */ fun addNotificationWithDialogResponse(id: Int, text: String, level: Int, @StringRes actionButtonId: Int, title: String, message: String) + /** * Add notification that executes [Runnable] after clicking button * @param id if of notification @@ -26,6 +28,7 @@ interface Overview : ConfigExportImport { * @action Runnable to be run */ fun addNotification(id: Int, text: String, level: Int, @StringRes actionButtonId: Int, action: Runnable) + /** * Remove notification * @param id if of notification diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/overview/OverviewMenus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/overview/OverviewMenus.kt similarity index 91% rename from core/interfaces/src/main/java/info/nightscout/interfaces/overview/OverviewMenus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/overview/OverviewMenus.kt index 0dd3c7e3d6..ee15638fb1 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/overview/OverviewMenus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/overview/OverviewMenus.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.overview +package app.aaps.interfaces.overview import android.content.Context import android.widget.ImageButton diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/ActivePlugin.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/ActivePlugin.kt similarity index 76% rename from core/interfaces/src/main/java/info/nightscout/interfaces/plugin/ActivePlugin.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/ActivePlugin.kt index eccb24cccf..8940202720 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/ActivePlugin.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/ActivePlugin.kt @@ -1,18 +1,18 @@ -package info.nightscout.interfaces.plugin +package app.aaps.interfaces.plugin -import info.nightscout.interfaces.Overview -import info.nightscout.interfaces.aps.APS -import info.nightscout.interfaces.aps.Sensitivity -import info.nightscout.interfaces.constraints.Objectives -import info.nightscout.interfaces.constraints.Safety -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.profile.ProfileSource -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.smoothing.Smoothing -import info.nightscout.interfaces.source.BgSource -import info.nightscout.interfaces.sync.NsClient -import info.nightscout.interfaces.sync.Sync +import app.aaps.interfaces.aps.APS +import app.aaps.interfaces.aps.Sensitivity +import app.aaps.interfaces.constraints.Objectives +import app.aaps.interfaces.constraints.Safety +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.overview.Overview +import app.aaps.interfaces.profile.ProfileSource +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.smoothing.Smoothing +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.sync.NsClient +import app.aaps.interfaces.sync.Sync interface ActivePlugin { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/OwnDatabasePlugin.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/OwnDatabasePlugin.kt similarity index 57% rename from core/interfaces/src/main/java/info/nightscout/interfaces/plugin/OwnDatabasePlugin.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/OwnDatabasePlugin.kt index 9b7f194bf4..6b7e4f3b29 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/OwnDatabasePlugin.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/OwnDatabasePlugin.kt @@ -1,5 +1,6 @@ -package info.nightscout.interfaces.plugin +package app.aaps.interfaces.plugin interface OwnDatabasePlugin { + fun clearAllTables() } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginBase.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginBase.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginBase.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginBase.kt index 873bfc628b..c825f57e44 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginBase.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginBase.kt @@ -1,11 +1,11 @@ -package info.nightscout.interfaces.plugin +package app.aaps.interfaces.plugin import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper /** * Created by mike on 09.06.2016. @@ -57,8 +57,7 @@ abstract class PluginBase( if (pluginDescription.mainType == PluginType.CONSTRAINTS && type == PluginType.CONSTRAINTS) return true if (type == pluginDescription.mainType) return state == State.ENABLED && specialEnableCondition() if (type == PluginType.CONSTRAINTS && pluginDescription.mainType == PluginType.PUMP && isEnabled(PluginType.PUMP)) return true - if (type == PluginType.CONSTRAINTS && pluginDescription.mainType == PluginType.APS && isEnabled(PluginType.APS)) return true - return false + return type == PluginType.CONSTRAINTS && pluginDescription.mainType == PluginType.APS && isEnabled(PluginType.APS) } fun hasFragment(): Boolean { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginDescription.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginDescription.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginDescription.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginDescription.kt index 67a8731f8e..40f26428ac 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginDescription.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginDescription.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.plugin +package app.aaps.interfaces.plugin import app.aaps.annotations.OpenForTesting diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginFragment.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginFragment.kt similarity index 57% rename from core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginFragment.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginFragment.kt index 0b10db8c2c..4236cc0c8c 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginFragment.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginFragment.kt @@ -1,5 +1,6 @@ -package info.nightscout.interfaces.plugin +package app.aaps.interfaces.plugin interface PluginFragment { + var plugin: PluginBase? } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginType.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginType.kt similarity index 84% rename from core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginType.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginType.kt index 19145d91b3..9d6fc98eeb 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginType.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/plugin/PluginType.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.plugin +package app.aaps.interfaces.plugin /** * Main plugin type @@ -6,5 +6,6 @@ package info.nightscout.interfaces.plugin * set by [info.nightscout.interfaces.PluginDescription.mainType] */ enum class PluginType { + GENERAL, SENSITIVITY, PROFILE, APS, PUMP, CONSTRAINTS, LOOP, BGSOURCE, INSULIN, SYNC, SMOOTHING } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/DefaultValueHelper.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/DefaultValueHelper.kt similarity index 95% rename from core/interfaces/src/main/java/info/nightscout/interfaces/profile/DefaultValueHelper.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/DefaultValueHelper.kt index 52265d0f14..8f6c45c26f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/DefaultValueHelper.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/DefaultValueHelper.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.profile +package app.aaps.interfaces.profile interface DefaultValueHelper { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/Profile.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/Profile.kt similarity index 89% rename from core/interfaces/src/main/java/info/nightscout/interfaces/profile/Profile.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/Profile.kt index 1ee7af23b7..4cdf7f9ad2 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/Profile.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/Profile.kt @@ -1,13 +1,13 @@ -package info.nightscout.interfaces.profile +package app.aaps.interfaces.profile -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.interfaces.utils.Round -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.Round import org.json.JSONObject interface Profile { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileFunction.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileFunction.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileFunction.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileFunction.kt index 28cb9a1f45..4464b737b9 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileFunction.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileFunction.kt @@ -1,7 +1,7 @@ -package info.nightscout.interfaces.profile +package app.aaps.interfaces.profile +import app.aaps.interfaces.db.GlucoseUnit import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.interfaces.GlucoseUnit interface ProfileFunction { @@ -65,7 +65,7 @@ interface ProfileFunction { * @param timestamp expected time * @return null if profile cannot be created from profile store */ - fun buildProfileSwitch(profileStore: ProfileStore, profileName: String, durationInMinutes:Int, percentage: Int, timeShiftInHours: Int, timestamp: Long): ProfileSwitch? + fun buildProfileSwitch(profileStore: ProfileStore, profileName: String, durationInMinutes: Int, percentage: Int, timeShiftInHours: Int, timestamp: Long): ProfileSwitch? /** * Create a new circadian profile switch request based on provided profile diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileSource.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileSource.kt similarity index 80% rename from core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileSource.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileSource.kt index f25c97cff9..2c98a379bc 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileSource.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileSource.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.profile +package app.aaps.interfaces.profile import androidx.fragment.app.FragmentActivity import org.json.JSONArray @@ -18,16 +18,17 @@ interface ProfileSource { var targetLow: JSONArray, var targetHigh: JSONArray, ) { + fun deepClone(): SingleProfile = SingleProfile( - name = name, - mgdl = mgdl, - dia = dia, - ic = JSONArray(ic.toString()), - isf = JSONArray(isf.toString()), - basal = JSONArray(basal.toString()), - targetLow = JSONArray(targetLow.toString()), - targetHigh = JSONArray(targetHigh.toString()) + name = name, + mgdl = mgdl, + dia = dia, + ic = JSONArray(ic.toString()), + isf = JSONArray(isf.toString()), + basal = JSONArray(basal.toString()), + targetLow = JSONArray(targetLow.toString()), + targetHigh = JSONArray(targetHigh.toString()) ) } diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileStore.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileStore.kt similarity index 89% rename from core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileStore.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileStore.kt index 43174e6af6..df6e7211da 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileStore.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileStore.kt @@ -1,8 +1,9 @@ -package info.nightscout.interfaces.profile +package app.aaps.interfaces.profile import org.json.JSONObject interface ProfileStore { + val data: JSONObject fun getStartDate(): Long diff --git a/core/interfaces/src/main/java/info/nightscout/shared/interfaces/ProfileUtil.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileUtil.kt similarity index 96% rename from core/interfaces/src/main/java/info/nightscout/shared/interfaces/ProfileUtil.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileUtil.kt index 9d503d0b3d..3911491f41 100644 --- a/core/interfaces/src/main/java/info/nightscout/shared/interfaces/ProfileUtil.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/ProfileUtil.kt @@ -1,11 +1,11 @@ -package info.nightscout.shared.interfaces +package app.aaps.interfaces.profile -import info.nightscout.interfaces.GlucoseUnit +import app.aaps.interfaces.db.GlucoseUnit interface ProfileUtil { /** - * Units selected in [info.nightscout.shared.sharedPreferences.SP] + * Units selected in [app.aaps.interfaces.sharedPreferences.SP] * * @return GlucoseUnit for UI */ diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/PureProfile.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/PureProfile.kt similarity index 84% rename from core/interfaces/src/main/java/info/nightscout/interfaces/profile/PureProfile.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/PureProfile.kt index ef9ffffa66..dc6162ba5f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/profile/PureProfile.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profile/PureProfile.kt @@ -1,8 +1,8 @@ -package info.nightscout.interfaces.profile +package app.aaps.interfaces.profile +import app.aaps.interfaces.db.GlucoseUnit import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock -import info.nightscout.interfaces.GlucoseUnit import org.json.JSONObject import java.util.TimeZone diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/profiling/Profiler.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profiling/Profiler.kt new file mode 100644 index 0000000000..eff7c03751 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/profiling/Profiler.kt @@ -0,0 +1,8 @@ +package app.aaps.interfaces.profiling + +import app.aaps.interfaces.logging.LTag + +interface Profiler { + + fun log(lTag: LTag, function: String, start: Long) +} \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/protection/PasswordCheck.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/protection/PasswordCheck.kt similarity index 96% rename from core/interfaces/src/main/java/info/nightscout/interfaces/protection/PasswordCheck.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/protection/PasswordCheck.kt index acc821552e..3b06910181 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/protection/PasswordCheck.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/protection/PasswordCheck.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.protection +package app.aaps.interfaces.protection import android.content.Context import androidx.annotation.StringRes diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/protection/ProtectionCheck.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/protection/ProtectionCheck.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/interfaces/protection/ProtectionCheck.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/protection/ProtectionCheck.kt index 8a2df60afe..a040808383 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/protection/ProtectionCheck.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/protection/ProtectionCheck.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.protection +package app.aaps.interfaces.protection import androidx.fragment.app.FragmentActivity diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/BlePreCheck.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/BlePreCheck.kt similarity index 77% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/BlePreCheck.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/BlePreCheck.kt index f76fb88d76..84c54a03e5 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/BlePreCheck.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/BlePreCheck.kt @@ -1,7 +1,8 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump import androidx.appcompat.app.AppCompatActivity interface BlePreCheck { + fun prerequisitesCheck(activity: AppCompatActivity): Boolean } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/BolusProgressData.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/BolusProgressData.kt similarity index 67% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/BolusProgressData.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/BolusProgressData.kt index 053aca2594..22c0cb2f64 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/BolusProgressData.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/BolusProgressData.kt @@ -1,6 +1,7 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump object BolusProgressData { + var bolusEnded = false var stopPressed = false } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Dana.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Dana.kt similarity index 89% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/Dana.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Dana.kt index 0a578aabeb..f709eb591b 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Dana.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Dana.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump /** * Functionality supported by Dana* pumps only diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/DetailedBolusInfo.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/DetailedBolusInfo.kt index ef312238e2..dfdd0be259 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/DetailedBolusInfo.kt @@ -1,12 +1,12 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump import android.content.Context +import app.aaps.interfaces.pump.defs.PumpType import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.pump.defs.PumpType class DetailedBolusInfo { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfoStorage.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/DetailedBolusInfoStorage.kt similarity index 81% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfoStorage.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/DetailedBolusInfoStorage.kt index bc4766f3a7..fe99a3caa6 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfoStorage.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/DetailedBolusInfoStorage.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump interface DetailedBolusInfoStorage { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Diaconn.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Diaconn.kt similarity index 78% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/Diaconn.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Diaconn.kt index 3e45d7dd8a..896609a675 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Diaconn.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Diaconn.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump interface Diaconn { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Insight.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Insight.kt similarity index 80% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/Insight.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Insight.kt index 6349b6c5ac..a0750eb03f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Insight.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Insight.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump interface Insight { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Medtrum.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Medtrum.kt similarity index 91% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/Medtrum.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Medtrum.kt index a574e3a609..3f7c1f571c 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Medtrum.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Medtrum.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump /** * Functionality supported by Medtrum* pumps only diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/OmnipodDash.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/OmnipodDash.kt new file mode 100644 index 0000000000..0fa2f0ff62 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/OmnipodDash.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.pump + +interface OmnipodDash \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/OmnipodEros.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/OmnipodEros.kt similarity index 61% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/OmnipodEros.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/OmnipodEros.kt index 73d4b8563b..45595435da 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/OmnipodEros.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/OmnipodEros.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump interface OmnipodEros { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Pump.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Pump.kt similarity index 94% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/Pump.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Pump.kt index fb49951e0e..d77f87cc8a 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/Pump.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/Pump.kt @@ -1,13 +1,13 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.interfaces.utils.TimeChangeType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.actions.CustomAction +import app.aaps.interfaces.pump.actions.CustomActionType +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CustomCommand +import app.aaps.interfaces.utils.TimeChangeType import org.json.JSONObject /** @@ -284,6 +284,7 @@ interface Pump { * Pumps with a hardware link can set via config "Battery Change Logging" */ fun isBatteryChangeLoggingEnabled(): Boolean = false + /** * Pumps is connect via RileyLink */ diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpEnactResult.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpEnactResult.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpEnactResult.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpEnactResult.kt index 98a7627a4a..5363c0fbb1 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpEnactResult.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpEnactResult.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump import android.content.Context import dagger.android.HasAndroidInjector diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpPluginBase.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpPluginBase.kt similarity index 60% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpPluginBase.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpPluginBase.kt index 8a18681cb2..8e26996cf8 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpPluginBase.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpPluginBase.kt @@ -1,14 +1,14 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump import android.os.SystemClock +import app.aaps.interfaces.R +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.R -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper abstract class PumpPluginBase( pluginDescription: PluginDescription, diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpSync.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpSync.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpSync.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpSync.kt index 52d64d2113..5233258993 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpSync.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/PumpSync.kt @@ -1,11 +1,11 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import kotlin.math.max import kotlin.math.min import kotlin.math.roundToInt diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/TemporaryBasalStorage.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/TemporaryBasalStorage.kt similarity index 82% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/TemporaryBasalStorage.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/TemporaryBasalStorage.kt index 0c02f5bd5b..c08e983878 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/TemporaryBasalStorage.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/TemporaryBasalStorage.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump interface TemporaryBasalStorage { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/VirtualPump.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/VirtualPump.kt similarity index 68% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/VirtualPump.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/VirtualPump.kt index 7d0292dd48..376bb620bf 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/VirtualPump.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/VirtualPump.kt @@ -1,6 +1,7 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump interface VirtualPump { + var fakeDataDetected: Boolean fun isEnabled(): Boolean } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/WarnColors.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/WarnColors.kt similarity index 91% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/WarnColors.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/WarnColors.kt index 8a7a8adf9f..da18e6a731 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/WarnColors.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/WarnColors.kt @@ -1,9 +1,10 @@ -package info.nightscout.interfaces.pump +package app.aaps.interfaces.pump import android.widget.TextView import info.nightscout.database.entities.TherapyEvent interface WarnColors { + fun setColor(view: TextView?, value: Double, warnLevel: Double, urgentLevel: Double) fun setColorInverse(view: TextView?, value: Double, warnLevel: Double, urgentLevel: Double) fun setColorByAge(view: TextView?, therapyEvent: TherapyEvent, warnThreshold: Double, urgentThreshold: Double) diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/actions/CustomAction.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/actions/CustomAction.kt similarity index 76% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/actions/CustomAction.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/actions/CustomAction.kt index a789e3f026..a732b22d37 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/actions/CustomAction.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/actions/CustomAction.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump.actions +package app.aaps.interfaces.pump.actions data class CustomAction( val name: Int, diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/actions/CustomActionType.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/actions/CustomActionType.kt similarity index 53% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/actions/CustomActionType.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/actions/CustomActionType.kt index b000138951..0afe44a12f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/actions/CustomActionType.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/actions/CustomActionType.kt @@ -1,5 +1,6 @@ -package info.nightscout.interfaces.pump.actions +package app.aaps.interfaces.pump.actions interface CustomActionType { + fun getKey(): String } \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/DoseSettings.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/DoseSettings.kt new file mode 100644 index 0000000000..419075b96e --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/DoseSettings.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.pump.defs + +class DoseSettings(val step: Double, val durationStep: Int, val maxDuration: Int, val minDose: Double, val maxDose: Double = Double.MAX_VALUE) \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseStepSize.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/DoseStepSize.kt similarity index 52% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseStepSize.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/DoseStepSize.kt index ba48c0b716..58f6e64f04 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseStepSize.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/DoseStepSize.kt @@ -1,35 +1,44 @@ -package info.nightscout.interfaces.pump.defs +package app.aaps.interfaces.pump.defs import java.util.Locale enum class DoseStepSize(private val entries: Array) { - ComboBasal(arrayOf( - DoseStepSizeEntry(0.0, 1.0, 0.01), - DoseStepSizeEntry(1.0, 10.0, 0.05), - DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.1) - )), - InsightBolus(arrayOf( - DoseStepSizeEntry(0.0, 2.0, 0.05), - DoseStepSizeEntry(2.0, 5.0, 0.1), - DoseStepSizeEntry(5.0, 10.0, 0.2), - DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.5) - )), - InsightBasal(arrayOf( - DoseStepSizeEntry(0.0, 5.0, 0.01), - DoseStepSizeEntry(5.0, Double.MAX_VALUE, 0.1) - )), - MedtronicVeoBasal(arrayOf( - DoseStepSizeEntry(0.0, 1.0, 0.025), - DoseStepSizeEntry(1.0, 10.0, 0.05), - DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.1) - )), - YpsopumpBasal(arrayOf( - DoseStepSizeEntry(0.0, 1.0, 0.01), - DoseStepSizeEntry(1.0, 2.0, 0.02), - DoseStepSizeEntry(2.0, 15.0, 0.1), - DoseStepSizeEntry(15.0, 40.0, 0.5) - ) + ComboBasal( + arrayOf( + DoseStepSizeEntry(0.0, 1.0, 0.01), + DoseStepSizeEntry(1.0, 10.0, 0.05), + DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.1) + ) + ), + InsightBolus( + arrayOf( + DoseStepSizeEntry(0.0, 2.0, 0.05), + DoseStepSizeEntry(2.0, 5.0, 0.1), + DoseStepSizeEntry(5.0, 10.0, 0.2), + DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.5) + ) + ), + InsightBasal( + arrayOf( + DoseStepSizeEntry(0.0, 5.0, 0.01), + DoseStepSizeEntry(5.0, Double.MAX_VALUE, 0.1) + ) + ), + MedtronicVeoBasal( + arrayOf( + DoseStepSizeEntry(0.0, 1.0, 0.025), + DoseStepSizeEntry(1.0, 10.0, 0.05), + DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.1) + ) + ), + YpsopumpBasal( + arrayOf( + DoseStepSizeEntry(0.0, 1.0, 0.01), + DoseStepSizeEntry(1.0, 2.0, 0.02), + DoseStepSizeEntry(2.0, 15.0, 0.1), + DoseStepSizeEntry(15.0, 40.0, 0.5) + ) ); fun getStepSizeForAmount(amount: Double): Double { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/ManufacturerType.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/ManufacturerType.kt similarity index 87% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/ManufacturerType.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/ManufacturerType.kt index 8ffcfeb6c6..97cfe7e1ad 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/ManufacturerType.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/ManufacturerType.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump.defs +package app.aaps.interfaces.pump.defs enum class ManufacturerType(val description: String) { AAPS("AAPS"), diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpCapability.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpCapability.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpCapability.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpCapability.kt index b2557ff80b..aa8d887fcc 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpCapability.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpCapability.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump.defs +package app.aaps.interfaces.pump.defs enum class PumpCapability { @@ -8,6 +8,7 @@ enum class PumpCapability { BasalProfileSet, // isSetBasalProfileCapable Refill, // isRefillingCapable ReplaceBattery, // isBatteryReplaceable + // StoreCarbInfo, // removed. incompatible with storing notes with carbs TDD, // supportsTDDs ManualTDDLoad, // needsManualTDDLoad @@ -18,6 +19,7 @@ enum class PumpCapability { VirtualPumpCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery)), ComboCapabilities(arrayOf(Bolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad)), DanaCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad)), + //DanaWithHistoryCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, StoreCarbInfo, TDD, ManualTDDLoad)), DanaWithHistoryCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, ManualTDDLoad)), InsightCapabilities(arrayOf(Bolus, ExtendedBolus, TempBasal, BasalProfileSet, Refill, ReplaceBattery, TDD, BasalRate30min)), diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpDescription.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpDescription.kt similarity index 99% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpDescription.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpDescription.kt index f3a8e68ce7..26e19a8ac9 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpDescription.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpDescription.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump.defs +package app.aaps.interfaces.pump.defs class PumpDescription() { @@ -29,6 +29,7 @@ class PumpDescription() { var basalMaximumRate = 0.0 var isRefillingCapable = false var isBatteryReplaceable = false + //var storesCarbInfo = false var is30minBasalRatesCapable = false var supportsTDDs = false diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpTempBasalType.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpTempBasalType.kt similarity index 57% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpTempBasalType.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpTempBasalType.kt index 49eacfda89..e5303a93d9 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpTempBasalType.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpTempBasalType.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump.defs +package app.aaps.interfaces.pump.defs enum class PumpTempBasalType { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpType.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpType.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpType.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpType.kt index 994ed2b84a..0cbb0c59fe 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpType.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/pump/defs/PumpType.kt @@ -1,6 +1,6 @@ -package info.nightscout.interfaces.pump.defs +package app.aaps.interfaces.pump.defs -import info.nightscout.interfaces.utils.Round +import app.aaps.interfaces.utils.Round import kotlin.math.min @Suppress("unused") @@ -587,9 +587,6 @@ enum class PumpType { fun determineCorrectBasalSize(basalAmount: Double): Double { val tSettings = tbrSettings ?: throw IllegalStateException() - return Round.roundTo( - min(basalAmount, tSettings.maxDose), baseBasalSpecialSteps?.getStepSizeForAmount(basalAmount) - ?: baseBasalStep - ) + return Round.roundTo(min(basalAmount, tSettings.maxDose), baseBasalSpecialSteps?.getStepSizeForAmount(basalAmount) ?: baseBasalStep) } } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/queue/Callback.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/Callback.kt similarity index 66% rename from core/interfaces/src/main/java/info/nightscout/interfaces/queue/Callback.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/Callback.kt index 1f76e17009..bb3828ebf2 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/queue/Callback.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/Callback.kt @@ -1,6 +1,6 @@ -package info.nightscout.interfaces.queue +package app.aaps.interfaces.queue -import info.nightscout.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpEnactResult abstract class Callback : Runnable { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/queue/Command.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/Command.kt similarity index 88% rename from core/interfaces/src/main/java/info/nightscout/interfaces/queue/Command.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/Command.kt index 545630ecc3..7d870345e1 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/queue/Command.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/Command.kt @@ -1,8 +1,8 @@ -package info.nightscout.interfaces.queue +package app.aaps.interfaces.queue +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject abstract class Command( diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/queue/CommandQueue.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/CommandQueue.kt similarity index 90% rename from core/interfaces/src/main/java/info/nightscout/interfaces/queue/CommandQueue.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/CommandQueue.kt index 047263c3b2..43f0752ce2 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/queue/CommandQueue.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/CommandQueue.kt @@ -1,9 +1,9 @@ -package info.nightscout.interfaces.queue +package app.aaps.interfaces.queue import android.text.Spanned -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync interface CommandQueue { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/queue/CustomCommand.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/CustomCommand.kt similarity index 62% rename from core/interfaces/src/main/java/info/nightscout/interfaces/queue/CustomCommand.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/CustomCommand.kt index 6cc9b22f4f..8cc549e0d8 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/queue/CustomCommand.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/queue/CustomCommand.kt @@ -1,15 +1,15 @@ -package info.nightscout.interfaces.queue +package app.aaps.interfaces.queue import java.io.Serializable /** * Implement this interface for every custom pump command that you want to be able to queue - * See [info.nightscout.androidaps.interfaces.CommandQueue.customCommand] for queuing a custom command. + * See [app.aaps.interfaces.queue.CommandQueue.customCommand] for queuing a custom command. */ interface CustomCommand : Serializable { /** - * @return short description of this command to be used in [info.nightscout.androidaps.queue.commands.Command.status] + * @return short description of this command to be used in [app.aaps.interfaces.queue.Command.status] * The description is typically all caps. */ val statusDescription: String diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/receivers/Intents.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/receivers/Intents.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/receivers/Intents.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/receivers/Intents.kt index e9ee19fd85..160fbfa18a 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/receivers/Intents.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/receivers/Intents.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.receivers +package app.aaps.interfaces.receivers @Suppress("unused") interface Intents { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/receivers/ReceiverStatusStore.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/receivers/ReceiverStatusStore.kt similarity index 67% rename from core/interfaces/src/main/java/info/nightscout/interfaces/receivers/ReceiverStatusStore.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/receivers/ReceiverStatusStore.kt index d2918031fc..aaa6e198a3 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/receivers/ReceiverStatusStore.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/receivers/ReceiverStatusStore.kt @@ -1,7 +1,7 @@ -package info.nightscout.interfaces.receivers +package app.aaps.interfaces.receivers -import info.nightscout.rx.events.EventChargingState -import info.nightscout.rx.events.EventNetworkChange +import app.aaps.interfaces.rx.events.EventChargingState +import app.aaps.interfaces.rx.events.EventNetworkChange interface ReceiverStatusStore { diff --git a/core/interfaces/src/main/java/info/nightscout/shared/interfaces/ResourceHelper.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/resources/ResourceHelper.kt similarity index 86% rename from core/interfaces/src/main/java/info/nightscout/shared/interfaces/ResourceHelper.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/resources/ResourceHelper.kt index 1235c1d199..a9df9bf2f3 100644 --- a/core/interfaces/src/main/java/info/nightscout/shared/interfaces/ResourceHelper.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/resources/ResourceHelper.kt @@ -1,4 +1,4 @@ -package info.nightscout.shared.interfaces +package app.aaps.interfaces.resources import android.content.Context import android.content.res.AssetFileDescriptor @@ -16,18 +16,19 @@ import androidx.annotation.RawRes import androidx.annotation.StringRes interface ResourceHelper { + fun gs(@StringRes id: Int): String fun gs(@StringRes id: Int, vararg args: Any?): String fun gq(@PluralsRes id: Int, quantity: Int, vararg args: Any?): String fun gsNotLocalised(@StringRes id: Int, vararg args: Any?): String @ColorInt fun gc(@ColorRes id: Int): Int fun gd(@DrawableRes id: Int): Drawable? - fun gb(@BoolRes id :Int) : Boolean + fun gb(@BoolRes id: Int): Boolean fun gcs(@ColorRes id: Int): String - fun gsa(@ArrayRes id:Int): Array - fun openRawResourceFd(@RawRes id : Int) : AssetFileDescriptor? + fun gsa(@ArrayRes id: Int): Array + fun openRawResourceFd(@RawRes id: Int): AssetFileDescriptor? - fun decodeResource(id : Int) : Bitmap + fun decodeResource(id: Int): Bitmap fun getDisplayMetrics(): DisplayMetrics fun dpToPx(dp: Int): Int fun dpToPx(dp: Float): Int @@ -37,10 +38,12 @@ interface ResourceHelper { * Get Attribute Color based on theme style */ @ColorInt fun gac(@AttrRes attributeId: Int): Int + /** * Get Attribute Color based on theme style for specified context */ @ColorInt fun gac(context: Context?, @AttrRes attributeId: Int): Int + /** * Get themed context -->> context dependent on light or darkmode */ diff --git a/core/interfaces/src/main/java/info/nightscout/rx/AapsSchedulers.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/AapsSchedulers.kt similarity index 87% rename from core/interfaces/src/main/java/info/nightscout/rx/AapsSchedulers.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/AapsSchedulers.kt index af6f4f1cda..21f716dca0 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/AapsSchedulers.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/AapsSchedulers.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx +package app.aaps.interfaces.rx import io.reactivex.rxjava3.core.Scheduler diff --git a/core/interfaces/src/main/java/info/nightscout/rx/bus/RxBus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/bus/RxBus.kt similarity index 79% rename from core/interfaces/src/main/java/info/nightscout/rx/bus/RxBus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/bus/RxBus.kt index e2649036c5..de0a815fd8 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/bus/RxBus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/bus/RxBus.kt @@ -1,6 +1,6 @@ -package info.nightscout.rx.bus +package app.aaps.interfaces.rx.bus -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event import io.reactivex.rxjava3.core.Observable interface RxBus { diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/Event.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/Event.kt similarity index 92% rename from core/interfaces/src/main/java/info/nightscout/rx/events/Event.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/Event.kt index 189c816f33..bccdf039e4 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/Event.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/Event.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events import org.apache.commons.lang3.builder.ReflectionToStringBuilder import org.apache.commons.lang3.builder.ToStringStyle diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventAcceptOpenLoopChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAcceptOpenLoopChange.kt similarity index 52% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventAcceptOpenLoopChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAcceptOpenLoopChange.kt index 4ce0b81178..49314a3f84 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventAcceptOpenLoopChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAcceptOpenLoopChange.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventAcceptOpenLoopChange : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAppExit.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAppExit.kt new file mode 100644 index 0000000000..0efdba0e24 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAppExit.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventAppExit : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAppInitialized.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAppInitialized.kt new file mode 100644 index 0000000000..d1ce190705 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAppInitialized.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventAppInitialized : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventAutosensCalculationFinished.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAutosensCalculationFinished.kt similarity index 65% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventAutosensCalculationFinished.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAutosensCalculationFinished.kt index 531ab29910..15edf45579 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventAutosensCalculationFinished.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventAutosensCalculationFinished.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventAutosensCalculationFinished(val cause: Event?) : EventLoop() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventBTChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventBTChange.kt similarity index 82% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventBTChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventBTChange.kt index 3e30f4695f..8c11af0b4a 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventBTChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventBTChange.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventBTChange(val state: Change, val deviceName: String?, val deviceAddress: String? = null) : Event() { diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventBucketedDataCreated.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventBucketedDataCreated.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventBucketedDataCreated.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventBucketedDataCreated.kt index d191615e5a..71b2c600ad 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventBucketedDataCreated.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventBucketedDataCreated.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventBucketedDataCreated : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventChargingState.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventChargingState.kt similarity index 68% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventChargingState.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventChargingState.kt index 81606ec944..51362cfa13 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventChargingState.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventChargingState.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventChargingState(val isCharging: Boolean, val batterLevel: Int) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventConfigBuilderChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventConfigBuilderChange.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventConfigBuilderChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventConfigBuilderChange.kt index c898c5c7da..4e3d217005 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventConfigBuilderChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventConfigBuilderChange.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventConfigBuilderChange : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventCustomActionsChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventCustomActionsChanged.kt similarity index 52% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventCustomActionsChanged.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventCustomActionsChanged.kt index a6b2ff8203..00a81b6f61 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventCustomActionsChanged.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventCustomActionsChanged.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventCustomActionsChanged : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventCustomCalculationFinished.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventCustomCalculationFinished.kt similarity index 55% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventCustomCalculationFinished.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventCustomCalculationFinished.kt index 32888aa35c..216207d14a 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventCustomCalculationFinished.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventCustomCalculationFinished.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventCustomCalculationFinished : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDanaRSyncStatus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDanaRSyncStatus.kt similarity index 60% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventDanaRSyncStatus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDanaRSyncStatus.kt index a79f0b57d0..6ce993eb7c 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDanaRSyncStatus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDanaRSyncStatus.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventDanaRSyncStatus(var message: String) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDeviceStatusChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDeviceStatusChange.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventDeviceStatusChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDeviceStatusChange.kt index 9bfe37b1b0..84995628d8 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDeviceStatusChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDeviceStatusChange.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventDeviceStatusChange : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDiaconnG8PumpLogReset.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDiaconnG8PumpLogReset.kt similarity index 53% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventDiaconnG8PumpLogReset.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDiaconnG8PumpLogReset.kt index 410809ba6d..cbf22bf87f 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDiaconnG8PumpLogReset.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDiaconnG8PumpLogReset.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventDiaconnG8PumpLogReset : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDismissBolusProgressIfRunning.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDismissBolusProgressIfRunning.kt similarity index 71% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventDismissBolusProgressIfRunning.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDismissBolusProgressIfRunning.kt index 95d7cac099..323dc81598 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDismissBolusProgressIfRunning.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDismissBolusProgressIfRunning.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventDismissBolusProgressIfRunning(val resultSuccess: Boolean?, val id: Long?) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDismissNotification.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDismissNotification.kt similarity index 59% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventDismissNotification.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDismissNotification.kt index 2e0e5d346e..aef67569cf 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventDismissNotification.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventDismissNotification.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventDismissNotification(var id: Int) : Event() diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventEffectiveProfileSwitchChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventEffectiveProfileSwitchChanged.kt similarity index 80% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventEffectiveProfileSwitchChanged.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventEffectiveProfileSwitchChanged.kt index ebd66c98cb..ef374241dc 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventEffectiveProfileSwitchChanged.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventEffectiveProfileSwitchChanged.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventEffectiveProfileSwitchChanged(timestamp: Long?) : Event() { diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventExtendedBolusChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventExtendedBolusChange.kt similarity index 54% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventExtendedBolusChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventExtendedBolusChange.kt index 73e2811363..86366da3b3 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventExtendedBolusChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventExtendedBolusChange.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventExtendedBolusChange : EventLoop() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventFoodDatabaseChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventFoodDatabaseChanged.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventFoodDatabaseChanged.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventFoodDatabaseChanged.kt index 845df25de7..3d06c42246 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventFoodDatabaseChanged.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventFoodDatabaseChanged.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventFoodDatabaseChanged : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventInitializationChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventInitializationChanged.kt similarity index 53% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventInitializationChanged.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventInitializationChanged.kt index a91c183006..fd49c7ad9c 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventInitializationChanged.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventInitializationChanged.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventInitializationChanged : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventLocalProfileChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLocalProfileChanged.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventLocalProfileChanged.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLocalProfileChanged.kt index 562cfc8dfc..ef9de42ac3 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventLocalProfileChanged.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLocalProfileChanged.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventLocalProfileChanged : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventLoop.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLoop.kt similarity index 77% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventLoop.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLoop.kt index 51319dc756..49fe3f90df 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventLoop.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLoop.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events /** Supeclass for all events concerned with input or output into or from the LoopPlugin. */ abstract class EventLoop : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventLoopUpdateGui.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLoopUpdateGui.kt similarity index 69% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventLoopUpdateGui.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLoopUpdateGui.kt index 222431ac3d..73897204f1 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventLoopUpdateGui.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventLoopUpdateGui.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events /** * Created by mike on 05.08.2016. diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventMobileDataToWear.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventMobileDataToWear.kt similarity index 50% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventMobileDataToWear.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventMobileDataToWear.kt index 9cc327ae92..75ac101dc6 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventMobileDataToWear.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventMobileDataToWear.kt @@ -1,5 +1,5 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events -import info.nightscout.rx.weardata.EventData +import app.aaps.interfaces.rx.weardata.EventData class EventMobileDataToWear(val payload: EventData.ActionSetCustomWatchface) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventMobileToWear.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventMobileToWear.kt new file mode 100644 index 0000000000..1cf21e239f --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventMobileToWear.kt @@ -0,0 +1,5 @@ +package app.aaps.interfaces.rx.events + +import app.aaps.interfaces.rx.weardata.EventData + +class EventMobileToWear(val payload: EventData) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNSClientNewLog.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNSClientNewLog.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventNSClientNewLog.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNSClientNewLog.kt index cc001a4517..bfec19d767 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNSClientNewLog.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNSClientNewLog.kt @@ -1,9 +1,10 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events import java.text.SimpleDateFormat import java.util.Locale class EventNSClientNewLog(val action: String, val logText: String?) : Event() { + var date = System.currentTimeMillis() private var timeFormat = SimpleDateFormat("HH:mm:ss", Locale.getDefault()) diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNSClientRestart.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNSClientRestart.kt new file mode 100644 index 0000000000..47d1bc35e1 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNSClientRestart.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventNSClientRestart : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNetworkChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNetworkChange.kt similarity index 86% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventNetworkChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNetworkChange.kt index d93ec73de9..fbfbb79f02 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNetworkChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNetworkChange.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventNetworkChange( var mobileConnected: Boolean = false, diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNewBG.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewBG.kt similarity index 63% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventNewBG.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewBG.kt index c7f3ce9353..3d7026433a 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNewBG.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewBG.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventNewBG(val glucoseValueTimestamp: Long?) : EventLoop() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNewHistoryData.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewHistoryData.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventNewHistoryData.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewHistoryData.kt index eb0a8e6137..3a84461fa1 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNewHistoryData.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewHistoryData.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events import org.joda.time.DateTime import org.joda.time.format.DateTimeFormat diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNewOpenLoopNotification.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewOpenLoopNotification.kt similarity index 54% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventNewOpenLoopNotification.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewOpenLoopNotification.kt index 5320663bc3..de6cc6171c 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNewOpenLoopNotification.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNewOpenLoopNotification.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventNewOpenLoopNotification : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNtpStatus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNtpStatus.kt similarity index 64% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventNtpStatus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNtpStatus.kt index cd8f79efe5..0267d3c1df 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventNtpStatus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventNtpStatus.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventNtpStatus(val status: String, val percent: Int) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventOfflineChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventOfflineChange.kt new file mode 100644 index 0000000000..301dc8f36f --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventOfflineChange.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventOfflineChange : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventOverviewBolusProgress.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventOverviewBolusProgress.kt similarity index 52% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventOverviewBolusProgress.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventOverviewBolusProgress.kt index 4f94fbb17f..2eb154971f 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventOverviewBolusProgress.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventOverviewBolusProgress.kt @@ -1,8 +1,8 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events object EventOverviewBolusProgress : Event() { - data class Treatment constructor(var insulin: Double = 0.0, var carbs: Int = 0, var isSMB: Boolean, var id: Long) + data class Treatment(var insulin: Double = 0.0, var carbs: Int = 0, var isSMB: Boolean, var id: Long) var status = "" var t: Treatment? = null diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventPreferenceChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventPreferenceChange.kt similarity index 86% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventPreferenceChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventPreferenceChange.kt index 27caf34caa..5292da0efb 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventPreferenceChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventPreferenceChange.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventPreferenceChange : Event { diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventProfileStoreChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventProfileStoreChanged.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventProfileStoreChanged.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventProfileStoreChanged.kt index 00ba8ab6a8..01ddecffc0 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventProfileStoreChanged.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventProfileStoreChanged.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventProfileStoreChanged : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventProfileSwitchChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventProfileSwitchChanged.kt similarity index 52% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventProfileSwitchChanged.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventProfileSwitchChanged.kt index 4ccb7540b6..3ecd6dadaa 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventProfileSwitchChanged.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventProfileSwitchChanged.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventProfileSwitchChanged : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventPumpStatusChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventPumpStatusChanged.kt similarity index 95% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventPumpStatusChanged.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventPumpStatusChanged.kt index 84160e7b5d..c151bc2dd8 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventPumpStatusChanged.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventPumpStatusChanged.kt @@ -1,7 +1,7 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events import android.content.Context -import info.nightscout.interfaces.R +import app.aaps.interfaces.R class EventPumpStatusChanged : EventStatus { diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventQueueChanged.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventQueueChanged.kt new file mode 100644 index 0000000000..e4440e4e28 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventQueueChanged.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventQueueChanged : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRebuildTabs.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRebuildTabs.kt new file mode 100644 index 0000000000..6820eaafae --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRebuildTabs.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventRebuildTabs(var recreate: Boolean = false) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRefreshButtonState.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRefreshButtonState.kt new file mode 100644 index 0000000000..095d0ad0c3 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRefreshButtonState.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventRefreshButtonState(val newState: Boolean) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRefreshOverview.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRefreshOverview.kt new file mode 100644 index 0000000000..d7bd44013f --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventRefreshOverview.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventRefreshOverview(var from: String, val now: Boolean = false) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventSWRLStatus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWRLStatus.kt similarity index 83% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventSWRLStatus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWRLStatus.kt index b6edc03f23..47ae069b6e 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventSWRLStatus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWRLStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events import android.content.Context diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventSWSyncStatus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWSyncStatus.kt similarity index 83% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventSWSyncStatus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWSyncStatus.kt index ed48813a8d..d9fdc58671 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventSWSyncStatus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWSyncStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events import android.content.Context diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventSWUpdate.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWUpdate.kt similarity index 57% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventSWUpdate.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWUpdate.kt index 6ea5119760..1172c75b25 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventSWUpdate.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventSWUpdate.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventSWUpdate(var redraw: Boolean) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventScale.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventScale.kt similarity index 53% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventScale.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventScale.kt index 225243e7c8..39dbe77aee 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventScale.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventScale.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventScale(val hours: Int) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventStatus.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventStatus.kt similarity index 53% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventStatus.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventStatus.kt index 81cd0ffb48..a00de1ad3c 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventStatus.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventStatus.kt @@ -1,8 +1,9 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events import android.content.Context // pass string to startup wizard abstract class EventStatus : Event() { - abstract fun getStatus(context: Context) : String + + abstract fun getStatus(context: Context): String } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventTempBasalChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTempBasalChange.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventTempBasalChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTempBasalChange.kt index d6871ddc97..9e9891e60f 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventTempBasalChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTempBasalChange.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventTempBasalChange : EventLoop() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventTempTargetChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTempTargetChange.kt similarity index 50% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventTempTargetChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTempTargetChange.kt index fd1409591a..7238afce9b 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventTempTargetChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTempTargetChange.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventTempTargetChange : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventThemeSwitch.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventThemeSwitch.kt new file mode 100644 index 0000000000..508c67cb9d --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventThemeSwitch.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.rx.events + +class EventThemeSwitch : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventTherapyEventChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTherapyEventChange.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventTherapyEventChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTherapyEventChange.kt index e0b00c5d0f..b3fb0dbe20 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventTherapyEventChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTherapyEventChange.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventTherapyEventChange : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventTreatmentChange.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTreatmentChange.kt similarity index 51% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventTreatmentChange.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTreatmentChange.kt index 01ac125d0b..131e2d1544 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventTreatmentChange.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventTreatmentChange.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventTreatmentChange : EventLoop() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateGui.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateGui.kt similarity index 74% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateGui.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateGui.kt index 026a3e701f..87700124e2 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateGui.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateGui.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events /** Base class for events to update the UI, mostly a specific tab. */ abstract class EventUpdateGui : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewCalcProgress.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewCalcProgress.kt similarity index 63% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewCalcProgress.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewCalcProgress.kt index d1a2767701..5d4e89ddb3 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewCalcProgress.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewCalcProgress.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventUpdateOverviewCalcProgress(val from: String) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewGraph.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewGraph.kt similarity index 60% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewGraph.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewGraph.kt index 93b77e2a93..4db2507aeb 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewGraph.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewGraph.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventUpdateOverviewGraph(val from: String) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewIobCob.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewIobCob.kt similarity index 61% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewIobCob.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewIobCob.kt index d5ec8b197f..e4d4431d35 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewIobCob.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewIobCob.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventUpdateOverviewIobCob(val from: String) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewSensitivity.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewSensitivity.kt similarity index 63% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewSensitivity.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewSensitivity.kt index 16da11f566..a04a44c342 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventUpdateOverviewSensitivity.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventUpdateOverviewSensitivity.kt @@ -1,3 +1,3 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events class EventUpdateOverviewSensitivity(val from: String) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearCwfExported.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearCwfExported.kt new file mode 100644 index 0000000000..16d77d126e --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearCwfExported.kt @@ -0,0 +1,5 @@ +package app.aaps.interfaces.rx.events + +import app.aaps.interfaces.rx.weardata.EventData + +class EventWearCwfExported(val payload: EventData.ActionSetCustomWatchface) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearDataToMobile.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearDataToMobile.kt new file mode 100644 index 0000000000..a58b64f685 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearDataToMobile.kt @@ -0,0 +1,5 @@ +package app.aaps.interfaces.rx.events + +import app.aaps.interfaces.rx.weardata.EventData + +class EventWearDataToMobile(val payload: EventData) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearToMobile.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearToMobile.kt new file mode 100644 index 0000000000..969b86c514 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearToMobile.kt @@ -0,0 +1,5 @@ +package app.aaps.interfaces.rx.events + +import app.aaps.interfaces.rx.weardata.EventData + +class EventWearToMobile(val payload: EventData) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearUpdateGui.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearUpdateGui.kt similarity index 56% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventWearUpdateGui.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearUpdateGui.kt index 3845facd4d..7ada7af398 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventWearUpdateGui.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventWearUpdateGui.kt @@ -1,5 +1,5 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events -import info.nightscout.rx.weardata.CwfData +import app.aaps.interfaces.rx.weardata.CwfData class EventWearUpdateGui(val customWatchfaceData: CwfData? = null, val exportFile: Boolean = false) : Event() \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/rx/events/EventXdripNewLog.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventXdripNewLog.kt similarity index 94% rename from core/interfaces/src/main/java/info/nightscout/rx/events/EventXdripNewLog.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventXdripNewLog.kt index 933db28162..0da18f5a90 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/events/EventXdripNewLog.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/events/EventXdripNewLog.kt @@ -1,9 +1,10 @@ -package info.nightscout.rx.events +package app.aaps.interfaces.rx.events import java.text.SimpleDateFormat import java.util.Locale class EventXdripNewLog(val action: String, val logText: String?) : Event() { + var date = System.currentTimeMillis() private var timeFormat = SimpleDateFormat("HH:mm:ss", Locale.getDefault()) diff --git a/core/interfaces/src/main/java/info/nightscout/rx/weardata/CustomWatchfaceFormat.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/weardata/CustomWatchfaceFormat.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/rx/weardata/CustomWatchfaceFormat.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/weardata/CustomWatchfaceFormat.kt index b6a8431dfd..5d05fcbd82 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/weardata/CustomWatchfaceFormat.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/weardata/CustomWatchfaceFormat.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.weardata +package app.aaps.interfaces.rx.weardata import android.content.res.Resources import android.graphics.BitmapFactory @@ -7,8 +7,8 @@ import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable import android.graphics.drawable.PictureDrawable import androidx.annotation.StringRes +import app.aaps.interfaces.R import com.caverock.androidsvg.SVG -import info.nightscout.interfaces.R import kotlinx.serialization.Serializable import org.json.JSONObject import java.io.BufferedOutputStream @@ -121,7 +121,7 @@ data class ResData(val value: ByteArray, val format: ResFormat) { } } - else -> { + else -> { null } @@ -197,7 +197,7 @@ enum class ViewKeys(val key: String, @StringRes val comment: Int) { TIMEPERIOD("timePeriod", R.string.cwf_comment_timePeriod), DAY_NAME("day_name", R.string.cwf_comment_day_name), DAY("day", R.string.cwf_comment_day), - WEEKNUMBER("week_number",R.string.cwf_comment_week_number), + WEEKNUMBER("week_number", R.string.cwf_comment_week_number), MONTH("month", R.string.cwf_comment_month), LOOP("loop", R.string.cwf_comment_loop), DIRECTION("direction", R.string.cwf_comment_direction), diff --git a/core/interfaces/src/main/java/info/nightscout/rx/weardata/EventData.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/weardata/EventData.kt similarity index 99% rename from core/interfaces/src/main/java/info/nightscout/rx/weardata/EventData.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/weardata/EventData.kt index b7b09742e9..9b1799afb4 100644 --- a/core/interfaces/src/main/java/info/nightscout/rx/weardata/EventData.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/rx/weardata/EventData.kt @@ -1,6 +1,6 @@ -package info.nightscout.rx.weardata +package app.aaps.interfaces.rx.weardata -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.Serializable import kotlinx.serialization.json.Json diff --git a/core/interfaces/src/main/java/info/nightscout/shared/sharedPreferences/SP.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sharedPreferences/SP.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/shared/sharedPreferences/SP.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/sharedPreferences/SP.kt index 5c3a36d101..2053506be3 100644 --- a/core/interfaces/src/main/java/info/nightscout/shared/sharedPreferences/SP.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sharedPreferences/SP.kt @@ -1,4 +1,4 @@ -package info.nightscout.shared.sharedPreferences +package app.aaps.interfaces.sharedPreferences import androidx.annotation.StringRes @@ -7,12 +7,14 @@ import androidx.annotation.StringRes */ interface SP { + // Using a helper Editor interface to distinguish its // methods from SP's. The latter always run apply(). // The whole point of the edit() function below is to // _avoid_ unnecessary apply() / commit() calls, so // we cannot use SP's put* methods in edit(). interface Editor { + fun clear() fun remove(@StringRes resourceID: Int) diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/smoothing/Smoothing.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/smoothing/Smoothing.kt similarity index 67% rename from core/interfaces/src/main/java/info/nightscout/interfaces/smoothing/Smoothing.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/smoothing/Smoothing.kt index 752f64bbda..2740c6a343 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/smoothing/Smoothing.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/smoothing/Smoothing.kt @@ -1,6 +1,6 @@ -package info.nightscout.interfaces.smoothing +package app.aaps.interfaces.smoothing -import info.nightscout.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.InMemoryGlucoseValue interface Smoothing { @@ -8,7 +8,6 @@ interface Smoothing { * Smooth values in List * * @param data input glucose values ([0] to be the most recent one) - * @param updateWindow amount of values to the past to smooth * * @return new List with smoothed values (smoothed values are stored in [InMemoryGlucoseValue.smoothed]) */ diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/Sms.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/smsCommunicator/Sms.kt similarity index 95% rename from core/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/Sms.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/smsCommunicator/Sms.kt index 2224347a93..a83667a14a 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/Sms.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/smsCommunicator/Sms.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.smsCommunicator +package app.aaps.interfaces.smsCommunicator import android.telephony.SmsMessage diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/SmsCommunicator.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/smsCommunicator/SmsCommunicator.kt similarity index 78% rename from core/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/SmsCommunicator.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/smsCommunicator/SmsCommunicator.kt index ae5484cf6d..e3e3e40f07 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/SmsCommunicator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/smsCommunicator/SmsCommunicator.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.smsCommunicator +package app.aaps.interfaces.smsCommunicator interface SmsCommunicator { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/source/BgSource.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/source/BgSource.kt similarity index 89% rename from core/interfaces/src/main/java/info/nightscout/interfaces/source/BgSource.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/source/BgSource.kt index 5cf2991dec..537590b530 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/source/BgSource.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/source/BgSource.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.source +package app.aaps.interfaces.source interface BgSource { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/source/DexcomBoyda.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/source/DexcomBoyda.kt similarity index 76% rename from core/interfaces/src/main/java/info/nightscout/interfaces/source/DexcomBoyda.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/source/DexcomBoyda.kt index 0b4c4cb0bc..d6ba02cc35 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/source/DexcomBoyda.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/source/DexcomBoyda.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.source +package app.aaps.interfaces.source interface DexcomBoyda { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/source/NSClientSource.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/source/NSClientSource.kt similarity index 79% rename from core/interfaces/src/main/java/info/nightscout/interfaces/source/NSClientSource.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/source/NSClientSource.kt index 2dd00bfc28..ef2ad1a350 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/source/NSClientSource.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/source/NSClientSource.kt @@ -1,8 +1,9 @@ -package info.nightscout.interfaces.source +package app.aaps.interfaces.source import info.nightscout.database.entities.GlucoseValue interface NSClientSource { + fun isEnabled(): Boolean fun detectSource(glucoseValue: GlucoseValue) } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/source/XDripSource.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/source/XDripSource.kt similarity index 56% rename from core/interfaces/src/main/java/info/nightscout/interfaces/source/XDripSource.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/source/XDripSource.kt index 121f67e2cd..ad7ba2c6c4 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/source/XDripSource.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/source/XDripSource.kt @@ -1,5 +1,6 @@ -package info.nightscout.interfaces.source +package app.aaps.interfaces.source interface XDripSource { + fun isEnabled(): Boolean } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/DexcomTIR.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/DexcomTIR.kt similarity index 82% rename from core/interfaces/src/main/java/info/nightscout/interfaces/stats/DexcomTIR.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/DexcomTIR.kt index 090f8c5d8b..f7ea5c4cf7 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/DexcomTIR.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/DexcomTIR.kt @@ -1,9 +1,9 @@ -package info.nightscout.interfaces.stats +package app.aaps.interfaces.stats import android.content.Context import android.widget.TableRow import android.widget.TextView -import info.nightscout.shared.interfaces.ProfileUtil +import app.aaps.interfaces.profile.ProfileUtil interface DexcomTIR { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/DexcomTirCalculator.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/DexcomTirCalculator.kt similarity index 81% rename from core/interfaces/src/main/java/info/nightscout/interfaces/stats/DexcomTirCalculator.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/DexcomTirCalculator.kt index bdc1e927a7..10ce0ab532 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/DexcomTirCalculator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/DexcomTirCalculator.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.stats +package app.aaps.interfaces.stats import android.content.Context import android.widget.TableLayout diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/TIR.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TIR.kt similarity index 77% rename from core/interfaces/src/main/java/info/nightscout/interfaces/stats/TIR.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TIR.kt index 1c3ff9a916..e2cd79019f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/TIR.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TIR.kt @@ -1,9 +1,9 @@ -package info.nightscout.interfaces.stats +package app.aaps.interfaces.stats import android.content.Context import android.widget.TableRow -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil interface TIR { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/TddCalculator.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TddCalculator.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/interfaces/stats/TddCalculator.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TddCalculator.kt index 0b9c56ab39..b13bfe190d 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/TddCalculator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TddCalculator.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.stats +package app.aaps.interfaces.stats import android.content.Context import android.util.LongSparseArray diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/TirCalculator.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TirCalculator.kt similarity index 86% rename from core/interfaces/src/main/java/info/nightscout/interfaces/stats/TirCalculator.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TirCalculator.kt index a4561265f8..825d9a72a2 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/stats/TirCalculator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/stats/TirCalculator.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.stats +package app.aaps.interfaces.stats import android.content.Context import android.util.LongSparseArray diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/storage/Storage.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/storage/Storage.kt similarity index 83% rename from core/interfaces/src/main/java/info/nightscout/interfaces/storage/Storage.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/storage/Storage.kt index 7f6a31d009..bb6d9d6df4 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/storage/Storage.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/storage/Storage.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.storage +package app.aaps.interfaces.storage import java.io.File diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/DataSyncSelector.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/DataSyncSelector.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/interfaces/sync/DataSyncSelector.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/DataSyncSelector.kt index 8fc30f615b..868fbf8fb1 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/DataSyncSelector.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/DataSyncSelector.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.sync +package app.aaps.interfaces.sync import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/DataSyncSelectorXdrip.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/DataSyncSelectorXdrip.kt similarity index 56% rename from core/interfaces/src/main/java/info/nightscout/interfaces/sync/DataSyncSelectorXdrip.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/DataSyncSelectorXdrip.kt index f25fd61207..595cfc84bc 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/DataSyncSelectorXdrip.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/DataSyncSelectorXdrip.kt @@ -1,3 +1,3 @@ -package info.nightscout.interfaces.sync +package app.aaps.interfaces.sync interface DataSyncSelectorXdrip : DataSyncSelector \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/NsClient.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/NsClient.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/interfaces/sync/NsClient.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/NsClient.kt index 917bc5b8a3..328ffdc7a2 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/NsClient.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/NsClient.kt @@ -1,8 +1,8 @@ -package info.nightscout.interfaces.sync +package app.aaps.interfaces.sync -import info.nightscout.interfaces.nsclient.NSAlarm -import info.nightscout.interfaces.profile.Profile -import info.nightscout.rx.events.EventNSClientNewLog +import app.aaps.interfaces.nsclient.NSAlarm +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.rx.events.EventNSClientNewLog /** * Plugin providing communication with Nightscout server diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/Sync.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/Sync.kt similarity index 72% rename from core/interfaces/src/main/java/info/nightscout/interfaces/sync/Sync.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/Sync.kt index c98703081e..7c9ab911cf 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/sync/Sync.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/Sync.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.sync +package app.aaps.interfaces.sync interface Sync { diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/Tidepool.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/Tidepool.kt new file mode 100644 index 0000000000..8a062342da --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/Tidepool.kt @@ -0,0 +1,3 @@ +package app.aaps.interfaces.sync + +interface Tidepool : Sync \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/XDripBroadcast.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/XDripBroadcast.kt similarity index 75% rename from core/interfaces/src/main/java/info/nightscout/interfaces/XDripBroadcast.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/XDripBroadcast.kt index 33d5e16aeb..89cdd9580f 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/XDripBroadcast.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/sync/XDripBroadcast.kt @@ -1,6 +1,4 @@ -package info.nightscout.interfaces - -import info.nightscout.interfaces.sync.DataSyncSelector +package app.aaps.interfaces.sync /** * Send data to xDrip+ via Inter-app settings @@ -25,6 +23,8 @@ interface XDripBroadcast { * * Accepting must be enabled in Inter-app settings - Accept Glucose/Treatments */ - fun sendToXdrip(collection: String, dataPairs: List, progress: - String) + fun sendToXdrip( + collection: String, dataPairs: List, progress: + String + ) } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/ui/IconsProvider.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/ui/IconsProvider.kt similarity index 69% rename from core/interfaces/src/main/java/info/nightscout/interfaces/ui/IconsProvider.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/ui/IconsProvider.kt index 552bc18253..5c0e0fa40d 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/ui/IconsProvider.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/ui/IconsProvider.kt @@ -1,6 +1,7 @@ -package info.nightscout.interfaces.ui +package app.aaps.interfaces.ui interface IconsProvider { + fun getIcon(): Int fun getNotificationIcon(): Int } \ No newline at end of file diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/ui/UiInteraction.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/ui/UiInteraction.kt similarity index 93% rename from core/interfaces/src/main/java/info/nightscout/interfaces/ui/UiInteraction.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/ui/UiInteraction.kt index 4cfd0dfad8..bd6c4411ba 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/ui/UiInteraction.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/ui/UiInteraction.kt @@ -1,11 +1,11 @@ -package info.nightscout.interfaces.ui +package app.aaps.interfaces.ui import android.content.Context import androidx.annotation.RawRes import androidx.annotation.StringRes import androidx.fragment.app.FragmentManager +import app.aaps.interfaces.nsclient.NSAlarm import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.nsclient.NSAlarm /** * Interface to use activities located in different modules @@ -24,6 +24,7 @@ interface UiInteraction { val quickWizardListActivity: Class<*> val prefGeneral: Int + /** * Show ErrorHelperActivity and start alarm * @param ctx Context @@ -53,7 +54,8 @@ interface UiInteraction { DB_PROFILE(3), PROFILE_COMPARE(4) } - fun runProfileViewerDialog(fragmentManager: FragmentManager, time: Long, mode: Mode, customProfile: String?= null, customProfileName: String? = null, customProfile2: String? = null) + + fun runProfileViewerDialog(fragmentManager: FragmentManager, time: Long, mode: Mode, customProfile: String? = null, customProfileName: String? = null, customProfile2: String? = null) enum class EventType { BGCHECK, SENSOR_INSERT, diff --git a/core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/UserEntryMapper.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/UserEntryMapper.kt new file mode 100644 index 0000000000..c7a51135c0 --- /dev/null +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/UserEntryMapper.kt @@ -0,0 +1,156 @@ +package app.aaps.interfaces.userEntry + +import info.nightscout.database.entities.UserEntry + +class UserEntryMapper { + enum class Action(val db: UserEntry.Action) { + BOLUS(UserEntry.Action.BOLUS), + SMB(UserEntry.Action.SMB), + BOLUS_ADVISOR(UserEntry.Action.BOLUS_ADVISOR), + EXTENDED_BOLUS(UserEntry.Action.EXTENDED_BOLUS), + SUPERBOLUS_TBR(UserEntry.Action.SUPERBOLUS_TBR), + CARBS(UserEntry.Action.CARBS), + EXTENDED_CARBS(UserEntry.Action.EXTENDED_CARBS), + TEMP_BASAL(UserEntry.Action.TEMP_BASAL), + TT(UserEntry.Action.TT), + NEW_PROFILE(UserEntry.Action.NEW_PROFILE), + CLONE_PROFILE(UserEntry.Action.CLONE_PROFILE), + STORE_PROFILE(UserEntry.Action.STORE_PROFILE), + PROFILE_SWITCH(UserEntry.Action.PROFILE_SWITCH), + PROFILE_SWITCH_CLONED(UserEntry.Action.PROFILE_SWITCH_CLONED), + CLOSED_LOOP_MODE(UserEntry.Action.CLOSED_LOOP_MODE), + LGS_LOOP_MODE(UserEntry.Action.LGS_LOOP_MODE), + OPEN_LOOP_MODE(UserEntry.Action.OPEN_LOOP_MODE), + LOOP_DISABLED(UserEntry.Action.LOOP_DISABLED), + LOOP_ENABLED(UserEntry.Action.LOOP_ENABLED), + RECONNECT(UserEntry.Action.RECONNECT), + DISCONNECT(UserEntry.Action.DISCONNECT), + RESUME(UserEntry.Action.RESUME), + SUSPEND(UserEntry.Action.SUSPEND), + HW_PUMP_ALLOWED(UserEntry.Action.HW_PUMP_ALLOWED), + CLEAR_PAIRING_KEYS(UserEntry.Action.CLEAR_PAIRING_KEYS), + ACCEPTS_TEMP_BASAL(UserEntry.Action.ACCEPTS_TEMP_BASAL), + CANCEL_TEMP_BASAL(UserEntry.Action.CANCEL_TEMP_BASAL), + CANCEL_BOLUS(UserEntry.Action.CANCEL_BOLUS), + CANCEL_EXTENDED_BOLUS(UserEntry.Action.CANCEL_EXTENDED_BOLUS), + CANCEL_TT(UserEntry.Action.CANCEL_TT), + CAREPORTAL(UserEntry.Action.CAREPORTAL), + SITE_CHANGE(UserEntry.Action.SITE_CHANGE), + RESERVOIR_CHANGE(UserEntry.Action.RESERVOIR_CHANGE), + CALIBRATION(UserEntry.Action.CALIBRATION), + PRIME_BOLUS(UserEntry.Action.PRIME_BOLUS), + TREATMENT(UserEntry.Action.TREATMENT), + CAREPORTAL_NS_REFRESH(UserEntry.Action.CAREPORTAL_NS_REFRESH), + PROFILE_SWITCH_NS_REFRESH(UserEntry.Action.PROFILE_SWITCH_NS_REFRESH), + TREATMENTS_NS_REFRESH(UserEntry.Action.TREATMENTS_NS_REFRESH), + TT_NS_REFRESH(UserEntry.Action.TT_NS_REFRESH), + AUTOMATION_REMOVED(UserEntry.Action.AUTOMATION_REMOVED), + BG_REMOVED(UserEntry.Action.BG_REMOVED), + CAREPORTAL_REMOVED(UserEntry.Action.CAREPORTAL_REMOVED), + EXTENDED_BOLUS_REMOVED(UserEntry.Action.EXTENDED_BOLUS_REMOVED), + FOOD_REMOVED(UserEntry.Action.FOOD_REMOVED), + PROFILE_REMOVED(UserEntry.Action.PROFILE_REMOVED), + PROFILE_SWITCH_REMOVED(UserEntry.Action.PROFILE_SWITCH_REMOVED), + RESTART_EVENTS_REMOVED(UserEntry.Action.RESTART_EVENTS_REMOVED), + TREATMENT_REMOVED(UserEntry.Action.TREATMENT_REMOVED), + BOLUS_REMOVED(UserEntry.Action.BOLUS_REMOVED), + CARBS_REMOVED(UserEntry.Action.CARBS_REMOVED), + TEMP_BASAL_REMOVED(UserEntry.Action.TEMP_BASAL_REMOVED), + TT_REMOVED(UserEntry.Action.TT_REMOVED), + NS_PAUSED(UserEntry.Action.NS_PAUSED), + NS_RESUME(UserEntry.Action.NS_RESUME), + NS_QUEUE_CLEARED(UserEntry.Action.NS_QUEUE_CLEARED), + NS_SETTINGS_COPIED(UserEntry.Action.NS_SETTINGS_COPIED), + ERROR_DIALOG_OK(UserEntry.Action.ERROR_DIALOG_OK), + ERROR_DIALOG_MUTE(UserEntry.Action.ERROR_DIALOG_MUTE), + ERROR_DIALOG_MUTE_5MIN(UserEntry.Action.ERROR_DIALOG_MUTE_5MIN), + OBJECTIVE_STARTED(UserEntry.Action.OBJECTIVE_STARTED), + OBJECTIVE_UNSTARTED(UserEntry.Action.OBJECTIVE_UNSTARTED), + OBJECTIVES_SKIPPED(UserEntry.Action.OBJECTIVES_SKIPPED), + STAT_RESET(UserEntry.Action.STAT_RESET), + DELETE_LOGS(UserEntry.Action.DELETE_LOGS), + DELETE_FUTURE_TREATMENTS(UserEntry.Action.DELETE_FUTURE_TREATMENTS), + EXPORT_SETTINGS(UserEntry.Action.EXPORT_SETTINGS), + IMPORT_SETTINGS(UserEntry.Action.IMPORT_SETTINGS), + RESET_DATABASES(UserEntry.Action.RESET_DATABASES), + EXPORT_DATABASES(UserEntry.Action.EXPORT_DATABASES), + IMPORT_DATABASES(UserEntry.Action.IMPORT_DATABASES), + OTP_EXPORT(UserEntry.Action.OTP_EXPORT), + OTP_RESET(UserEntry.Action.OTP_RESET), + STOP_SMS(UserEntry.Action.STOP_SMS), + FOOD(UserEntry.Action.FOOD), + EXPORT_CSV(UserEntry.Action.EXPORT_CSV), + START_AAPS(UserEntry.Action.START_AAPS), + EXIT_AAPS(UserEntry.Action.EXIT_AAPS), + UNKNOWN(UserEntry.Action.UNKNOWN) + ; + } + + enum class Sources(val db: UserEntry.Sources) { + TreatmentDialog(UserEntry.Sources.TreatmentDialog), + InsulinDialog(UserEntry.Sources.InsulinDialog), + CarbDialog(UserEntry.Sources.CarbDialog), + WizardDialog(UserEntry.Sources.WizardDialog), + QuickWizard(UserEntry.Sources.QuickWizard), + ExtendedBolusDialog(UserEntry.Sources.ExtendedBolusDialog), + TTDialog(UserEntry.Sources.TTDialog), + ProfileSwitchDialog(UserEntry.Sources.ProfileSwitchDialog), + LoopDialog(UserEntry.Sources.LoopDialog), + TempBasalDialog(UserEntry.Sources.TempBasalDialog), + CalibrationDialog(UserEntry.Sources.CalibrationDialog), + FillDialog(UserEntry.Sources.FillDialog), + BgCheck(UserEntry.Sources.BgCheck), + SensorInsert(UserEntry.Sources.SensorInsert), + BatteryChange(UserEntry.Sources.BatteryChange), + Note(UserEntry.Sources.Note), + Exercise(UserEntry.Sources.Exercise), + Question(UserEntry.Sources.Question), + Announcement(UserEntry.Sources.Announcement), + Actions(UserEntry.Sources.Actions), + Automation(UserEntry.Sources.Automation), + Autotune(UserEntry.Sources.Autotune), + BG(UserEntry.Sources.BG), + Aidex(UserEntry.Sources.Aidex), + Dexcom(UserEntry.Sources.Dexcom), + Eversense(UserEntry.Sources.Eversense), + Glimp(UserEntry.Sources.Glimp), + MM640g(UserEntry.Sources.MM640g), + NSClientSource(UserEntry.Sources.BG), + PocTech(UserEntry.Sources.PocTech), + Tomato(UserEntry.Sources.Tomato), + Xdrip(UserEntry.Sources.Xdrip), + LocalProfile(UserEntry.Sources.LocalProfile), + Loop(UserEntry.Sources.Loop), + Maintenance(UserEntry.Sources.Maintenance), + NSClient(UserEntry.Sources.NSClient), + NSProfile(UserEntry.Sources.NSProfile), + Objectives(UserEntry.Sources.Objectives), + Pump(UserEntry.Sources.Pump), + Dana(UserEntry.Sources.Dana), + DanaR(UserEntry.Sources.DanaR), + DanaRC(UserEntry.Sources.DanaRC), + DanaRv2(UserEntry.Sources.DanaRv2), + DanaRS(UserEntry.Sources.DanaRS), + DanaI(UserEntry.Sources.DanaI), + DiaconnG8(UserEntry.Sources.DiaconnG8), + Insight(UserEntry.Sources.Insight), + Combo(UserEntry.Sources.Combo), + Medtronic(UserEntry.Sources.Medtronic), + Omnipod(UserEntry.Sources.Omnipod), + OmnipodEros(UserEntry.Sources.OmnipodEros), + OmnipodDash(UserEntry.Sources.OmnipodDash), + EOPatch2(UserEntry.Sources.EOPatch2), + MDI(UserEntry.Sources.MDI), + VirtualPump(UserEntry.Sources.VirtualPump), + SMS(UserEntry.Sources.SMS), + Treatments(UserEntry.Sources.Treatments), + Wear(UserEntry.Sources.Wear), + Food(UserEntry.Sources.Food), + ConfigBuilder(UserEntry.Sources.ConfigBuilder), + Overview(UserEntry.Sources.Overview), + Stats(UserEntry.Sources.Stats), + Aaps(UserEntry.Sources.Aaps), + Unknown(UserEntry.Sources.Unknown) + ; + } +} diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryPresentationHelper.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/UserEntryPresentationHelper.kt similarity index 94% rename from core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryPresentationHelper.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/UserEntryPresentationHelper.kt index 720e9d4e8d..c37b67e98b 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/UserEntryPresentationHelper.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/UserEntryPresentationHelper.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.userEntry +package app.aaps.interfaces.userEntry import android.text.Spanned import androidx.annotation.ColorRes diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/ValueWithUnitMapper.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/ValueWithUnitMapper.kt similarity index 94% rename from core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/ValueWithUnitMapper.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/ValueWithUnitMapper.kt index 964c59e550..77b7c08479 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/userEntry/ValueWithUnitMapper.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/userEntry/ValueWithUnitMapper.kt @@ -1,10 +1,9 @@ -package info.nightscout.interfaces.userEntry +package app.aaps.interfaces.userEntry +import app.aaps.interfaces.db.GlucoseUnit import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit sealed class ValueWithUnitMapper { //I use a sealed class because of StringResource that contains a listOf as second parameter @@ -39,7 +38,7 @@ sealed class ValueWithUnitMapper { //I use a sealed class because of St data class TherapyEventTTReason(val value: TemporaryTarget.Reason) : ValueWithUnitMapper() fun db(): ValueWithUnit? { - return when(this) { + return when (this) { is Gram -> ValueWithUnit.Gram(this.value) is Hour -> ValueWithUnit.Hour(this.value) is Insulin -> ValueWithUnit.Insulin(this.value) @@ -59,7 +58,7 @@ sealed class ValueWithUnitMapper { //I use a sealed class because of St } fun value(): Any? { - return when(this) { + return when (this) { is Gram -> this.value is Hour -> this.value is Insulin -> this.value @@ -83,7 +82,7 @@ sealed class ValueWithUnitMapper { //I use a sealed class because of St fun fromGlucoseUnit(value: Double, string: String): ValueWithUnitMapper? = when (string) { GlucoseUnit.MGDL.asText, "mgdl" -> Mgdl(value) GlucoseUnit.MMOL.asText, "mmol/l" -> Mmoll(value) - else -> null + else -> null } } } diff --git a/core/interfaces/src/main/java/info/nightscout/shared/utils/DateUtil.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/DateUtil.kt similarity index 97% rename from core/interfaces/src/main/java/info/nightscout/shared/utils/DateUtil.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/DateUtil.kt index 41afa1adb2..97b182b3d0 100644 --- a/core/interfaces/src/main/java/info/nightscout/shared/utils/DateUtil.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/DateUtil.kt @@ -1,8 +1,8 @@ -package info.nightscout.shared.utils +package app.aaps.interfaces.utils import android.os.Build import androidx.annotation.RequiresApi -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.resources.ResourceHelper import java.util.TimeZone import java.util.concurrent.TimeUnit diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/DecimalFormatter.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/DecimalFormatter.kt similarity index 94% rename from core/interfaces/src/main/java/info/nightscout/interfaces/utils/DecimalFormatter.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/DecimalFormatter.kt index 241492911e..e1befef3ca 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/DecimalFormatter.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/DecimalFormatter.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.utils +package app.aaps.interfaces.utils import java.text.DecimalFormat diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/HardLimits.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/HardLimits.kt similarity index 97% rename from core/interfaces/src/main/java/info/nightscout/interfaces/utils/HardLimits.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/HardLimits.kt index b957d08f9d..ab7052c0d6 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/HardLimits.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/HardLimits.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.utils +package app.aaps.interfaces.utils interface HardLimits { companion object { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/MidnightTime.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/MidnightTime.kt similarity index 97% rename from core/interfaces/src/main/java/info/nightscout/interfaces/utils/MidnightTime.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/MidnightTime.kt index 2d7ea84f2f..9c545258f5 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/MidnightTime.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/MidnightTime.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.utils +package app.aaps.interfaces.utils import android.util.LongSparseArray import java.util.Calendar diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/Round.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/Round.kt similarity index 95% rename from core/interfaces/src/main/java/info/nightscout/interfaces/utils/Round.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/Round.kt index 10a7a96c25..f2c5d9c12a 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/Round.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/Round.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.utils +package app.aaps.interfaces.utils import java.math.BigDecimal import java.security.InvalidParameterException diff --git a/core/interfaces/src/main/java/info/nightscout/shared/SafeParse.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/SafeParse.kt similarity index 98% rename from core/interfaces/src/main/java/info/nightscout/shared/SafeParse.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/SafeParse.kt index c11631c338..f35d377e01 100644 --- a/core/interfaces/src/main/java/info/nightscout/shared/SafeParse.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/SafeParse.kt @@ -1,4 +1,4 @@ -package info.nightscout.shared +package app.aaps.interfaces.utils object SafeParse { diff --git a/core/interfaces/src/main/java/info/nightscout/shared/utils/T.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/T.kt similarity index 95% rename from core/interfaces/src/main/java/info/nightscout/shared/utils/T.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/T.kt index d2dbe761f3..384e60b429 100644 --- a/core/interfaces/src/main/java/info/nightscout/shared/utils/T.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/T.kt @@ -1,4 +1,4 @@ -package info.nightscout.shared.utils +package app.aaps.interfaces.utils @Suppress("SpellCheckingInspection") class T(val time: Long = 0L) { diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/TimeChangeType.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/TimeChangeType.kt similarity index 67% rename from core/interfaces/src/main/java/info/nightscout/interfaces/utils/TimeChangeType.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/TimeChangeType.kt index a50a8686ca..1db1638bf6 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/TimeChangeType.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/TimeChangeType.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.utils +package app.aaps.interfaces.utils enum class TimeChangeType { TimezoneChanged, DSTStarted, DSTEnded, TimeChanged diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/Translator.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/Translator.kt similarity index 95% rename from core/interfaces/src/main/java/info/nightscout/interfaces/Translator.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/Translator.kt index 01616b5a70..205d50d9fd 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/Translator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/Translator.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package app.aaps.interfaces.utils import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.TemporaryTarget diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/TrendCalculator.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/TrendCalculator.kt similarity index 89% rename from core/interfaces/src/main/java/info/nightscout/interfaces/utils/TrendCalculator.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/TrendCalculator.kt index 13e753b8af..5b7d10520c 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/utils/TrendCalculator.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/utils/TrendCalculator.kt @@ -1,8 +1,8 @@ -package info.nightscout.interfaces.utils +package app.aaps.interfaces.utils +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.iob.InMemoryGlucoseValue import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.iob.InMemoryGlucoseValue /** * Convert BG direction value to trend arrow or calculate it if not provided @@ -17,6 +17,7 @@ interface TrendCalculator { * @return TrendArrow */ fun getTrendArrow(glucoseValue: GlucoseValue?): GlucoseValue.TrendArrow + /** * Provide or calculate trend * @@ -24,6 +25,7 @@ interface TrendCalculator { * @return TrendArrow */ fun getTrendArrow(glucoseValue: InMemoryGlucoseValue?): GlucoseValue.TrendArrow + /** * Provide or calculate trend from newest bucketed data * @@ -39,6 +41,7 @@ interface TrendCalculator { * @return string description of TrendArrow */ fun getTrendDescription(glucoseValue: GlucoseValue?): String + /** * Provide or calculate trend from newest bucketed data * diff --git a/core/interfaces/src/main/java/info/nightscout/interfaces/versionChecker/VersionCheckerUtils.kt b/core/interfaces/src/main/kotlin/app/aaps/interfaces/versionChecker/VersionCheckerUtils.kt similarity index 83% rename from core/interfaces/src/main/java/info/nightscout/interfaces/versionChecker/VersionCheckerUtils.kt rename to core/interfaces/src/main/kotlin/app/aaps/interfaces/versionChecker/VersionCheckerUtils.kt index 106ef9e9bd..aa645a6b8c 100644 --- a/core/interfaces/src/main/java/info/nightscout/interfaces/versionChecker/VersionCheckerUtils.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/interfaces/versionChecker/VersionCheckerUtils.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.versionChecker +package app.aaps.interfaces.versionChecker interface VersionCheckerUtils { diff --git a/core/interfaces/src/release/java/app/aaps/annotations/OpenForTesting.kt b/core/interfaces/src/release/kotlin/app/aaps/annotations/OpenForTesting.kt similarity index 100% rename from core/interfaces/src/release/java/app/aaps/annotations/OpenForTesting.kt rename to core/interfaces/src/release/kotlin/app/aaps/annotations/OpenForTesting.kt diff --git a/core/interfaces/src/test/java/info/nightscout/rx/RxSchedulerRule.kt b/core/interfaces/src/test/kotlin/app/aaps/interfaces/rx/RxSchedulerRule.kt similarity index 97% rename from core/interfaces/src/test/java/info/nightscout/rx/RxSchedulerRule.kt rename to core/interfaces/src/test/kotlin/app/aaps/interfaces/rx/RxSchedulerRule.kt index 1e10a5e6f7..613d486760 100644 --- a/core/interfaces/src/test/java/info/nightscout/rx/RxSchedulerRule.kt +++ b/core/interfaces/src/test/kotlin/app/aaps/interfaces/rx/RxSchedulerRule.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx +package app.aaps.interfaces.rx import io.reactivex.rxjava3.android.plugins.RxAndroidPlugins import io.reactivex.rxjava3.core.Scheduler diff --git a/core/interfaces/src/test/java/info/nightscout/rx/weardata/EventDataTest.kt b/core/interfaces/src/test/kotlin/app/aaps/interfaces/rx/weardata/EventDataTest.kt similarity index 99% rename from core/interfaces/src/test/java/info/nightscout/rx/weardata/EventDataTest.kt rename to core/interfaces/src/test/kotlin/app/aaps/interfaces/rx/weardata/EventDataTest.kt index 25198a8e2c..a9b26d8607 100644 --- a/core/interfaces/src/test/java/info/nightscout/rx/weardata/EventDataTest.kt +++ b/core/interfaces/src/test/kotlin/app/aaps/interfaces/rx/weardata/EventDataTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.rx.weardata +package app.aaps.interfaces.rx.weardata import com.google.common.truth.Truth.assertThat import kotlinx.serialization.ExperimentalSerializationApi diff --git a/core/interfaces/src/test/java/info/nightscout/shared/SafeParseTest.kt b/core/interfaces/src/test/kotlin/app/aaps/interfaces/utils/SafeParseTest.kt similarity index 99% rename from core/interfaces/src/test/java/info/nightscout/shared/SafeParseTest.kt rename to core/interfaces/src/test/kotlin/app/aaps/interfaces/utils/SafeParseTest.kt index 495ea437d4..1bc81fe98a 100644 --- a/core/interfaces/src/test/java/info/nightscout/shared/SafeParseTest.kt +++ b/core/interfaces/src/test/kotlin/app/aaps/interfaces/utils/SafeParseTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.shared +package app.aaps.interfaces.utils import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test diff --git a/core/main/src/main/java/info/nightscout/core/constraints/ConstraintObject.kt b/core/main/src/main/java/info/nightscout/core/constraints/ConstraintObject.kt index d7918e74e4..7eeceeff1b 100644 --- a/core/main/src/main/java/info/nightscout/core/constraints/ConstraintObject.kt +++ b/core/main/src/main/java/info/nightscout/core/constraints/ConstraintObject.kt @@ -1,8 +1,8 @@ package info.nightscout.core.constraints -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag class ConstraintObject>(private var value: T, private val aapsLogger: AAPSLogger) : Constraint { diff --git a/core/main/src/main/java/info/nightscout/core/di/CoreDataClassesModule.kt b/core/main/src/main/java/info/nightscout/core/di/CoreDataClassesModule.kt index e94b388f44..4e4a571551 100644 --- a/core/main/src/main/java/info/nightscout/core/di/CoreDataClassesModule.kt +++ b/core/main/src/main/java/info/nightscout/core/di/CoreDataClassesModule.kt @@ -1,10 +1,10 @@ package info.nightscout.core.di +import app.aaps.interfaces.pump.PumpEnactResult import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.core.wizard.BolusWizard import info.nightscout.core.wizard.QuickWizardEntry -import info.nightscout.interfaces.pump.PumpEnactResult @Module @Suppress("unused") diff --git a/core/main/src/main/java/info/nightscout/core/events/EventIobCalculationProgress.kt b/core/main/src/main/java/info/nightscout/core/events/EventIobCalculationProgress.kt index cfeefba518..e07cfdebf6 100644 --- a/core/main/src/main/java/info/nightscout/core/events/EventIobCalculationProgress.kt +++ b/core/main/src/main/java/info/nightscout/core/events/EventIobCalculationProgress.kt @@ -1,7 +1,7 @@ package info.nightscout.core.events +import app.aaps.interfaces.rx.events.Event import info.nightscout.core.workflow.CalculationWorkflow -import info.nightscout.rx.events.Event class EventIobCalculationProgress(val pass: CalculationWorkflow.ProgressData, private val progressPct: Int, val cause: Event?) : Event() { diff --git a/core/main/src/main/java/info/nightscout/core/events/EventNewNotification.kt b/core/main/src/main/java/info/nightscout/core/events/EventNewNotification.kt index 282a4ae19a..ba0d336090 100644 --- a/core/main/src/main/java/info/nightscout/core/events/EventNewNotification.kt +++ b/core/main/src/main/java/info/nightscout/core/events/EventNewNotification.kt @@ -1,6 +1,6 @@ package info.nightscout.core.events -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.events.Event +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.rx.events.Event class EventNewNotification(var notification: Notification) : Event() diff --git a/core/main/src/main/java/info/nightscout/core/extensions/BlockExtension.kt b/core/main/src/main/java/info/nightscout/core/extensions/BlockExtension.kt index 44bcb5352f..7f40ad7a89 100644 --- a/core/main/src/main/java/info/nightscout/core/extensions/BlockExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/extensions/BlockExtension.kt @@ -1,9 +1,9 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject diff --git a/core/main/src/main/java/info/nightscout/core/extensions/BolusExtension.kt b/core/main/src/main/java/info/nightscout/core/extensions/BolusExtension.kt index 5d0f13d066..32fa43ac68 100644 --- a/core/main/src/main/java/info/nightscout/core/extensions/BolusExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/extensions/BolusExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.iob.Iob +import app.aaps.interfaces.plugin.ActivePlugin import info.nightscout.database.entities.Bolus -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.iob.Iob -import info.nightscout.interfaces.plugin.ActivePlugin fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob { - if (!isValid || type == Bolus.Type.PRIMING ) return Iob() + if (!isValid || type == Bolus.Type.PRIMING) return Iob() val insulinInterface: Insulin = activePlugin.activeInsulin return insulinInterface.iobCalcForTreatment(this, time, dia) } \ No newline at end of file diff --git a/core/main/src/main/java/info/nightscout/core/extensions/ExtendedBolusExtension.kt b/core/main/src/main/java/info/nightscout/core/extensions/ExtendedBolusExtension.kt index e9d3b6e605..730854d3b1 100644 --- a/core/main/src/main/java/info/nightscout/core/extensions/ExtendedBolusExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/extensions/ExtendedBolusExtension.kt @@ -1,16 +1,16 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import kotlin.math.ceil import kotlin.math.max import kotlin.math.min diff --git a/core/main/src/main/java/info/nightscout/core/extensions/GlucoseValueExtension.kt b/core/main/src/main/java/info/nightscout/core/extensions/GlucoseValueExtension.kt index 1f8a2c80a0..b4f5a3fbfc 100644 --- a/core/main/src/main/java/info/nightscout/core/extensions/GlucoseValueExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/extensions/GlucoseValueExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.main.R import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun GlucoseValue.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = diff --git a/core/main/src/main/java/info/nightscout/core/extensions/ProfileSwitchExtension.kt b/core/main/src/main/java/info/nightscout/core/extensions/ProfileSwitchExtension.kt index 0fc2dd84a4..510b2c86d5 100644 --- a/core/main/src/main/java/info/nightscout/core/extensions/ProfileSwitchExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/extensions/ProfileSwitchExtension.kt @@ -1,14 +1,14 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONObject import java.util.TimeZone diff --git a/core/main/src/main/java/info/nightscout/core/extensions/TemporaryBasalExtension.kt b/core/main/src/main/java/info/nightscout/core/extensions/TemporaryBasalExtension.kt index b146aaad22..24a70e6764 100644 --- a/core/main/src/main/java/info/nightscout/core/extensions/TemporaryBasalExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/extensions/TemporaryBasalExtension.kt @@ -1,15 +1,15 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import kotlin.math.ceil import kotlin.math.max import kotlin.math.min diff --git a/core/main/src/main/java/info/nightscout/core/extensions/TemporaryTargetExtension.kt b/core/main/src/main/java/info/nightscout/core/extensions/TemporaryTargetExtension.kt index f0879499bd..1a748ea9b3 100644 --- a/core/main/src/main/java/info/nightscout/core/extensions/TemporaryTargetExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/extensions/TemporaryTargetExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DecimalFormatter import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper import java.util.concurrent.TimeUnit fun TemporaryTarget.lowValueToUnitsToString(units: GlucoseUnit, decimalFormatter: DecimalFormatter): String = diff --git a/core/main/src/main/java/info/nightscout/core/extensions/TherapyEventExtension.kt b/core/main/src/main/java/info/nightscout/core/extensions/TherapyEventExtension.kt index 5acf5ad5aa..6b36ece442 100644 --- a/core/main/src/main/java/info/nightscout/core/extensions/TherapyEventExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/extensions/TherapyEventExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.utils.DateUtil import info.nightscout.database.entities.TherapyEvent -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.utils.DateUtil fun TherapyEvent.isOlderThan(hours: Double, dateUtil: DateUtil): Boolean { return getHoursFromStart(dateUtil) > hours diff --git a/core/main/src/main/java/info/nightscout/core/graph/ActivityGraph.kt b/core/main/src/main/java/info/nightscout/core/graph/ActivityGraph.kt index 9f887ea40f..80b8607b25 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/ActivityGraph.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/ActivityGraph.kt @@ -3,12 +3,12 @@ package info.nightscout.core.graph import android.content.Context import android.graphics.Color import android.util.AttributeSet +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.utils.T import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries import info.nightscout.database.entities.Bolus -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.shared.utils.T import kotlin.math.floor class ActivityGraph : GraphView { diff --git a/core/main/src/main/java/info/nightscout/core/graph/BasalProfileGraph.kt b/core/main/src/main/java/info/nightscout/core/graph/BasalProfileGraph.kt index 80c511890c..43c568521e 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/BasalProfileGraph.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/BasalProfileGraph.kt @@ -2,12 +2,12 @@ package info.nightscout.core.graph import android.content.Context import android.util.AttributeSet +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.Round import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.utils.Round import java.text.NumberFormat import kotlin.math.max import kotlin.math.min diff --git a/core/main/src/main/java/info/nightscout/core/graph/IcProfileGraph.kt b/core/main/src/main/java/info/nightscout/core/graph/IcProfileGraph.kt index 9257615882..fed3ace68e 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/IcProfileGraph.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/IcProfileGraph.kt @@ -2,12 +2,12 @@ package info.nightscout.core.graph import android.content.Context import android.util.AttributeSet +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.Round import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.utils.Round import java.text.NumberFormat import kotlin.math.max import kotlin.math.min diff --git a/core/main/src/main/java/info/nightscout/core/graph/IsfProfileGraph.kt b/core/main/src/main/java/info/nightscout/core/graph/IsfProfileGraph.kt index c5d9015628..f31618a4d3 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/IsfProfileGraph.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/IsfProfileGraph.kt @@ -2,14 +2,14 @@ package info.nightscout.core.graph import android.content.Context import android.util.AttributeSet +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.Round import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.utils.Round import java.text.NumberFormat import kotlin.math.max import kotlin.math.min diff --git a/core/main/src/main/java/info/nightscout/core/graph/OverviewData.kt b/core/main/src/main/java/info/nightscout/core/graph/OverviewData.kt index 77b3709317..967704d78e 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/OverviewData.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/OverviewData.kt @@ -4,6 +4,12 @@ import android.content.Context import androidx.annotation.AttrRes import androidx.annotation.ColorInt import androidx.annotation.DrawableRes +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.iob.CobInfo +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.iob.IobTotal import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries @@ -15,12 +21,6 @@ import info.nightscout.core.graph.data.Scale import info.nightscout.core.graph.data.ScaledDataPoint import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.interfaces.aps.AutosensData -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.iob.CobInfo -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.iob.IobTotal interface OverviewData { diff --git a/core/main/src/main/java/info/nightscout/core/graph/TargetBgProfileGraph.kt b/core/main/src/main/java/info/nightscout/core/graph/TargetBgProfileGraph.kt index 2d794cffd5..ef59d98016 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/TargetBgProfileGraph.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/TargetBgProfileGraph.kt @@ -2,14 +2,14 @@ package info.nightscout.core.graph import android.content.Context import android.util.AttributeSet +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.Round import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView import info.nightscout.core.graph.data.AreaGraphSeries import info.nightscout.core.graph.data.DoubleDataPoint -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.utils.Round import java.text.NumberFormat import kotlin.math.max import kotlin.math.min diff --git a/core/main/src/main/java/info/nightscout/core/graph/data/BolusDataPoint.kt b/core/main/src/main/java/info/nightscout/core/graph/data/BolusDataPoint.kt index 2c390d06c6..35798b5ad9 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/data/BolusDataPoint.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/data/BolusDataPoint.kt @@ -2,11 +2,11 @@ package info.nightscout.core.graph.data import android.content.Context import android.graphics.Paint +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DecimalFormatter import info.nightscout.database.entities.Bolus -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ResourceHelper class BolusDataPoint( val data: Bolus, diff --git a/core/main/src/main/java/info/nightscout/core/graph/data/CarbsDataPoint.kt b/core/main/src/main/java/info/nightscout/core/graph/data/CarbsDataPoint.kt index 2c0e58dde3..f1b982feb9 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/data/CarbsDataPoint.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/data/CarbsDataPoint.kt @@ -2,9 +2,9 @@ package info.nightscout.core.graph.data import android.content.Context import android.graphics.Paint +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.main.R import info.nightscout.database.entities.Carbs -import info.nightscout.shared.interfaces.ResourceHelper class CarbsDataPoint( val data: Carbs, diff --git a/core/main/src/main/java/info/nightscout/core/graph/data/EffectiveProfileSwitchDataPoint.kt b/core/main/src/main/java/info/nightscout/core/graph/data/EffectiveProfileSwitchDataPoint.kt index 339ffa097e..5ee96e1d88 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/data/EffectiveProfileSwitchDataPoint.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/data/EffectiveProfileSwitchDataPoint.kt @@ -2,9 +2,9 @@ package info.nightscout.core.graph.data import android.content.Context import android.graphics.Paint +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.T class EffectiveProfileSwitchDataPoint( val data: EffectiveProfileSwitch, @@ -19,7 +19,7 @@ class EffectiveProfileSwitchDataPoint( get() = "" + (if (data.originalPercentage != 100) "${data.originalPercentage}%" else "") + (if (data.originalPercentage != 100 && data.originalTimeshift != 0L) "," else "") + - (if (data.originalTimeshift != 0L) (T.msecs(data.originalTimeshift).hours().toString() + rh.gs(info.nightscout.interfaces.R.string.shorthour)) else "") + (if (data.originalTimeshift != 0L) (T.msecs(data.originalTimeshift).hours().toString() + rh.gs(app.aaps.interfaces.R.string.shorthour)) else "") override val duration = 0L override val shape = PointsWithLabelGraphSeries.Shape.PROFILE override val size = 2f diff --git a/core/main/src/main/java/info/nightscout/core/graph/data/ExtendedBolusDataPoint.kt b/core/main/src/main/java/info/nightscout/core/graph/data/ExtendedBolusDataPoint.kt index c4b8fb5d07..ab79a978da 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/data/ExtendedBolusDataPoint.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/data/ExtendedBolusDataPoint.kt @@ -2,9 +2,9 @@ package info.nightscout.core.graph.data import android.content.Context import android.graphics.Paint +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DecimalFormatter import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ResourceHelper class ExtendedBolusDataPoint( val data: ExtendedBolus, diff --git a/core/main/src/main/java/info/nightscout/core/graph/data/GlucoseValueDataPoint.kt b/core/main/src/main/java/info/nightscout/core/graph/data/GlucoseValueDataPoint.kt index 04f30c1877..3ab19d4d5b 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/data/GlucoseValueDataPoint.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/data/GlucoseValueDataPoint.kt @@ -2,11 +2,11 @@ package info.nightscout.core.graph.data import android.content.Context import android.graphics.Paint +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper class GlucoseValueDataPoint( val data: GlucoseValue, diff --git a/core/main/src/main/java/info/nightscout/core/graph/data/HeartRateDataPoint.kt b/core/main/src/main/java/info/nightscout/core/graph/data/HeartRateDataPoint.kt index 7959b72c6a..15be38e203 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/data/HeartRateDataPoint.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/data/HeartRateDataPoint.kt @@ -2,8 +2,8 @@ package info.nightscout.core.graph.data import android.content.Context import android.graphics.Paint +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.database.entities.HeartRate -import info.nightscout.shared.interfaces.ResourceHelper class HeartRateDataPoint( private val data: HeartRate, diff --git a/core/main/src/main/java/info/nightscout/core/graph/data/InMemoryGlucoseValueDataPoint.kt b/core/main/src/main/java/info/nightscout/core/graph/data/InMemoryGlucoseValueDataPoint.kt index cad6613520..38d4b82d4b 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/data/InMemoryGlucoseValueDataPoint.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/data/InMemoryGlucoseValueDataPoint.kt @@ -4,12 +4,12 @@ import android.content.Context import android.graphics.Paint import androidx.annotation.ColorInt import androidx.core.graphics.ColorUtils -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper class InMemoryGlucoseValueDataPoint( val data: InMemoryGlucoseValue, @@ -19,7 +19,7 @@ class InMemoryGlucoseValueDataPoint( ) : DataPointWithLabelInterface { private fun valueToUnits(units: GlucoseUnit): Double = - if (units == GlucoseUnit.MGDL) data.recalculated else data.recalculated * Constants.MGDL_TO_MMOLL + if (units == GlucoseUnit.MGDL) data.recalculated else data.recalculated * Constants.MGDL_TO_MMOLL override fun getX(): Double = data.timestamp.toDouble() override fun getY(): Double = valueToUnits(profileFunction.getUnits()) diff --git a/core/main/src/main/java/info/nightscout/core/graph/data/TherapyEventDataPoint.kt b/core/main/src/main/java/info/nightscout/core/graph/data/TherapyEventDataPoint.kt index 2bbb05206b..69d9003eb4 100644 --- a/core/main/src/main/java/info/nightscout/core/graph/data/TherapyEventDataPoint.kt +++ b/core/main/src/main/java/info/nightscout/core/graph/data/TherapyEventDataPoint.kt @@ -2,11 +2,11 @@ package info.nightscout.core.graph.data import android.content.Context import android.graphics.Paint +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.Translator import info.nightscout.database.entities.TherapyEvent -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.Translator -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper class TherapyEventDataPoint( val data: TherapyEvent, diff --git a/core/main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt b/core/main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt index 59c87752f8..c017ec1d19 100644 --- a/core/main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/iob/CobInfoExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.core.iob -import info.nightscout.interfaces.iob.CobInfo -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.iob.CobInfo +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DecimalFormatter fun CobInfo.generateCOBString(decimalFormatter: DecimalFormatter): String { var cobStringResult = "--g" diff --git a/core/main/src/main/java/info/nightscout/core/iob/GlucoseStatusExtension.kt b/core/main/src/main/java/info/nightscout/core/iob/GlucoseStatusExtension.kt index 927195dcad..9a6240e2db 100644 --- a/core/main/src/main/java/info/nightscout/core/iob/GlucoseStatusExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/iob/GlucoseStatusExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.core.iob -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.Round +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.Round fun GlucoseStatus.log(decimalFormatter: DecimalFormatter): String = "Glucose: " + decimalFormatter.to0Decimal(glucose) + " mg/dl " + "Noise: " + decimalFormatter.to0Decimal(noise) + " " + diff --git a/core/main/src/main/java/info/nightscout/core/iob/IobTotalExtension.kt b/core/main/src/main/java/info/nightscout/core/iob/IobTotalExtension.kt index cd8c3b2041..468a079f97 100644 --- a/core/main/src/main/java/info/nightscout/core/iob/IobTotalExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/iob/IobTotalExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.core.iob -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.utils.Round -import info.nightscout.shared.utils.DateUtil +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.Round import org.json.JSONException import org.json.JSONObject diff --git a/core/main/src/main/java/info/nightscout/core/profile/ProfileSealed.kt b/core/main/src/main/java/info/nightscout/core/profile/ProfileSealed.kt index cbf5592b0e..e718670190 100644 --- a/core/main/src/main/java/info/nightscout/core/profile/ProfileSealed.kt +++ b/core/main/src/main/java/info/nightscout/core/profile/ProfileSealed.kt @@ -1,5 +1,17 @@ package info.nightscout.core.profile +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.Profile.ProfileValue +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.T import info.nightscout.core.events.EventNewNotification import info.nightscout.core.extensions.blockValueBySeconds import info.nightscout.core.extensions.highTargetBlockValueBySeconds @@ -14,18 +26,6 @@ import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.Profile.ProfileValue -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import java.text.DecimalFormat @@ -152,7 +152,13 @@ sealed class ProfileSealed( for (ic in icBlocks) if (!hardLimits.isInRange(ic.amount * 100.0 / percentage, hardLimits.minIC(), hardLimits.maxIC())) { validityCheck.isValid = false - validityCheck.reasons.add(rh.gs(info.nightscout.core.ui.R.string.value_out_of_hard_limits, rh.gs(info.nightscout.core.ui.R.string.profile_carbs_ratio_value), ic.amount * 100.0 / percentage)) + validityCheck.reasons.add( + rh.gs( + info.nightscout.core.ui.R.string.value_out_of_hard_limits, + rh.gs(info.nightscout.core.ui.R.string.profile_carbs_ratio_value), + ic.amount * 100.0 / percentage + ) + ) break } for (isf in isfBlocks) @@ -222,8 +228,7 @@ sealed class ProfileSealed( if (getTargetHighMgdlTimeFromMidnight(seconds) != profile.getTargetHighMgdlTimeFromMidnight(seconds)) return false } if (dia != profile.dia) return false - if ((profile is EPS) && profileName != profile.value.originalProfileName) return false // handle profile name change too - return true + return !((profile is EPS) && profileName != profile.value.originalProfileName) // handle profile name change too } override val percentage: Int diff --git a/core/main/src/main/java/info/nightscout/core/pump/PumpEnactResultExtension.kt b/core/main/src/main/java/info/nightscout/core/pump/PumpEnactResultExtension.kt index de04dcaa2a..23ba166182 100644 --- a/core/main/src/main/java/info/nightscout/core/pump/PumpEnactResultExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/pump/PumpEnactResultExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.core.pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DecimalFormatter fun PumpEnactResult.toHtml(rh: ResourceHelper, decimalFormatter: DecimalFormatter): String { var ret = "" + rh.gs(info.nightscout.core.ui.R.string.success) + ": " + success diff --git a/core/main/src/main/java/info/nightscout/core/pump/PumpTypeExtension.kt b/core/main/src/main/java/info/nightscout/core/pump/PumpTypeExtension.kt index f92f0ccecf..a8897d60b2 100644 --- a/core/main/src/main/java/info/nightscout/core/pump/PumpTypeExtension.kt +++ b/core/main/src/main/java/info/nightscout/core/pump/PumpTypeExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.core.pump +import app.aaps.interfaces.pump.defs.PumpType import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.pump.defs.PumpType fun PumpType.Companion.fromDbSource(s: UserEntry.Sources): PumpType.Source = when (s) { diff --git a/core/main/src/main/java/info/nightscout/core/utils/ActionModeHelper.kt b/core/main/src/main/java/info/nightscout/core/utils/ActionModeHelper.kt index 856d2309ee..8998181f25 100644 --- a/core/main/src/main/java/info/nightscout/core/utils/ActionModeHelper.kt +++ b/core/main/src/main/java/info/nightscout/core/utils/ActionModeHelper.kt @@ -8,8 +8,8 @@ import android.view.MenuItem import androidx.core.view.MenuCompat import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.main.R -import info.nightscout.shared.interfaces.ResourceHelper class ActionModeHelper(val rh: ResourceHelper, val activity: FragmentActivity?, val fragment: Fragment?) { diff --git a/core/main/src/main/java/info/nightscout/core/utils/CryptoUtil.kt b/core/main/src/main/java/info/nightscout/core/utils/CryptoUtil.kt index c2dfaca653..8632a5671f 100644 --- a/core/main/src/main/java/info/nightscout/core/utils/CryptoUtil.kt +++ b/core/main/src/main/java/info/nightscout/core/utils/CryptoUtil.kt @@ -1,6 +1,6 @@ package info.nightscout.core.utils -import info.nightscout.rx.logging.AAPSLogger +import app.aaps.interfaces.logging.AAPSLogger import org.spongycastle.util.encoders.Base64 import java.nio.ByteBuffer import java.security.MessageDigest diff --git a/core/main/src/main/java/info/nightscout/core/utils/extensions/HtmlString.kt b/core/main/src/main/java/info/nightscout/core/utils/extensions/HtmlString.kt index c593107d94..f84a150f86 100644 --- a/core/main/src/main/java/info/nightscout/core/utils/extensions/HtmlString.kt +++ b/core/main/src/main/java/info/nightscout/core/utils/extensions/HtmlString.kt @@ -3,7 +3,7 @@ package info.nightscout.core.utils.extensions import android.content.Context import androidx.annotation.AttrRes import androidx.annotation.ColorRes -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.resources.ResourceHelper fun String.formatBold(): String = "$this" diff --git a/core/main/src/main/java/info/nightscout/core/utils/extensions/JSONObjectExt.kt b/core/main/src/main/java/info/nightscout/core/utils/extensions/JSONObjectExt.kt index 91611acc07..72ad0d9f7c 100644 --- a/core/main/src/main/java/info/nightscout/core/utils/extensions/JSONObjectExt.kt +++ b/core/main/src/main/java/info/nightscout/core/utils/extensions/JSONObjectExt.kt @@ -1,8 +1,8 @@ package info.nightscout.core.utils.extensions import androidx.annotation.StringRes -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import org.json.JSONObject fun JSONObject.putInt(@StringRes key: Int, sp: SP, rh: ResourceHelper): JSONObject = diff --git a/core/main/src/main/java/info/nightscout/core/utils/fabric/FabricPrivacy.kt b/core/main/src/main/java/info/nightscout/core/utils/fabric/FabricPrivacy.kt index ffef1bb9b2..a665a9038a 100644 --- a/core/main/src/main/java/info/nightscout/core/utils/fabric/FabricPrivacy.kt +++ b/core/main/src/main/java/info/nightscout/core/utils/fabric/FabricPrivacy.kt @@ -2,14 +2,15 @@ package info.nightscout.core.utils.fabric import android.os.Bundle import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.sharedPreferences.SP import com.google.firebase.analytics.FirebaseAnalytics import com.google.firebase.analytics.ktx.analytics import com.google.firebase.crashlytics.FirebaseCrashlytics import com.google.firebase.ktx.Firebase import info.nightscout.core.utils.R -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import java.io.ByteArrayInputStream import java.io.IOException import java.io.ObjectInputStream @@ -98,7 +99,7 @@ class FabricPrivacy @Inject constructor( return sp.getBoolean(R.string.key_enable_fabric, true) } - fun logWearException(wearException: info.nightscout.rx.weardata.EventData.WearException) { + fun logWearException(wearException: EventData.WearException) { aapsLogger.debug(LTag.WEAR, "logWearException") FirebaseCrashlytics.getInstance().apply { setCustomKey("wear_exception", true) diff --git a/core/main/src/main/java/info/nightscout/core/utils/worker/LoggingWorker.kt b/core/main/src/main/java/info/nightscout/core/utils/worker/LoggingWorker.kt index b09ff357ca..791f65fc7e 100644 --- a/core/main/src/main/java/info/nightscout/core/utils/worker/LoggingWorker.kt +++ b/core/main/src/main/java/info/nightscout/core/utils/worker/LoggingWorker.kt @@ -3,10 +3,10 @@ package info.nightscout.core.utils.worker import android.content.Context import androidx.work.CoroutineWorker import androidx.work.WorkerParameters +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.withContext import javax.inject.Inject diff --git a/core/main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt b/core/main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt index 03cb49cc62..789fe71052 100644 --- a/core/main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt +++ b/core/main/src/main/java/info/nightscout/core/wizard/BolusWizard.kt @@ -2,6 +2,35 @@ package info.nightscout.core.wizard import android.content.Context import android.text.Spanned +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.automation.Automation +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.T import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject @@ -17,35 +46,6 @@ import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.automation.Automation -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.Round -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -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.LinkedList import javax.inject.Inject import kotlin.math.abs diff --git a/core/main/src/main/java/info/nightscout/core/wizard/QuickWizard.kt b/core/main/src/main/java/info/nightscout/core/wizard/QuickWizard.kt index 8ced6ada23..c06619ca2b 100644 --- a/core/main/src/main/java/info/nightscout/core/wizard/QuickWizard.kt +++ b/core/main/src/main/java/info/nightscout/core/wizard/QuickWizard.kt @@ -1,7 +1,7 @@ package info.nightscout.core.wizard +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector -import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONObject import java.util.UUID diff --git a/core/main/src/main/java/info/nightscout/core/wizard/QuickWizardEntry.kt b/core/main/src/main/java/info/nightscout/core/wizard/QuickWizardEntry.kt index 57e906887b..5433cb2880 100644 --- a/core/main/src/main/java/info/nightscout/core/wizard/QuickWizardEntry.kt +++ b/core/main/src/main/java/info/nightscout/core/wizard/QuickWizardEntry.kt @@ -1,6 +1,16 @@ package info.nightscout.core.wizard import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.valueToUnits import info.nightscout.core.iob.round @@ -8,16 +18,6 @@ import info.nightscout.core.utils.JsonHelper.safeGetInt import info.nightscout.core.utils.JsonHelper.safeGetString import info.nightscout.core.utils.MidnightUtils import info.nightscout.database.ValueWrapper -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import java.util.UUID diff --git a/core/main/src/main/java/info/nightscout/core/workflow/CalculationWorkflow.kt b/core/main/src/main/java/info/nightscout/core/workflow/CalculationWorkflow.kt index e54f053109..ddc6fdcddb 100644 --- a/core/main/src/main/java/info/nightscout/core/workflow/CalculationWorkflow.kt +++ b/core/main/src/main/java/info/nightscout/core/workflow/CalculationWorkflow.kt @@ -1,8 +1,8 @@ package info.nightscout.core.workflow +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.rx.events.Event import info.nightscout.core.graph.OverviewData -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.rx.events.Event interface CalculationWorkflow { companion object { diff --git a/core/main/src/test/java/info/nightscout/core/data/DetailedBolusInfoTest.kt b/core/main/src/test/java/info/nightscout/core/data/DetailedBolusInfoTest.kt index 47ae4b1a62..281cf22b88 100644 --- a/core/main/src/test/java/info/nightscout/core/data/DetailedBolusInfoTest.kt +++ b/core/main/src/test/java/info/nightscout/core/data/DetailedBolusInfoTest.kt @@ -1,13 +1,13 @@ package info.nightscout.core.data import android.content.Context +import app.aaps.interfaces.pump.DetailedBolusInfo import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import com.google.gson.Gson import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.TherapyEvent -import info.nightscout.interfaces.pump.DetailedBolusInfo import org.apache.commons.lang3.builder.EqualsBuilder import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/core/main/src/test/java/info/nightscout/core/data/IobTest.kt b/core/main/src/test/java/info/nightscout/core/data/IobTest.kt index e9c850b613..4f1effc750 100644 --- a/core/main/src/test/java/info/nightscout/core/data/IobTest.kt +++ b/core/main/src/test/java/info/nightscout/core/data/IobTest.kt @@ -1,19 +1,22 @@ package info.nightscout.core.data +import app.aaps.interfaces.iob.Iob import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.iob.Iob import org.junit.jupiter.api.Test class IobTest { - @Test fun plusTest() { - val a = Iob().iobContrib(1.0).activityContrib(2.0) - val b = Iob().iobContrib(3.0).activityContrib(4.0) - a.plus(b) - assertThat(a.iobContrib).isWithin(0.01).of(4.0) - assertThat(a.activityContrib).isWithin(0.01).of(6.0) + private fun Iob.iobContrib(iobContrib: Double): Iob { + this.iobContrib = iobContrib + return this } + private fun Iob.activityContrib(activityContrib: Double): Iob { + this.activityContrib = activityContrib + return this + } + + @Test fun equalTest() { val a1 = Iob().iobContrib(1.0).activityContrib(2.0) val a2 = Iob().iobContrib(1.0).activityContrib(2.0) diff --git a/core/main/src/test/java/info/nightscout/core/data/IobTotalTest.kt b/core/main/src/test/java/info/nightscout/core/data/IobTotalTest.kt index e777299404..797652978b 100644 --- a/core/main/src/test/java/info/nightscout/core/data/IobTotalTest.kt +++ b/core/main/src/test/java/info/nightscout/core/data/IobTotalTest.kt @@ -1,6 +1,8 @@ package info.nightscout.core.data import android.content.Context +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.impl.utils.DateUtilImpl import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat @@ -10,8 +12,6 @@ import info.nightscout.core.iob.determineBasalJson import info.nightscout.core.iob.json import info.nightscout.core.iob.plus import info.nightscout.core.iob.round -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/core/main/src/test/java/info/nightscout/core/data/MealDataTest.kt b/core/main/src/test/java/info/nightscout/core/data/MealDataTest.kt index d6994d9d30..48961eed13 100644 --- a/core/main/src/test/java/info/nightscout/core/data/MealDataTest.kt +++ b/core/main/src/test/java/info/nightscout/core/data/MealDataTest.kt @@ -1,7 +1,7 @@ package info.nightscout.core.data +import app.aaps.interfaces.iob.MealData import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.iob.MealData import org.junit.jupiter.api.Test class MealDataTest { diff --git a/core/main/src/test/java/info/nightscout/core/data/ProfileTest.kt b/core/main/src/test/java/info/nightscout/core/data/ProfileTest.kt index e42fd22d0f..7eafcfda94 100644 --- a/core/main/src/test/java/info/nightscout/core/data/ProfileTest.kt +++ b/core/main/src/test/java/info/nightscout/core/data/ProfileTest.kt @@ -1,6 +1,12 @@ package info.nightscout.core.data import android.content.Context +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits import app.aaps.shared.impl.utils.DateUtilImpl import app.aaps.shared.tests.HardLimitsMock import app.aaps.shared.tests.TestBase @@ -9,12 +15,6 @@ import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import info.nightscout.core.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/core/main/src/test/java/info/nightscout/core/extensions/BlockExtensionKtTest.kt b/core/main/src/test/java/info/nightscout/core/extensions/BlockExtensionKtTest.kt index 733b01ff17..dd658d5eed 100644 --- a/core/main/src/test/java/info/nightscout/core/extensions/BlockExtensionKtTest.kt +++ b/core/main/src/test/java/info/nightscout/core/extensions/BlockExtensionKtTest.kt @@ -1,10 +1,10 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.utils.T import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock import info.nightscout.database.entities.data.checkSanity -import info.nightscout.shared.utils.T import org.junit.jupiter.api.Test class BlockExtensionKtTest { diff --git a/core/main/src/test/java/info/nightscout/core/graph/data/InMemoryGlucoseValueDataPointTest.kt b/core/main/src/test/java/info/nightscout/core/graph/data/InMemoryGlucoseValueDataPointTest.kt index 630479e72c..7ad62b96a0 100644 --- a/core/main/src/test/java/info/nightscout/core/graph/data/InMemoryGlucoseValueDataPointTest.kt +++ b/core/main/src/test/java/info/nightscout/core/graph/data/InMemoryGlucoseValueDataPointTest.kt @@ -2,15 +2,14 @@ package info.nightscout.core.graph.data import android.content.Context import android.graphics.Color +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach - import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import org.mockito.Mock diff --git a/core/main/src/test/java/info/nightscout/core/interfaces/PluginDescriptionTest.kt b/core/main/src/test/java/info/nightscout/core/interfaces/PluginDescriptionTest.kt index ae3e45e520..eafc78fd27 100644 --- a/core/main/src/test/java/info/nightscout/core/interfaces/PluginDescriptionTest.kt +++ b/core/main/src/test/java/info/nightscout/core/interfaces/PluginDescriptionTest.kt @@ -1,9 +1,9 @@ package info.nightscout.core.interfaces -import com.google.common.truth.Truth.assertThat import androidx.fragment.app.Fragment -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test class PluginDescriptionTest { diff --git a/core/main/src/test/java/info/nightscout/core/interfaces/PumpDescriptionTest.kt b/core/main/src/test/java/info/nightscout/core/interfaces/PumpDescriptionTest.kt index eda615a2c7..b1378c25ce 100644 --- a/core/main/src/test/java/info/nightscout/core/interfaces/PumpDescriptionTest.kt +++ b/core/main/src/test/java/info/nightscout/core/interfaces/PumpDescriptionTest.kt @@ -1,10 +1,10 @@ package info.nightscout.core.interfaces +import app.aaps.interfaces.pump.defs.PumpCapability +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpTempBasalType +import app.aaps.interfaces.pump.defs.PumpType import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.pump.defs.PumpCapability -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpTempBasalType -import info.nightscout.interfaces.pump.defs.PumpType import org.junit.jupiter.api.Test class PumpDescriptionTest { diff --git a/core/main/src/test/java/info/nightscout/core/utils/DateUtilTest.kt b/core/main/src/test/java/info/nightscout/core/utils/DateUtilTest.kt index 96329a0a0e..30ef584543 100644 --- a/core/main/src/test/java/info/nightscout/core/utils/DateUtilTest.kt +++ b/core/main/src/test/java/info/nightscout/core/utils/DateUtilTest.kt @@ -1,11 +1,11 @@ package info.nightscout.core.utils import android.content.Context +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.T import app.aaps.shared.impl.utils.DateUtilImpl import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.T import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test @@ -88,7 +88,7 @@ class DateUtilTest : TestBase() { } */ @Test fun timeFrameStringTest() { - `when`(rh.gs(info.nightscout.interfaces.R.string.shorthour)).thenReturn("h") + `when`(rh.gs(app.aaps.interfaces.R.string.shorthour)).thenReturn("h") assertThat(DateUtilImpl(context).timeFrameString(T.hours(1).msecs() + T.mins(1).msecs(), rh)).isEqualTo("(1h 1')") } } diff --git a/core/main/src/test/java/info/nightscout/core/utils/MidnightTimeTest.kt b/core/main/src/test/java/info/nightscout/core/utils/MidnightTimeTest.kt index 7f10b96e7e..fe977a652d 100644 --- a/core/main/src/test/java/info/nightscout/core/utils/MidnightTimeTest.kt +++ b/core/main/src/test/java/info/nightscout/core/utils/MidnightTimeTest.kt @@ -1,7 +1,7 @@ package info.nightscout.core.utils +import app.aaps.interfaces.utils.MidnightTime import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.utils.MidnightTime import org.junit.jupiter.api.Test import java.util.Calendar diff --git a/core/main/src/test/java/info/nightscout/core/utils/RoundTest.kt b/core/main/src/test/java/info/nightscout/core/utils/RoundTest.kt index 6d57c65c02..553a2bf628 100644 --- a/core/main/src/test/java/info/nightscout/core/utils/RoundTest.kt +++ b/core/main/src/test/java/info/nightscout/core/utils/RoundTest.kt @@ -1,7 +1,7 @@ package info.nightscout.core.utils +import app.aaps.interfaces.utils.Round import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.utils.Round import org.junit.jupiter.api.Test class RoundTest { diff --git a/core/main/src/test/java/info/nightscout/core/utils/TTest.kt b/core/main/src/test/java/info/nightscout/core/utils/TTest.kt index bf067c9c21..15c28226ee 100644 --- a/core/main/src/test/java/info/nightscout/core/utils/TTest.kt +++ b/core/main/src/test/java/info/nightscout/core/utils/TTest.kt @@ -1,7 +1,7 @@ package info.nightscout.core.utils +import app.aaps.interfaces.utils.T import com.google.common.truth.Truth.assertThat -import info.nightscout.shared.utils.T import org.junit.jupiter.api.Test import kotlin.math.abs diff --git a/core/main/src/test/java/info/nightscout/core/wizard/QuickWizardTest.kt b/core/main/src/test/java/info/nightscout/core/wizard/QuickWizardTest.kt index 9be234a458..7eb4dd2e26 100644 --- a/core/main/src/test/java/info/nightscout/core/wizard/QuickWizardTest.kt +++ b/core/main/src/test/java/info/nightscout/core/wizard/QuickWizardTest.kt @@ -1,12 +1,12 @@ package info.nightscout.core.wizard +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/core/validators/src/main/java/info/nightscout/core/validators/DefaultEditTextValidator.kt b/core/validators/src/main/java/info/nightscout/core/validators/DefaultEditTextValidator.kt index 5d0034c2ba..3f67c4922c 100644 --- a/core/validators/src/main/java/info/nightscout/core/validators/DefaultEditTextValidator.kt +++ b/core/validators/src/main/java/info/nightscout/core/validators/DefaultEditTextValidator.kt @@ -5,6 +5,7 @@ import android.text.Editable import android.text.TextUtils import android.text.TextWatcher import android.widget.EditText +import app.aaps.interfaces.profile.ProfileUtil import com.google.android.material.textfield.TextInputLayout import dagger.android.HasAndroidInjector import info.nightscout.core.validators.validators.AlphaNumericValidator @@ -34,11 +35,11 @@ import info.nightscout.core.validators.validators.PinStrengthValidator import info.nightscout.core.validators.validators.RegexpValidator import info.nightscout.core.validators.validators.Validator import info.nightscout.core.validators.validators.WebUrlValidator -import info.nightscout.shared.interfaces.ProfileUtil import javax.inject.Inject @Suppress("SpellCheckingInspection") class DefaultEditTextValidator : EditTextValidator { + private var mValidator: MultiValidator? = null private var testErrorString: String? = null private var emptyAllowed = false @@ -136,61 +137,79 @@ class DefaultEditTextValidator : EditTextValidator { setEmptyErrorString(emptyErrorStringDef) mValidator = AndValidator() val toAdd: Validator = - when (testType) { - EditTextValidator.TEST_NOCHECK -> DummyValidator() - EditTextValidator.TEST_ALPHA -> AlphaValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_only_standard_letters_are_allowed) else testErrorString) - EditTextValidator.TEST_ALPHANUMERIC -> AlphaNumericValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_this_field_cannot_contain_special_character) else testErrorString) - EditTextValidator.TEST_NUMERIC -> NumericValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_only_numeric_digits_allowed) else testErrorString) - EditTextValidator.TEST_NUMERIC_RANGE -> NumericRangeValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_only_numeric_digits_range_allowed, minNumber.toString(), maxNumber.toString()) else testErrorString, minNumber, maxNumber) - EditTextValidator.TEST_FLOAT_NUMERIC_RANGE -> FloatNumericRangeValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_only_numeric_digits_range_allowed, floatminNumber.toString(), floatmaxNumber.toString()) else testErrorString, floatminNumber, floatmaxNumber) - EditTextValidator.TEST_REGEXP -> RegexpValidator(testErrorString, customRegexp ?: "") - EditTextValidator.TEST_CREDITCARD -> CreditCardValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_creditcard_number_not_valid) else testErrorString) - EditTextValidator.TEST_EMAIL -> EmailValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_email_address_not_valid) else testErrorString) - EditTextValidator.TEST_PHONE -> PhoneValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_phone_not_valid) else testErrorString) - EditTextValidator.TEST_MULTI_PHONE -> MultiPhoneValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_phone_not_valid) else testErrorString) - EditTextValidator.TEST_PIN_STRENGTH -> PinStrengthValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_pin_not_valid) else testErrorString) - EditTextValidator.TEST_DOMAINNAME -> DomainValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_domain_not_valid) else testErrorString) - EditTextValidator.TEST_IPADDRESS -> IpAddressValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_ip_not_valid) else testErrorString) - EditTextValidator.TEST_WEBURL -> WebUrlValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_url_not_valid) else testErrorString) - EditTextValidator.TEST_HTTPS_URL -> HttpsUrlValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_url_not_valid) else testErrorString) - EditTextValidator.TEST_PERSONNAME -> PersonNameValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_notvalid_personname) else testErrorString) - EditTextValidator.TEST_PERSONFULLNAME -> PersonFullNameValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_notvalid_personfullname) else testErrorString) - EditTextValidator.TEST_MIN_LENGTH -> MinDigitLengthValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_not_a_minimum_length) else testErrorString, minLength) - EditTextValidator.TEST_BG_RANGE -> BgRangeValidator( - if (TextUtils.isEmpty(testErrorString)) context.getString( - R.string.error_only_numeric_digits_range_allowed, - profileUtil.fromMgdlToUnits(minMgdl.toDouble()).toString(), profileUtil.fromMgdlToUnits(maxMgdl.toDouble()).toString() - ) else testErrorString, minMgdl, maxMgdl, profileUtil - ) + when (testType) { + EditTextValidator.TEST_NOCHECK -> DummyValidator() + EditTextValidator.TEST_ALPHA -> AlphaValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_only_standard_letters_are_allowed) else testErrorString) + EditTextValidator.TEST_ALPHANUMERIC -> AlphaNumericValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_this_field_cannot_contain_special_character) else testErrorString) + EditTextValidator.TEST_NUMERIC -> NumericValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_only_numeric_digits_allowed) else testErrorString) + EditTextValidator.TEST_NUMERIC_RANGE -> NumericRangeValidator( + if (TextUtils.isEmpty(testErrorString)) context.getString( + R.string.error_only_numeric_digits_range_allowed, + minNumber.toString(), + maxNumber.toString() + ) else testErrorString, minNumber, maxNumber + ) - EditTextValidator.TEST_CUSTOM -> { - // must specify the fully qualified class name & an error message - if (classType == null) - throw RuntimeException("Trying to create a custom validator but no classType has been specified.") - if (TextUtils.isEmpty(testErrorString)) - throw RuntimeException(String.format("Trying to create a custom validator (%s) but no error string specified.", classType)) + EditTextValidator.TEST_FLOAT_NUMERIC_RANGE -> FloatNumericRangeValidator( + if (TextUtils.isEmpty(testErrorString)) context.getString( + R.string.error_only_numeric_digits_range_allowed, + floatminNumber.toString(), + floatmaxNumber.toString() + ) else testErrorString, floatminNumber, floatmaxNumber + ) - val customValidatorClass: Class = try { - this.javaClass.classLoader?.loadClass(classType)?.let { - if (!Validator::class.java.isAssignableFrom(it)) { - throw RuntimeException(String.format("Custom validator (%s) does not extend %s", classType, Validator::class.java.name)) - } - @Suppress("Unchecked_Cast") - it as Class - }!! - } catch (e: ClassNotFoundException) { - throw RuntimeException(String.format("Unable to load class for custom validator (%s).", classType)) - } - try { - customValidatorClass.getConstructor(String::class.java).newInstance(testErrorString) - } catch (e: Exception) { - throw RuntimeException(String.format("Unable to construct custom validator (%s) with argument: %s", classType, testErrorString)) + EditTextValidator.TEST_REGEXP -> RegexpValidator(testErrorString, customRegexp ?: "") + EditTextValidator.TEST_CREDITCARD -> CreditCardValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_creditcard_number_not_valid) else testErrorString) + EditTextValidator.TEST_EMAIL -> EmailValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_email_address_not_valid) else testErrorString) + EditTextValidator.TEST_PHONE -> PhoneValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_phone_not_valid) else testErrorString) + EditTextValidator.TEST_MULTI_PHONE -> MultiPhoneValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_phone_not_valid) else testErrorString) + EditTextValidator.TEST_PIN_STRENGTH -> PinStrengthValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_pin_not_valid) else testErrorString) + EditTextValidator.TEST_DOMAINNAME -> DomainValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_domain_not_valid) else testErrorString) + EditTextValidator.TEST_IPADDRESS -> IpAddressValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_ip_not_valid) else testErrorString) + EditTextValidator.TEST_WEBURL -> WebUrlValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_url_not_valid) else testErrorString) + EditTextValidator.TEST_HTTPS_URL -> HttpsUrlValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_url_not_valid) else testErrorString) + EditTextValidator.TEST_PERSONNAME -> PersonNameValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_notvalid_personname) else testErrorString) + EditTextValidator.TEST_PERSONFULLNAME -> PersonFullNameValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_notvalid_personfullname) else testErrorString) + EditTextValidator.TEST_MIN_LENGTH -> MinDigitLengthValidator( + if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_not_a_minimum_length) else testErrorString, + minLength + ) + + EditTextValidator.TEST_BG_RANGE -> BgRangeValidator( + if (TextUtils.isEmpty(testErrorString)) context.getString( + R.string.error_only_numeric_digits_range_allowed, + profileUtil.fromMgdlToUnits(minMgdl.toDouble()).toString(), profileUtil.fromMgdlToUnits(maxMgdl.toDouble()).toString() + ) else testErrorString, minMgdl, maxMgdl, profileUtil + ) + + EditTextValidator.TEST_CUSTOM -> { + // must specify the fully qualified class name & an error message + if (classType == null) + throw RuntimeException("Trying to create a custom validator but no classType has been specified.") + if (TextUtils.isEmpty(testErrorString)) + throw RuntimeException(String.format("Trying to create a custom validator (%s) but no error string specified.", classType)) + + val customValidatorClass: Class = try { + this.javaClass.classLoader?.loadClass(classType)?.let { + if (!Validator::class.java.isAssignableFrom(it)) { + throw RuntimeException(String.format("Custom validator (%s) does not extend %s", classType, Validator::class.java.name)) + } + @Suppress("Unchecked_Cast") + it as Class + }!! + } catch (e: ClassNotFoundException) { + throw RuntimeException(String.format("Unable to load class for custom validator (%s).", classType)) + } + try { + customValidatorClass.getConstructor(String::class.java).newInstance(testErrorString) + } catch (e: Exception) { + throw RuntimeException(String.format("Unable to construct custom validator (%s) with argument: %s", classType, testErrorString)) + } } + + EditTextValidator.TEST_DATE -> DateValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_date_not_valid) else testErrorString, customFormat) + else -> DummyValidator() } - - EditTextValidator.TEST_DATE -> DateValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_date_not_valid) else testErrorString, customFormat) - else -> DummyValidator() - } val tmpValidator: MultiValidator if (!emptyAllowed) { // If the xml tells us that this is a required field, we will add the EmptyValidator. tmpValidator = AndValidator() diff --git a/core/validators/src/main/java/info/nightscout/core/validators/ValidatingEditTextPreference.kt b/core/validators/src/main/java/info/nightscout/core/validators/ValidatingEditTextPreference.kt index ede01391e0..c9b02b7cb5 100644 --- a/core/validators/src/main/java/info/nightscout/core/validators/ValidatingEditTextPreference.kt +++ b/core/validators/src/main/java/info/nightscout/core/validators/ValidatingEditTextPreference.kt @@ -4,9 +4,9 @@ import android.content.Context import android.util.AttributeSet import androidx.preference.EditTextPreference import androidx.preference.PreferenceViewHolder +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.utils.SafeParse import dagger.android.HasAndroidInjector -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ProfileUtil import javax.inject.Inject class ValidatingEditTextPreference(ctx: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int) : EditTextPreference(ctx, attrs, defStyleAttr, defStyleRes) { diff --git a/core/validators/src/main/java/info/nightscout/core/validators/validators/BgRangeValidator.kt b/core/validators/src/main/java/info/nightscout/core/validators/validators/BgRangeValidator.kt index 170c2dc2de..e60cce2708 100644 --- a/core/validators/src/main/java/info/nightscout/core/validators/validators/BgRangeValidator.kt +++ b/core/validators/src/main/java/info/nightscout/core/validators/validators/BgRangeValidator.kt @@ -1,7 +1,7 @@ package info.nightscout.core.validators.validators import android.widget.EditText -import info.nightscout.shared.interfaces.ProfileUtil +import app.aaps.interfaces.profile.ProfileUtil class BgRangeValidator(customErrorMessage: String?, private val min: Int, private val max: Int, private val profileUtil: ProfileUtil) : Validator(customErrorMessage) { diff --git a/core/validators/src/main/java/info/nightscout/core/validators/validators/FloatNumericRangeValidator.kt b/core/validators/src/main/java/info/nightscout/core/validators/validators/FloatNumericRangeValidator.kt index 759b169a11..b8531e4bcf 100644 --- a/core/validators/src/main/java/info/nightscout/core/validators/validators/FloatNumericRangeValidator.kt +++ b/core/validators/src/main/java/info/nightscout/core/validators/validators/FloatNumericRangeValidator.kt @@ -1,7 +1,7 @@ package info.nightscout.core.validators.validators import android.widget.EditText -import info.nightscout.shared.SafeParse +import app.aaps.interfaces.utils.SafeParse /** * A validator that returns true only if the input field contains only numbers diff --git a/implementation/src/main/java/info/nightscout/implementation/DefaultValueHelperImpl.kt b/implementation/src/main/java/info/nightscout/implementation/DefaultValueHelperImpl.kt index 5e81cd0a38..b781176330 100644 --- a/implementation/src/main/java/info/nightscout/implementation/DefaultValueHelperImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/DefaultValueHelperImpl.kt @@ -1,11 +1,11 @@ package info.nightscout.implementation import app.aaps.annotations.OpenForTesting -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt index b4d2aa73df..08d46a7454 100644 --- a/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt @@ -2,13 +2,13 @@ package info.nightscout.implementation import android.content.Context import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -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 import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt index 46b40aa3b4..751d0579cd 100644 --- a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt @@ -1,5 +1,21 @@ package info.nightscout.implementation +import app.aaps.interfaces.alerts.LocalAlertUtils +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.events.EventNewNotification import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.TherapyEvent @@ -8,22 +24,6 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -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 @@ -65,7 +65,10 @@ class LocalAlertUtilsImpl @Inject constructor( if (sp.getBoolean(info.nightscout.core.utils.R.string.key_enable_pump_unreachable_alert, true)) { aapsLogger.debug(LTag.CORE, "Generating pump unreachable alarm. lastConnection: " + dateUtil.dateAndTimeString(lastConnection) + " isStatusOutdated: " + isStatusOutdated) sp.putLong("nextPumpDisconnectedAlarm", System.currentTimeMillis() + pumpUnreachableThreshold()) - rxBus.send(EventNewNotification(Notification(Notification.PUMP_UNREACHABLE, rh.gs(info.nightscout.core.ui.R.string.pump_unreachable), Notification.URGENT).also { it.soundId = info.nightscout.core.ui.R.raw.alarm })) + rxBus.send(EventNewNotification(Notification(Notification.PUMP_UNREACHABLE, rh.gs(info.nightscout.core.ui.R.string.pump_unreachable), Notification.URGENT).also { + it.soundId = + info.nightscout.core.ui.R.raw.alarm + })) uel.log(Action.CAREPORTAL, Sources.Aaps, rh.gs(info.nightscout.core.ui.R.string.pump_unreachable), ValueWithUnit.TherapyEventType(TherapyEvent.Type.ANNOUNCEMENT)) if (sp.getBoolean(info.nightscout.core.utils.R.string.key_ns_create_announcements_from_errors, true)) disposable += repository.runTransaction(InsertTherapyEventAnnouncementTransaction(rh.gs(info.nightscout.core.ui.R.string.pump_unreachable))).subscribe() diff --git a/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt index 9188069b78..0fed971c9d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/TranslatorImpl.kt @@ -1,5 +1,7 @@ package info.nightscout.implementation +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.Translator import dagger.Reusable import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.TemporaryTarget @@ -7,8 +9,6 @@ import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.Translator -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject @Reusable @@ -107,10 +107,10 @@ class TranslatorImpl @Inject internal constructor( override fun translate(units: ValueWithUnit?): String = when (units) { is ValueWithUnit.Gram -> rh.gs(info.nightscout.core.ui.R.string.shortgram) - is ValueWithUnit.Hour -> rh.gs(info.nightscout.interfaces.R.string.shorthour) + is ValueWithUnit.Hour -> rh.gs(app.aaps.interfaces.R.string.shorthour) is ValueWithUnit.Insulin -> rh.gs(info.nightscout.core.ui.R.string.insulin_unit_shortname) is ValueWithUnit.Mgdl -> rh.gs(info.nightscout.core.ui.R.string.mgdl) - is ValueWithUnit.Minute -> rh.gs(info.nightscout.interfaces.R.string.shortminute) + is ValueWithUnit.Minute -> rh.gs(app.aaps.interfaces.R.string.shortminute) is ValueWithUnit.Mmoll -> rh.gs(info.nightscout.core.ui.R.string.mmol) is ValueWithUnit.Percent -> rh.gs(info.nightscout.core.ui.R.string.shortpercent) is ValueWithUnit.UnitPerHour -> rh.gs(info.nightscout.core.ui.R.string.profile_ins_units_per_hour) @@ -151,26 +151,26 @@ class TranslatorImpl @Inject internal constructor( TherapyEvent.Type.TEMPORARY_TARGET_CANCEL -> rh.gs(info.nightscout.core.ui.R.string.careportal_temporarytargetcancel) TherapyEvent.Type.APS_OFFLINE -> rh.gs(info.nightscout.core.ui.R.string.careportal_openapsoffline) TherapyEvent.Type.NS_MBG -> rh.gs(info.nightscout.core.ui.R.string.careportal_mbg) -/* - TherapyEvent.Type.TEMPORARY_BASAL -> TODO() - TherapyEvent.Type.TUBE_CHANGE -> TODO() - TherapyEvent.Type.FALLING_ASLEEP -> TODO() - TherapyEvent.Type.BATTERY_EMPTY -> TODO() - TherapyEvent.Type.RESERVOIR_EMPTY -> TODO() - TherapyEvent.Type.OCCLUSION -> TODO() - TherapyEvent.Type.PUMP_STOPPED -> TODO() - TherapyEvent.Type.PUMP_STARTED -> TODO() - TherapyEvent.Type.PUMP_PAUSED -> TODO() - TherapyEvent.Type.WAKING_UP -> TODO() - TherapyEvent.Type.SICKNESS -> TODO() - TherapyEvent.Type.STRESS -> TODO() - TherapyEvent.Type.PRE_PERIOD -> TODO() - TherapyEvent.Type.ALCOHOL -> TODO() - TherapyEvent.Type.CORTISONE -> TODO() - TherapyEvent.Type.FEELING_LOW -> TODO() - TherapyEvent.Type.FEELING_HIGH -> TODO() - TherapyEvent.Type.LEAKING_INFUSION_SET -> TODO() - */ + /* + TherapyEvent.Type.TEMPORARY_BASAL -> TODO() + TherapyEvent.Type.TUBE_CHANGE -> TODO() + TherapyEvent.Type.FALLING_ASLEEP -> TODO() + TherapyEvent.Type.BATTERY_EMPTY -> TODO() + TherapyEvent.Type.RESERVOIR_EMPTY -> TODO() + TherapyEvent.Type.OCCLUSION -> TODO() + TherapyEvent.Type.PUMP_STOPPED -> TODO() + TherapyEvent.Type.PUMP_STARTED -> TODO() + TherapyEvent.Type.PUMP_PAUSED -> TODO() + TherapyEvent.Type.WAKING_UP -> TODO() + TherapyEvent.Type.SICKNESS -> TODO() + TherapyEvent.Type.STRESS -> TODO() + TherapyEvent.Type.PRE_PERIOD -> TODO() + TherapyEvent.Type.ALCOHOL -> TODO() + TherapyEvent.Type.CORTISONE -> TODO() + TherapyEvent.Type.FEELING_LOW -> TODO() + TherapyEvent.Type.FEELING_HIGH -> TODO() + TherapyEvent.Type.LEAKING_INFUSION_SET -> TODO() + */ TherapyEvent.Type.NONE -> rh.gs(info.nightscout.core.ui.R.string.unknown) else -> rh.gs(info.nightscout.core.ui.R.string.unknown) diff --git a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt index ead7b57577..b6b50f42fd 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt @@ -1,12 +1,12 @@ package info.nightscout.implementation +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.utils.TrendCalculator import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.utils.TrendCalculator -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt index a195032371..bc98605c88 100644 --- a/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/UserEntryLoggerImpl.kt @@ -1,6 +1,12 @@ package info.nightscout.implementation import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.userEntry.UserEntryMapper +import app.aaps.interfaces.userEntry.ValueWithUnitMapper +import app.aaps.interfaces.utils.DateUtil import dagger.Reusable import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action @@ -8,12 +14,6 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.UserEntryTransaction -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.userEntry.UserEntryMapper -import info.nightscout.interfaces.userEntry.ValueWithUnitMapper -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/androidNotification/NotificationHolderImpl.kt b/implementation/src/main/java/info/nightscout/implementation/androidNotification/NotificationHolderImpl.kt index ffcc03bbf1..c1bf7c51bf 100644 --- a/implementation/src/main/java/info/nightscout/implementation/androidNotification/NotificationHolderImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/androidNotification/NotificationHolderImpl.kt @@ -8,10 +8,10 @@ import android.content.Context import android.content.Intent import androidx.core.app.NotificationCompat import androidx.core.app.TaskStackBuilder -import info.nightscout.interfaces.NotificationHolder -import info.nightscout.interfaces.ui.IconsProvider -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.notifications.NotificationHolder +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.ui.IconsProvider +import app.aaps.interfaces.ui.UiInteraction import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt b/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt index 05da2f0a3e..1ea086c50e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt +++ b/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt @@ -1,6 +1,22 @@ package info.nightscout.implementation.db import android.content.Context +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDeviceStatusChange +import app.aaps.interfaces.rx.events.EventEffectiveProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventExtendedBolusChange +import app.aaps.interfaces.rx.events.EventFoodDatabaseChanged +import app.aaps.interfaces.rx.events.EventNewBG +import app.aaps.interfaces.rx.events.EventNewHistoryData +import app.aaps.interfaces.rx.events.EventOfflineChange +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.rx.events.EventTempTargetChange +import app.aaps.interfaces.rx.events.EventTherapyEventChange +import app.aaps.interfaces.rx.events.EventTreatmentChange +import app.aaps.interfaces.ui.UiInteraction import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.Carbs @@ -15,22 +31,6 @@ import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDeviceStatusChange -import info.nightscout.rx.events.EventEffectiveProfileSwitchChanged -import info.nightscout.rx.events.EventExtendedBolusChange -import info.nightscout.rx.events.EventFoodDatabaseChanged -import info.nightscout.rx.events.EventNewBG -import info.nightscout.rx.events.EventNewHistoryData -import info.nightscout.rx.events.EventOfflineChange -import info.nightscout.rx.events.EventProfileSwitchChanged -import info.nightscout.rx.events.EventTempBasalChange -import info.nightscout.rx.events.EventTempTargetChange -import info.nightscout.rx.events.EventTherapyEventChange -import info.nightscout.rx.events.EventTreatmentChange -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import io.reactivex.rxjava3.disposables.Disposable import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt index 5bb7a7ee96..27a9704ee5 100644 --- a/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/db/PersistenceLayerImpl.kt @@ -1,5 +1,10 @@ package info.nightscout.implementation.db +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback import dagger.Reusable import dagger.android.HasAndroidInjector import info.nightscout.database.ValueWrapper @@ -13,11 +18,6 @@ import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorResultTransaction import info.nightscout.database.impl.transactions.InsertOrUpdateBolusTransaction import info.nightscout.database.impl.transactions.InsertOrUpdateCarbsTransaction -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt index ff7ea1f20b..b6bf5b0a4f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt +++ b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt @@ -1,5 +1,36 @@ package info.nightscout.implementation.di +import app.aaps.interfaces.alerts.LocalAlertUtils +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.logging.LoggerUtils +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.notifications.NotificationHolder +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.profiling.Profiler +import app.aaps.interfaces.protection.PasswordCheck +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.pump.BlePreCheck +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.pump.WarnColors +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.stats.DexcomTirCalculator +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.stats.TirCalculator +import app.aaps.interfaces.storage.Storage +import app.aaps.interfaces.ui.IconsProvider +import app.aaps.interfaces.userEntry.UserEntryPresentationHelper +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.Translator +import app.aaps.interfaces.utils.TrendCalculator import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector @@ -38,37 +69,6 @@ import info.nightscout.implementation.stats.TirCalculatorImpl import info.nightscout.implementation.storage.FileStorage import info.nightscout.implementation.userEntry.UserEntryPresentationHelperImpl import info.nightscout.implementation.utils.DecimalFormatterImpl -import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.NotificationHolder -import info.nightscout.interfaces.Translator -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.logging.LoggerUtils -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profiling.Profiler -import info.nightscout.interfaces.protection.PasswordCheck -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.pump.BlePreCheck -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.pump.WarnColors -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.interfaces.stats.DexcomTirCalculator -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.stats.TirCalculator -import info.nightscout.interfaces.storage.Storage -import info.nightscout.interfaces.ui.IconsProvider -import info.nightscout.interfaces.userEntry.UserEntryPresentationHelper -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.interfaces.utils.TrendCalculator -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper @Module( includes = [ diff --git a/implementation/src/main/java/info/nightscout/implementation/iob/GlucoseStatusProviderImpl.kt b/implementation/src/main/java/info/nightscout/implementation/iob/GlucoseStatusProviderImpl.kt index 939105e9ef..af39ba9075 100644 --- a/implementation/src/main/java/info/nightscout/implementation/iob/GlucoseStatusProviderImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/iob/GlucoseStatusProviderImpl.kt @@ -1,16 +1,16 @@ package info.nightscout.implementation.iob import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import dagger.Reusable import info.nightscout.core.iob.asRounded import info.nightscout.core.iob.log -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import kotlin.math.roundToLong diff --git a/implementation/src/main/java/info/nightscout/implementation/lifecycle/ProcessLifecycleListener.kt b/implementation/src/main/java/info/nightscout/implementation/lifecycle/ProcessLifecycleListener.kt index 3aef9345ee..19ee3e8ac6 100644 --- a/implementation/src/main/java/info/nightscout/implementation/lifecycle/ProcessLifecycleListener.kt +++ b/implementation/src/main/java/info/nightscout/implementation/lifecycle/ProcessLifecycleListener.kt @@ -2,7 +2,7 @@ package info.nightscout.implementation.lifecycle import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner -import info.nightscout.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.protection.ProtectionCheck import javax.inject.Inject class ProcessLifecycleListener @Inject constructor(private val protectionCheck: ProtectionCheck) : DefaultLifecycleObserver { diff --git a/implementation/src/main/java/info/nightscout/implementation/logging/LoggerUtilsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/logging/LoggerUtilsImpl.kt index 310e6da7a3..e0f7abc1cd 100644 --- a/implementation/src/main/java/info/nightscout/implementation/logging/LoggerUtilsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/logging/LoggerUtilsImpl.kt @@ -1,9 +1,9 @@ package info.nightscout.implementation.logging import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.logging.LoggerUtils +import app.aaps.interfaces.maintenance.PrefFileListProvider import dagger.Reusable -import info.nightscout.interfaces.logging.LoggerUtils -import info.nightscout.interfaces.maintenance.PrefFileListProvider import javax.inject.Inject /** diff --git a/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt b/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt index 8dabf9b375..5a8fbb26a6 100644 --- a/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/overview/OverviewDataImpl.kt @@ -4,6 +4,21 @@ import android.content.Context import androidx.annotation.AttrRes import androidx.annotation.ColorInt import androidx.annotation.DrawableRes +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.iob.CobInfo +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries @@ -25,21 +40,6 @@ import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.aps.AutosensData -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.iob.CobInfo -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.utils.DecimalFormatter -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 diff --git a/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt b/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt index bfb809e74a..ad0ea08d66 100644 --- a/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt +++ b/implementation/src/main/java/info/nightscout/implementation/plugin/PluginStore.kt @@ -1,25 +1,25 @@ package info.nightscout.implementation.plugin -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.Overview -import info.nightscout.interfaces.aps.APS -import info.nightscout.interfaces.aps.Sensitivity -import info.nightscout.interfaces.constraints.Objectives -import info.nightscout.interfaces.constraints.Safety -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileSource -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.smoothing.Smoothing -import info.nightscout.interfaces.source.BgSource -import info.nightscout.interfaces.sync.NsClient -import info.nightscout.interfaces.sync.Sync -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.aps.APS +import app.aaps.interfaces.aps.Sensitivity +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.constraints.Objectives +import app.aaps.interfaces.constraints.Safety +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.overview.Overview +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileSource +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.smoothing.Smoothing +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.sync.NsClient +import app.aaps.interfaces.sync.Sync import javax.inject.Inject import javax.inject.Singleton @@ -188,7 +188,7 @@ class PluginStore @Inject constructor( override val activePump: Pump get() = activePumpStore - // Following line can be used only during initialization + // Following line can be used only during initialization ?: getTheOneEnabledInArray(getSpecificPluginsList(PluginType.PUMP), PluginType.PUMP) as Pump? ?: checkNotNull(activePumpStore) { "No pump selected" } diff --git a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt b/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt index 5614ccb986..9ac7ab2821 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/profile/ProfileFunctionImpl.kt @@ -1,5 +1,22 @@ package info.nightscout.implementation.profile +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventEffectiveProfileSwitchChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.fromConstant import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.fabric.FabricPrivacy @@ -7,23 +24,6 @@ import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.ProfileSwitch import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertOrUpdateProfileSwitch -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profile.ProfileStore -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventEffectiveProfileSwitchChanged -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 diff --git a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileStoreObject.kt b/implementation/src/main/java/info/nightscout/implementation/profile/ProfileStoreObject.kt index 8025ad4e70..bfe594a6c9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileStoreObject.kt +++ b/implementation/src/main/java/info/nightscout/implementation/profile/ProfileStoreObject.kt @@ -1,19 +1,19 @@ package info.nightscout.implementation.profile import androidx.collection.ArrayMap +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileStore +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileStore -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileUtilImpl.kt b/implementation/src/main/java/info/nightscout/implementation/profile/ProfileUtilImpl.kt index 4ed5ccf970..03d0226616 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profile/ProfileUtilImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/profile/ProfileUtilImpl.kt @@ -1,9 +1,9 @@ package info.nightscout.implementation.profile -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DecimalFormatter import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/profiling/ProfilerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/profiling/ProfilerImpl.kt index c8ae0e540e..3fbb062925 100644 --- a/implementation/src/main/java/info/nightscout/implementation/profiling/ProfilerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/profiling/ProfilerImpl.kt @@ -1,10 +1,10 @@ package info.nightscout.implementation.profiling import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profiling.Profiler import dagger.Reusable -import info.nightscout.interfaces.profiling.Profiler -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject @OpenForTesting diff --git a/implementation/src/main/java/info/nightscout/implementation/protection/BiometricCheck.kt b/implementation/src/main/java/info/nightscout/implementation/protection/BiometricCheck.kt index 9d6c2648e8..5ff4f08e0b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/protection/BiometricCheck.kt +++ b/implementation/src/main/java/info/nightscout/implementation/protection/BiometricCheck.kt @@ -17,12 +17,14 @@ import androidx.biometric.BiometricPrompt.ERROR_USER_CANCELED import androidx.biometric.BiometricPrompt.ERROR_VENDOR import androidx.biometric.BiometricPrompt.PromptInfo import androidx.fragment.app.FragmentActivity +import app.aaps.interfaces.extensions.runOnUiThread +import app.aaps.interfaces.protection.PasswordCheck +import info.nightscout.core.ui.R import info.nightscout.core.ui.toast.ToastUtils -import info.nightscout.interfaces.protection.PasswordCheck -import info.nightscout.shared.extensions.runOnUiThread import java.util.concurrent.Executors object BiometricCheck { + fun biometricPrompt(activity: FragmentActivity, title: Int, ok: Runnable?, cancel: Runnable? = null, fail: Runnable? = null, passwordCheck: PasswordCheck) { val executor = Executors.newSingleThreadExecutor() @@ -40,7 +42,7 @@ object BiometricCheck { ToastUtils.errorToast(activity.baseContext, errString.toString()) // fallback to master password runOnUiThread { - passwordCheck.queryPassword(activity, info.nightscout.core.ui.R.string.master_password, info.nightscout.core.utils.R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) + passwordCheck.queryPassword(activity, R.string.master_password, info.nightscout.core.utils.R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) } } @@ -52,7 +54,7 @@ object BiometricCheck { // no pin set // fallback to master password runOnUiThread { - passwordCheck.queryPassword(activity, info.nightscout.core.ui.R.string.master_password, info.nightscout.core.utils.R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) + passwordCheck.queryPassword(activity, R.string.master_password, info.nightscout.core.utils.R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) } } @@ -61,7 +63,7 @@ object BiometricCheck { ERROR_HW_NOT_PRESENT, ERROR_NO_BIOMETRICS -> runOnUiThread { - passwordCheck.queryPassword(activity, info.nightscout.core.ui.R.string.master_password, info.nightscout.core.utils.R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) + passwordCheck.queryPassword(activity, R.string.master_password, info.nightscout.core.utils.R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) } } } @@ -81,8 +83,8 @@ object BiometricCheck { val promptInfo = PromptInfo.Builder() .setTitle(activity.getString(title)) - .setDescription(activity.getString(info.nightscout.core.ui.R.string.biometric_title)) - .setNegativeButtonText(activity.getString(info.nightscout.core.ui.R.string.cancel)) // not possible with setDeviceCredentialAllowed + .setDescription(activity.getString(R.string.biometric_title)) + .setNegativeButtonText(activity.getString(R.string.cancel)) // not possible with setDeviceCredentialAllowed // .setDeviceCredentialAllowed(true) // setDeviceCredentialAllowed creates new activity when PIN is requested, activity.fragmentManager crash afterwards .build() diff --git a/implementation/src/main/java/info/nightscout/implementation/protection/PasswordCheckImpl.kt b/implementation/src/main/java/info/nightscout/implementation/protection/PasswordCheckImpl.kt index fb59c3654a..20abde4276 100644 --- a/implementation/src/main/java/info/nightscout/implementation/protection/PasswordCheckImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/protection/PasswordCheckImpl.kt @@ -11,13 +11,13 @@ import android.view.inputmethod.InputMethodManager import android.widget.EditText import android.widget.TextView import androidx.annotation.StringRes +import app.aaps.interfaces.protection.PasswordCheck +import app.aaps.interfaces.sharedPreferences.SP import com.google.android.material.dialog.MaterialAlertDialogBuilder import dagger.Reusable import info.nightscout.core.main.R import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.CryptoUtil -import info.nightscout.interfaces.protection.PasswordCheck -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject @Reusable @@ -141,7 +141,8 @@ class PasswordCheckImpl @Inject constructor( } } - .setNegativeButton(context.getString(info.nightscout.core.ui.R.string.cancel) + .setNegativeButton( + context.getString(info.nightscout.core.ui.R.string.cancel) ) { dialog, _ -> val msg = if (pinInput) info.nightscout.core.ui.R.string.pin_not_changed else info.nightscout.core.ui.R.string.password_not_changed ToastUtils.infoToast(context, msg) @@ -192,7 +193,8 @@ class PasswordCheckImpl @Inject constructor( .setCancelable(false) .setCustomTitle(info.nightscout.core.ui.dialogs.AlertDialogHelper.buildCustomTitle(context, context.getString(labelId), R.drawable.ic_header_key)) .setPositiveButton(context.getString(info.nightscout.core.ui.R.string.ok)) { _, _ -> validatePassword() } - .setNegativeButton(context.getString(info.nightscout.core.ui.R.string.cancel) + .setNegativeButton( + context.getString(info.nightscout.core.ui.R.string.cancel) ) { dialog, _ -> cancel?.invoke() dialog.cancel() diff --git a/implementation/src/main/java/info/nightscout/implementation/protection/ProtectionCheckImpl.kt b/implementation/src/main/java/info/nightscout/implementation/protection/ProtectionCheckImpl.kt index 3515ec4a68..fe4f46d44e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/protection/ProtectionCheckImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/protection/ProtectionCheckImpl.kt @@ -1,11 +1,11 @@ package info.nightscout.implementation.protection import androidx.fragment.app.FragmentActivity +import app.aaps.interfaces.protection.PasswordCheck +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.Reusable -import info.nightscout.interfaces.protection.PasswordCheck -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import java.util.concurrent.TimeUnit import javax.inject.Inject @@ -27,22 +27,26 @@ class ProtectionCheckImpl @Inject constructor( private val pinsResourceIDs = listOf( info.nightscout.core.utils.R.string.key_settings_pin, info.nightscout.core.utils.R.string.key_application_pin, - info.nightscout.core.utils.R.string.key_bolus_pin) + info.nightscout.core.utils.R.string.key_bolus_pin + ) private val protectionTypeResourceIDs = listOf( info.nightscout.core.utils.R.string.key_settings_protection, info.nightscout.core.utils.R.string.key_application_protection, - info.nightscout.core.utils.R.string.key_bolus_protection) + info.nightscout.core.utils.R.string.key_bolus_protection + ) private val titlePassResourceIDs = listOf( info.nightscout.core.ui.R.string.settings_password, info.nightscout.core.ui.R.string.application_password, - info.nightscout.core.ui.R.string.bolus_password) + info.nightscout.core.ui.R.string.bolus_password + ) private val titlePinResourceIDs = listOf( info.nightscout.core.ui.R.string.settings_pin, info.nightscout.core.ui.R.string.application_pin, - info.nightscout.core.ui.R.string.bolus_pin) + info.nightscout.core.ui.R.string.bolus_pin + ) override fun isLocked(protection: ProtectionCheck.Protection): Boolean { if (activeSession(protection)) { @@ -89,7 +93,13 @@ class ProtectionCheckImpl @Inject constructor( BiometricCheck.biometricPrompt(activity, titlePassResourceIDs[protection.ordinal], { onOk(protection); ok?.run() }, cancel, fail, passwordCheck) ProtectionCheck.ProtectionType.MASTER_PASSWORD -> - passwordCheck.queryPassword(activity, info.nightscout.core.ui.R.string.master_password, info.nightscout.core.utils.R.string.key_master_password, { onOk(protection); ok?.run() }, { cancel?.run() }, { fail?.run() }) + passwordCheck.queryPassword( + activity, + info.nightscout.core.ui.R.string.master_password, + info.nightscout.core.utils.R.string.key_master_password, + { onOk(protection); ok?.run() }, + { cancel?.run() }, + { fail?.run() }) ProtectionCheck.ProtectionType.CUSTOM_PASSWORD -> passwordCheck.queryPassword( diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/BlePreCheckImpl.kt b/implementation/src/main/java/info/nightscout/implementation/pump/BlePreCheckImpl.kt index 13517134fc..f9cbb8a6c2 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/BlePreCheckImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/BlePreCheckImpl.kt @@ -11,10 +11,10 @@ import android.provider.Settings import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat +import app.aaps.interfaces.pump.BlePreCheck +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.extensions.safeEnable -import info.nightscout.interfaces.pump.BlePreCheck -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageImpl.kt b/implementation/src/main/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageImpl.kt index 640218c596..b43c667181 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageImpl.kt @@ -1,16 +1,16 @@ package info.nightscout.implementation.pump import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.T import com.google.gson.Gson import com.google.gson.reflect.TypeToken import info.nightscout.implementation.R -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -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 import javax.inject.Singleton import kotlin.math.abs diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 4281353859..13f82440fe 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -1,5 +1,20 @@ package info.nightscout.implementation.pump +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.VirtualPump +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.events.EventNewNotification import info.nightscout.core.pump.fromDbPumpType import info.nightscout.core.pump.toDbPumpType @@ -31,21 +46,6 @@ import info.nightscout.database.impl.transactions.SyncPumpExtendedBolusTransacti import info.nightscout.database.impl.transactions.SyncPumpTemporaryBasalTransaction import info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransaction import info.nightscout.database.impl.transactions.SyncTemporaryBasalWithTempIdTransaction -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.VirtualPump -import info.nightscout.interfaces.pump.defs.PumpType -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 diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/TemporaryBasalStorageImpl.kt b/implementation/src/main/java/info/nightscout/implementation/pump/TemporaryBasalStorageImpl.kt index f9fb5d8b75..cf458c3c03 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/TemporaryBasalStorageImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/TemporaryBasalStorageImpl.kt @@ -1,11 +1,11 @@ package info.nightscout.implementation.pump import app.aaps.annotations.OpenForTesting -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.T +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.utils.T import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt index 9074b60dab..9679ed9841 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/WarnColorsImpl.kt @@ -1,11 +1,11 @@ package info.nightscout.implementation.pump import android.widget.TextView +import app.aaps.interfaces.pump.WarnColors +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.extensions.isOlderThan import info.nightscout.database.entities.TherapyEvent -import info.nightscout.interfaces.pump.WarnColors -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index 88256550f4..a62d504d00 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -8,6 +8,36 @@ import android.os.SystemClock import android.text.Spanned import androidx.appcompat.app.AppCompatActivity import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.queue.Command.CommandType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.queue.CustomCommand +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissBolusProgressIfRunning +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventMobileToWear +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.events.EventNewNotification @@ -41,35 +71,6 @@ import info.nightscout.implementation.queue.commands.CommandStopPump import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute import info.nightscout.implementation.queue.commands.CommandTempBasalPercent import info.nightscout.implementation.queue.commands.CommandUpdateTime -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.queue.Command.CommandType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissBolusProgressIfRunning -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventMobileToWear -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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.LinkedList @@ -323,7 +324,7 @@ class CommandQueueImplementation @Inject constructor( // Notify Wear about upcoming bolus rxBus.send( EventMobileToWear( - info.nightscout.rx.weardata.EventData.BolusProgress( + EventData.BolusProgress( percent = 0, status = rh.gs(info.nightscout.core.ui.R.string.goingtodeliver, detailedBolusInfo.insulin) ) diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt b/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt index d8ab5b1b1f..020190d08b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt @@ -5,22 +5,23 @@ import android.content.Context import android.os.Build import android.os.PowerManager import android.os.SystemClock +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissBolusProgressIfRunning +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.T +import info.nightscout.core.ui.R import info.nightscout.core.utils.extensions.safeDisable import info.nightscout.core.utils.extensions.safeEnable -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissBolusProgressIfRunning -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventQueueChanged -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 class QueueThread internal constructor( private val queue: CommandQueue, @@ -62,7 +63,7 @@ class QueueThread internal constructor( } if (!pump.isConnected() && secondsElapsed > Constants.PUMP_MAX_CONNECTION_TIME_IN_SECONDS) { rxBus.send(EventDismissBolusProgressIfRunning(null, null)) - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.core.ui.R.string.connectiontimedout))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.connectiontimedout))) aapsLogger.debug(LTag.PUMPQUEUE, "timed out") pump.stopConnecting() diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt index d73072cbb8..112e9db10e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt @@ -1,15 +1,15 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.BolusProgressData +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissBolusProgressIfRunning import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.BolusProgressData -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissBolusProgressIfRunning -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandBolus( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelExtendedBolus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelExtendedBolus.kt index 0a94b624a5..faab64bbfc 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelExtendedBolus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelExtendedBolus.kt @@ -1,14 +1,14 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject -class CommandCancelExtendedBolus constructor( +class CommandCancelExtendedBolus( injector: HasAndroidInjector, callback: Callback? ) : Command(injector, CommandType.EXTENDEDBOLUS, callback) { diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelTempBasal.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelTempBasal.kt index 4a56073563..e54f7f6275 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelTempBasal.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCancelTempBasal.kt @@ -1,11 +1,11 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandCancelTempBasal( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandClearAlarms.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandClearAlarms.kt index 00e5bb1ff0..6c3026450a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandClearAlarms.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandClearAlarms.kt @@ -1,14 +1,12 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Medtrum +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Dana -import info.nightscout.interfaces.pump.Diaconn -import info.nightscout.interfaces.pump.Medtrum -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandClearAlarms( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCustomCommand.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCustomCommand.kt index ef1c1211cb..9d128c5367 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCustomCommand.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandCustomCommand.kt @@ -1,12 +1,12 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.queue.CustomCommand import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandCustomCommand( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandDeactivate.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandDeactivate.kt index eef55c1ecc..f8ad584f49 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandDeactivate.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandDeactivate.kt @@ -1,14 +1,12 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Medtrum +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Dana -import info.nightscout.interfaces.pump.Diaconn -import info.nightscout.interfaces.pump.Medtrum -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandDeactivate( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandExtendedBolus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandExtendedBolus.kt index f506ffb8b1..4318220043 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandExtendedBolus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandExtendedBolus.kt @@ -1,14 +1,14 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject -class CommandExtendedBolus constructor( +class CommandExtendedBolus( injector: HasAndroidInjector, private val insulin: Double, private val durationInMinutes: Int, diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt index 73aaa2659c..ee61866f12 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt @@ -1,15 +1,15 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Insight +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Insight -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject -class CommandInsightSetTBROverNotification constructor( +class CommandInsightSetTBROverNotification( injector: HasAndroidInjector, private val enabled: Boolean, callback: Callback? diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt index 16475adf4f..8e7edae76e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt @@ -1,14 +1,14 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Dana +import app.aaps.interfaces.pump.Diaconn +import app.aaps.interfaces.pump.Medtrum +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Dana -import info.nightscout.interfaces.pump.Diaconn -import info.nightscout.interfaces.pump.Medtrum -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandLoadEvents( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt index c2fe277201..be9fadd2b9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt @@ -1,13 +1,13 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Dana +import app.aaps.interfaces.pump.Diaconn +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Dana -import info.nightscout.interfaces.pump.Diaconn -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandLoadHistory( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadTDDs.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadTDDs.kt index c389040505..d8e0ed47ab 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadTDDs.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadTDDs.kt @@ -1,11 +1,11 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandLoadTDDs( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt index 93f7451e22..7eccb2e9fd 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt @@ -1,13 +1,13 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.alerts.LocalAlertUtils +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.T import javax.inject.Inject class CommandReadStatus( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt index b834ada838..e1ed613aa1 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt @@ -1,15 +1,15 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import javax.inject.Inject class CommandSMBBolus( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt index eae3887c20..d33308c88a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt @@ -1,21 +1,21 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil import javax.inject.Inject -class CommandSetProfile constructor( +class CommandSetProfile( injector: HasAndroidInjector, private val profile: Profile, private val hasNsId: Boolean, diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt index cb120cf32a..f7a82795e5 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt @@ -1,14 +1,14 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Dana +import app.aaps.interfaces.pump.Diaconn +import app.aaps.interfaces.pump.Medtrum +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Dana -import info.nightscout.interfaces.pump.Diaconn -import info.nightscout.interfaces.pump.Medtrum -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandSetUserSettings( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt index d6a0c2f780..fb275cbcbf 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt @@ -1,12 +1,12 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Insight +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Insight -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandStartPump( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt index 6bc28bfa52..bf959c8b5c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt @@ -1,12 +1,12 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Insight +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Insight -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandStopPump( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt index 706cea6ace..6d3e8bbfd4 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt @@ -1,13 +1,13 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandTempBasalAbsolute( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt index 2416e74adc..05b00d5c8d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt @@ -1,13 +1,13 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandTempBasalPercent( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandUpdateTime.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandUpdateTime.kt index a8b5c5654b..1d7c90e660 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandUpdateTime.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandUpdateTime.kt @@ -1,14 +1,12 @@ package info.nightscout.implementation.queue.commands +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Medtrum +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Dana -import info.nightscout.interfaces.pump.Diaconn -import info.nightscout.interfaces.pump.Medtrum -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.rx.logging.LTag import javax.inject.Inject class CommandUpdateTime( diff --git a/implementation/src/main/java/info/nightscout/implementation/receivers/NetworkChangeReceiver.kt b/implementation/src/main/java/info/nightscout/implementation/receivers/NetworkChangeReceiver.kt index fe305d3615..fb5973cecd 100644 --- a/implementation/src/main/java/info/nightscout/implementation/receivers/NetworkChangeReceiver.kt +++ b/implementation/src/main/java/info/nightscout/implementation/receivers/NetworkChangeReceiver.kt @@ -9,16 +9,17 @@ import android.net.wifi.SupplicantState import android.net.wifi.WifiManager import android.os.Handler import android.os.HandlerThread +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNetworkChange import dagger.android.DaggerBroadcastReceiver import info.nightscout.core.utils.receivers.StringUtils -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNetworkChange -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject class NetworkChangeReceiver : DaggerBroadcastReceiver() { + @Inject lateinit var rxBus: RxBus @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var receiverStatusStore: ReceiverStatusStore diff --git a/implementation/src/main/java/info/nightscout/implementation/receivers/ReceiverStatusStoreImpl.kt b/implementation/src/main/java/info/nightscout/implementation/receivers/ReceiverStatusStoreImpl.kt index bec9d31cb5..ffb4987724 100644 --- a/implementation/src/main/java/info/nightscout/implementation/receivers/ReceiverStatusStoreImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/receivers/ReceiverStatusStoreImpl.kt @@ -3,10 +3,10 @@ package info.nightscout.implementation.receivers import android.content.Context import android.content.Intent import app.aaps.annotations.OpenForTesting -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventChargingState -import info.nightscout.rx.events.EventNetworkChange +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventChargingState +import app.aaps.interfaces.rx.events.EventNetworkChange import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/resources/IconsProviderImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/resources/IconsProviderImplementation.kt index 5b7ad08334..c97bf5a7f1 100644 --- a/implementation/src/main/java/info/nightscout/implementation/resources/IconsProviderImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/resources/IconsProviderImplementation.kt @@ -1,8 +1,8 @@ package info.nightscout.implementation.resources +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.ui.IconsProvider import info.nightscout.implementation.R -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.ui.IconsProvider import javax.inject.Inject import javax.inject.Singleton @@ -11,8 +11,8 @@ class IconsProviderImplementation @Inject constructor(private val config: Config override fun getIcon(): Int = when { - config.NSCLIENT2 -> info.nightscout.core.ui.R.mipmap.ic_blueowl - config.NSCLIENT1 -> info.nightscout.core.ui.R.mipmap.ic_yellowowl + config.NSCLIENT2 -> info.nightscout.core.ui.R.mipmap.ic_blueowl + config.NSCLIENT1 -> info.nightscout.core.ui.R.mipmap.ic_yellowowl config.PUMPCONTROL -> info.nightscout.core.ui.R.mipmap.ic_pumpcontrol else -> info.nightscout.core.ui.R.mipmap.ic_launcher } diff --git a/implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt b/implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt index 145a9b240b..d5d2c17de7 100644 --- a/implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt @@ -18,10 +18,10 @@ import androidx.annotation.StringRes import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.view.ContextThemeWrapper import androidx.core.content.ContextCompat +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.getThemeColor import info.nightscout.core.ui.locale.LocaleHelper import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.shared.interfaces.ResourceHelper import java.util.Locale import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt index b9317b4b52..cbdcb3f94e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt @@ -4,13 +4,13 @@ import android.annotation.SuppressLint import android.content.Context import android.view.ViewGroup import android.widget.TableLayout +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.stats.DexcomTIR +import app.aaps.interfaces.stats.DexcomTirCalculator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.T import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.stats.DexcomTIR -import info.nightscout.interfaces.stats.DexcomTirCalculator -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt index 88c58a1053..3b958e2193 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt @@ -6,10 +6,10 @@ import android.graphics.Typeface import android.view.Gravity import android.widget.TableRow import android.widget.TextView +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.stats.DexcomTIR import info.nightscout.implementation.R -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.stats.DexcomTIR -import info.nightscout.shared.interfaces.ProfileUtil import java.util.Calendar import kotlin.math.pow import kotlin.math.roundToInt @@ -146,10 +146,25 @@ class DexcomTirImpl : DexcomTIR { val lp = TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1f) row.layoutParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT) row.gravity = Gravity.CENTER_HORIZONTAL - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0 }; text = context.getString(info.nightscout.core.ui.R.string.formatPercent, veryLowPct()) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = context.getString(info.nightscout.core.ui.R.string.formatPercent, lowPct()) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = context.getString(info.nightscout.core.ui.R.string.formatPercent, inRangePct()) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = context.getString(info.nightscout.core.ui.R.string.formatPercent, highPct()) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 4 }; text = context.getString(info.nightscout.core.ui.R.string.formatPercent, veryHighPct()) }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0 }; text = + context.getString(info.nightscout.core.ui.R.string.formatPercent, veryLowPct()) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = + context.getString(info.nightscout.core.ui.R.string.formatPercent, lowPct()) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = + context.getString(info.nightscout.core.ui.R.string.formatPercent, inRangePct()) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = + context.getString(info.nightscout.core.ui.R.string.formatPercent, highPct()) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 4 }; text = + context.getString(info.nightscout.core.ui.R.string.formatPercent, veryHighPct()) + }) } } diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt index 8b6ca19cdf..35a77fb76c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt @@ -9,21 +9,21 @@ import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView import androidx.core.util.size +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.T import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.TotalDailyDose import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton @@ -164,7 +164,7 @@ class TddCalculatorImpl @Inject constructor( } todayTdd?.let { layout.addView(TextView(context).apply { - text = rh.gs(info.nightscout.interfaces.R.string.today) + text = rh.gs(app.aaps.interfaces.R.string.today) setTypeface(typeface, Typeface.BOLD) gravity = Gravity.CENTER_HORIZONTAL setTextAppearance(android.R.style.TextAppearance_Material_Medium) diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt index 0b04b007a1..d3924f61bf 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt @@ -8,15 +8,15 @@ import android.view.Gravity import android.view.ViewGroup import android.widget.TableLayout import android.widget.TextView +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.stats.TIR +import app.aaps.interfaces.stats.TirCalculator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.T import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.stats.TIR -import info.nightscout.interfaces.stats.TirCalculator -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt index 4eed035b41..628178828e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt @@ -5,10 +5,10 @@ import android.content.Context import android.view.Gravity import android.widget.TableRow import android.widget.TextView +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.stats.TIR +import app.aaps.interfaces.utils.DateUtil import info.nightscout.implementation.R -import info.nightscout.interfaces.stats.TIR -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil class TirImpl(override val date: Long, override val lowThreshold: Double, override val highThreshold: Double) : TIR { @@ -45,7 +45,10 @@ class TirImpl(override val date: Long, override val lowThreshold: Double, overri val lp = TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT) header.layoutParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT) header.gravity = Gravity.CENTER_HORIZONTAL - header.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0; weight = 1f }; text = rh.gs(info.nightscout.core.ui.R.string.date) }) + header.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0; weight = 1f }; text = + rh.gs(info.nightscout.core.ui.R.string.date) + }) header.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1; weight = 1f }; text = rh.gs(R.string.below) }) header.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2; weight = 1f }; text = rh.gs(R.string.in_range) }) header.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3; weight = 1f }; text = rh.gs(R.string.above) }) @@ -58,9 +61,18 @@ class TirImpl(override val date: Long, override val lowThreshold: Double, overri row.layoutParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT) row.gravity = Gravity.CENTER_HORIZONTAL row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0 }; text = dateUtil.dateStringShort(date) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = rh.gs(info.nightscout.core.ui.R.string.formatPercent, belowPct()) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = rh.gs(info.nightscout.core.ui.R.string.formatPercent, inRangePct()) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = rh.gs(info.nightscout.core.ui.R.string.formatPercent, abovePct()) }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = + rh.gs(info.nightscout.core.ui.R.string.formatPercent, belowPct()) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = + rh.gs(info.nightscout.core.ui.R.string.formatPercent, inRangePct()) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = + rh.gs(info.nightscout.core.ui.R.string.formatPercent, abovePct()) + }) } @SuppressLint("SetTextI18n") @@ -69,9 +81,21 @@ class TirImpl(override val date: Long, override val lowThreshold: Double, overri val lp = TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT, 1f) row.layoutParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT) row.gravity = Gravity.CENTER_HORIZONTAL - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0 }; text = "%02d".format(days) + " " + rh.gs(info.nightscout.interfaces.R.string.days) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = rh.gs(info.nightscout.core.ui.R.string.formatPercent, belowPct()) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = rh.gs(info.nightscout.core.ui.R.string.formatPercent, inRangePct()) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = rh.gs(info.nightscout.core.ui.R.string.formatPercent, abovePct()) }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0 }; text = + "%02d".format(days) + " " + rh.gs(app.aaps.interfaces.R.string.days) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = + rh.gs(info.nightscout.core.ui.R.string.formatPercent, belowPct()) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = + rh.gs(info.nightscout.core.ui.R.string.formatPercent, inRangePct()) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = + rh.gs(info.nightscout.core.ui.R.string.formatPercent, abovePct()) + }) } } diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt index ce57b0bdc2..d0177dbb38 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TotalDailyDoseExtension.kt @@ -5,10 +5,10 @@ import android.content.Context import android.view.Gravity import android.widget.TableRow import android.widget.TextView +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil import info.nightscout.database.entities.TotalDailyDose import info.nightscout.implementation.R -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil val TotalDailyDose.total get() = if (totalAmount > 0) totalAmount else basalAmount + bolusAmount @@ -37,13 +37,26 @@ fun TotalDailyDose.toTableRow(context: Context, rh: ResourceHelper, dateUtil: Da row.layoutParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT) row.gravity = Gravity.CENTER_HORIZONTAL row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0 }; text = dateUtil.dateStringShort(timestamp) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, total) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, bolusAmount) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, basalAmount) }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = + rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, total) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = + rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, bolusAmount) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = + rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, basalAmount) + }) row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 4 }; text = rh.gs(info.nightscout.core.ui.R.string.formatPercent, basalPct) }) if (includeCarbs) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 5 }; text = rh.gs(info.nightscout.core.main.R.string.format_carbs, carbs - .toInt()) }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 5 }; text = rh.gs( + info.nightscout.core.main.R.string.format_carbs, carbs + .toInt() + ) + }) } } @@ -54,13 +67,29 @@ fun TotalDailyDose.toTableRow(context: Context, rh: ResourceHelper, days: Int, i if ((total.isNaN() || bolusAmount.isNaN() || basalAmount.isNaN() || carbs.isNaN()).not()) { row.layoutParams = TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT) row.gravity = Gravity.CENTER_HORIZONTAL - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0 }; text = "%02d".format(days) + " " + rh.gs(info.nightscout.interfaces.R.string.days) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, total) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, bolusAmount) }) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, basalAmount) }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 0 }; text = + "%02d".format(days) + " " + rh.gs(app.aaps.interfaces.R.string.days) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 1 }; text = + rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, total) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 2 }; text = + rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, bolusAmount) + }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 3 }; text = + rh.gs(info.nightscout.core.ui.R.string.format_insulin_units1, basalAmount) + }) row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 4 }; text = rh.gs(info.nightscout.core.ui.R.string.formatPercent, basalPct) }) if (includeCarbs) - row.addView(TextView(context).apply { gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 5 }; text = rh.gs(info.nightscout.core.main.R.string.format_carbs, carbs - .toInt()) }) + row.addView(TextView(context).apply { + gravity = Gravity.CENTER_HORIZONTAL; layoutParams = lp.apply { column = 5 }; text = rh.gs( + info.nightscout.core.main.R.string.format_carbs, carbs + .toInt() + ) + }) } } diff --git a/implementation/src/main/java/info/nightscout/implementation/storage/FileStorage.kt b/implementation/src/main/java/info/nightscout/implementation/storage/FileStorage.kt index 1af639aa1c..7b4354757b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/storage/FileStorage.kt +++ b/implementation/src/main/java/info/nightscout/implementation/storage/FileStorage.kt @@ -1,12 +1,12 @@ package info.nightscout.implementation.storage -import info.nightscout.interfaces.storage.Storage +import app.aaps.interfaces.storage.Storage import java.io.File import javax.inject.Inject import javax.inject.Singleton @Singleton -class FileStorage @Inject constructor(): Storage { +class FileStorage @Inject constructor() : Storage { override fun getFileContents(file: File): String { return file.readText() diff --git a/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt b/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt index 00ac6dd1c7..3a6e7294f5 100644 --- a/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/userEntry/UserEntryPresentationHelperImpl.kt @@ -1,6 +1,14 @@ package info.nightscout.implementation.userEntry import android.text.Spanned +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.userEntry.UserEntryPresentationHelper +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.Translator import dagger.Reusable import info.nightscout.core.main.R import info.nightscout.core.utils.HtmlHelper @@ -9,14 +17,6 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.ColorGroup import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.Translator -import info.nightscout.interfaces.userEntry.UserEntryPresentationHelper -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import javax.inject.Inject @Reusable @@ -170,8 +170,8 @@ class UserEntryPresentationHelperImpl @Inject constructor( csvString(info.nightscout.core.ui.R.string.insulin_unit_shortname), csvString(info.nightscout.core.ui.R.string.profile_ins_units_per_hour), csvString(info.nightscout.core.ui.R.string.shortpercent), - csvString(info.nightscout.interfaces.R.string.shorthour), - csvString(info.nightscout.interfaces.R.string.shortminute), + csvString(app.aaps.interfaces.R.string.shorthour), + csvString(app.aaps.interfaces.R.string.shortminute), csvString(info.nightscout.core.ui.R.string.ue_none) ) + "\n" diff --git a/implementation/src/main/java/info/nightscout/implementation/utils/DecimalFormatterImpl.kt b/implementation/src/main/java/info/nightscout/implementation/utils/DecimalFormatterImpl.kt index dde9b43d80..8fde6491d9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/utils/DecimalFormatterImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/utils/DecimalFormatterImpl.kt @@ -1,7 +1,7 @@ package info.nightscout.implementation.utils -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DecimalFormatter import java.text.DecimalFormat import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt b/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt index 822eeb5929..2b0ed6d57c 100644 --- a/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/iob/GlucoseStatusTest.kt @@ -1,15 +1,15 @@ package info.nightscout.implementation.iob +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.core.iob.asRounded import info.nightscout.core.iob.log import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.shared.utils.T import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt index 4307bdf53b..56b9370bef 100644 --- a/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/overview/OverviewDataImplTest.kt @@ -1,15 +1,15 @@ package info.nightscout.implementation.overview +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.shared.utils.T import io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileStoreTest.kt b/implementation/src/test/java/info/nightscout/implementation/profile/ProfileStoreTest.kt index 84b8ac7ed2..68d6e73e68 100644 --- a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileStoreTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/profile/ProfileStoreTest.kt @@ -1,8 +1,8 @@ package info.nightscout.implementation.profile +import app.aaps.interfaces.profile.PureProfile import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.profile.PureProfile import org.junit.jupiter.api.Test internal class ProfileStoreTest : TestBaseWithProfile() { diff --git a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt index afebff8fad..ec89e53e74 100644 --- a/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/profile/ProfileUtilImplTest.kt @@ -1,12 +1,12 @@ package info.nightscout.implementation.profile +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.GlucoseValue import info.nightscout.implementation.utils.DecimalFormatterImpl -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/implementation/src/test/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageTest.kt b/implementation/src/test/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageTest.kt index fff2fa0267..1f1c23656f 100644 --- a/implementation/src/test/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/pump/DetailedBolusInfoStorageTest.kt @@ -1,11 +1,11 @@ package info.nightscout.implementation.pump +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import info.nightscout.implementation.R -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/implementation/src/test/java/info/nightscout/implementation/pump/TemporaryBasalStorageTest.kt b/implementation/src/test/java/info/nightscout/implementation/pump/TemporaryBasalStorageTest.kt index b9cdb340ae..ae4d8a20da 100644 --- a/implementation/src/test/java/info/nightscout/implementation/pump/TemporaryBasalStorageTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/pump/TemporaryBasalStorageTest.kt @@ -1,8 +1,8 @@ package info.nightscout.implementation.pump +import app.aaps.interfaces.pump.PumpSync import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.pump.PumpSync import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index d18d2c7d78..85610f9f4a 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -3,6 +3,26 @@ package info.nightscout.implementation.queue import android.content.Context import android.os.Handler import android.os.PowerManager +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.queue.CustomCommand +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import app.aaps.shared.tests.TestBaseWithProfile import app.aaps.shared.tests.TestPumpPlugin import com.google.common.truth.Truth.assertThat @@ -18,26 +38,6 @@ import info.nightscout.implementation.queue.commands.CommandCustomCommand import info.nightscout.implementation.queue.commands.CommandExtendedBolus import info.nightscout.implementation.queue.commands.CommandLoadHistory import info.nightscout.implementation.queue.commands.CommandTempBasalPercent -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -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 io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt index c87830ac13..e0d508fe29 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt @@ -2,6 +2,13 @@ package info.nightscout.implementation.queue import android.content.Context import android.os.PowerManager +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBaseWithProfile import app.aaps.shared.tests.TestPumpPlugin import com.google.common.truth.Truth.assertThat @@ -10,13 +17,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.ui.UiInteraction import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers diff --git a/implementation/src/test/java/info/nightscout/implementation/utils/DecimalFormatterTest.kt b/implementation/src/test/java/info/nightscout/implementation/utils/DecimalFormatterTest.kt index 9adc51d743..becd30552a 100644 --- a/implementation/src/test/java/info/nightscout/implementation/utils/DecimalFormatterTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/utils/DecimalFormatterTest.kt @@ -1,9 +1,9 @@ package info.nightscout.implementation.utils +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DecimalFormatter import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/implementation/src/test/java/info/nightscout/implementation/wizard/BolusWizardTest.kt b/implementation/src/test/java/info/nightscout/implementation/wizard/BolusWizardTest.kt index b18036fa2d..d7e1eb0ce1 100644 --- a/implementation/src/test/java/info/nightscout/implementation/wizard/BolusWizardTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/wizard/BolusWizardTest.kt @@ -1,19 +1,19 @@ package info.nightscout.implementation.wizard +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.queue.CommandQueue import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.core.wizard.BolusWizard import info.nightscout.implementation.iob.GlucoseStatusProviderImpl -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.queue.CommandQueue import org.junit.jupiter.api.Test import org.mockito.Mock import org.mockito.Mockito diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java index 3ea11c6ec3..4981aacde6 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java @@ -20,6 +20,9 @@ import androidx.lifecycle.MutableLiveData; import javax.inject.Inject; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.resources.ResourceHelper; import dagger.android.DaggerService; import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity; import info.nightscout.androidaps.plugins.pump.insight.app_layer.remote_control.ConfirmAlertMessage; @@ -35,9 +38,6 @@ import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_erro import info.nightscout.androidaps.plugins.pump.insight.utils.AlertUtils; import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator; import info.nightscout.core.utils.HtmlHelper; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; -import info.nightscout.shared.interfaces.ResourceHelper; public class InsightAlertService extends DaggerService implements InsightConnectionService.StateCallback { diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java index cf0392107d..eb10caa972 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java @@ -19,6 +19,13 @@ import java.util.List; import javax.inject.Inject; +import app.aaps.interfaces.queue.Callback; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.DecimalFormatter; import dagger.android.support.DaggerFragment; import info.nightscout.androidaps.insight.R; import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.TBROverNotificationBlock; @@ -30,13 +37,6 @@ 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.core.utils.fabric.FabricPrivacy; -import info.nightscout.interfaces.queue.Callback; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.utils.DecimalFormatter; -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 { @@ -221,7 +221,7 @@ public class LocalInsightFragment extends DaggerFragment implements View.OnClick string = info.nightscout.core.ui.R.string.connecting; break; case CONNECTED: - string = info.nightscout.interfaces.R.string.connected; + string = app.aaps.interfaces.R.string.connected; break; case RECOVERING: string = R.string.recovering; diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 34c5314473..8005652076 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -26,6 +26,37 @@ import java.util.TimeZone; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.configuration.Config; +import app.aaps.interfaces.constraints.Constraint; +import app.aaps.interfaces.constraints.PluginConstraints; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.plugin.OwnDatabasePlugin; +import app.aaps.interfaces.plugin.PluginDescription; +import app.aaps.interfaces.plugin.PluginType; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.profile.ProfileFunction; +import app.aaps.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.pump.Insight; +import app.aaps.interfaces.pump.Pump; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpPluginBase; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.PumpSync.PumpState.TemporaryBasal; +import app.aaps.interfaces.pump.defs.ManufacturerType; +import app.aaps.interfaces.pump.defs.PumpDescription; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventDismissNotification; +import app.aaps.interfaces.rx.events.EventInitializationChanged; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.rx.events.EventRefreshOverview; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.T; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.insight.R; import info.nightscout.androidaps.insight.database.InsightBolusID; @@ -101,37 +132,6 @@ import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_erro import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator; import info.nightscout.androidaps.plugins.pump.insight.utils.ParameterBlockUtil; import info.nightscout.core.events.EventNewNotification; -import info.nightscout.interfaces.Config; -import info.nightscout.interfaces.constraints.Constraint; -import info.nightscout.interfaces.constraints.PluginConstraints; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.plugin.OwnDatabasePlugin; -import info.nightscout.interfaces.plugin.PluginDescription; -import info.nightscout.interfaces.plugin.PluginType; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.profile.ProfileFunction; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.interfaces.pump.Insight; -import info.nightscout.interfaces.pump.Pump; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpPluginBase; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.PumpSync.PumpState.TemporaryBasal; -import info.nightscout.interfaces.pump.defs.ManufacturerType; -import info.nightscout.interfaces.pump.defs.PumpDescription; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventDismissNotification; -import info.nightscout.rx.events.EventInitializationChanged; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.rx.events.EventRefreshOverview; -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; @Singleton public class LocalInsightPlugin extends PumpPluginBase implements Pump, Insight, PluginConstraints, OwnDatabasePlugin, diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightPairingActivity.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightPairingActivity.java index 6e4039d739..003ccea724 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightPairingActivity.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightPairingActivity.java @@ -32,6 +32,8 @@ import java.util.List; import javax.inject.Inject; +import app.aaps.interfaces.pump.BlePreCheck; +import app.aaps.interfaces.pump.PumpSync; import dagger.android.support.DaggerAppCompatActivity; import info.nightscout.androidaps.insight.R; import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService; @@ -39,8 +41,6 @@ import info.nightscout.androidaps.plugins.pump.insight.descriptors.InsightState; import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator; import info.nightscout.core.utils.extensions.BluetoothAdapterExtensionKt; import info.nightscout.core.utils.extensions.IntentExtensionKt; -import info.nightscout.interfaces.pump.BlePreCheck; -import info.nightscout.interfaces.pump.PumpSync; public class InsightPairingActivity extends DaggerAppCompatActivity implements InsightConnectionService.StateCallback, View.OnClickListener, InsightConnectionService.ExceptionCallback { @@ -69,8 +69,7 @@ public class InsightPairingActivity extends DaggerAppCompatActivity implements I public void onServiceConnected(ComponentName name, IBinder binder) { service = ((InsightConnectionService.LocalBinder) binder).getService(); if (service.isPaired()) { - } - else { + } else { service.requestConnection(InsightPairingActivity.this); service.registerStateCallback(InsightPairingActivity.this); service.registerExceptionCallback(InsightPairingActivity.this); diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java index 092e568bc6..726ca0bdad 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java @@ -25,6 +25,9 @@ import java.util.List; import javax.inject.Inject; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.sharedPreferences.SP; import dagger.android.DaggerService; import info.nightscout.androidaps.insight.R; import info.nightscout.androidaps.plugins.pump.insight.app_layer.AppLayerMessage; @@ -89,10 +92,6 @@ import info.nightscout.androidaps.plugins.pump.insight.utils.PairingDataStorage; import info.nightscout.androidaps.plugins.pump.insight.utils.crypto.Cryptograph; import info.nightscout.androidaps.plugins.pump.insight.utils.crypto.DerivedKeys; import info.nightscout.androidaps.plugins.pump.insight.utils.crypto.KeyPair; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag -; -import info.nightscout.shared.sharedPreferences.SP; public class InsightConnectionService extends DaggerService implements ConnectionEstablisher.Callback, InputStreamReader.Callback, OutputStreamWriter.Callback { diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/events/EventLocalInsightUpdateGUI.kt b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/events/EventLocalInsightUpdateGUI.kt index b36ebb9f87..7ebe7bd27f 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/events/EventLocalInsightUpdateGUI.kt +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/events/EventLocalInsightUpdateGUI.kt @@ -1,5 +1,5 @@ package info.nightscout.androidaps.plugins.pump.insight.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventLocalInsightUpdateGUI : EventUpdateGui() diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/utils/AlertUtils.kt b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/utils/AlertUtils.kt index 7bb1ec5540..c03f282e60 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/utils/AlertUtils.kt +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/utils/AlertUtils.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.insight.utils +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.androidaps.insight.R import info.nightscout.androidaps.plugins.pump.insight.descriptors.Alert import info.nightscout.androidaps.plugins.pump.insight.descriptors.AlertCategory import info.nightscout.androidaps.plugins.pump.insight.descriptors.AlertType -import info.nightscout.shared.interfaces.ResourceHelper import java.text.DecimalFormat import javax.inject.Inject import javax.inject.Singleton @@ -12,63 +12,67 @@ import javax.inject.Singleton @Singleton class AlertUtils @Inject constructor(private val rh: ResourceHelper) { - fun getAlertCode(alertType: AlertType) = rh.gs(when (alertType) { - AlertType.REMINDER_01 -> R.string.alert_r1_code - AlertType.REMINDER_02 -> R.string.alert_r2_code - AlertType.REMINDER_03 -> R.string.alert_r3_code - AlertType.REMINDER_04 -> R.string.alert_r4_code - AlertType.REMINDER_07 -> R.string.alert_r7_code - AlertType.WARNING_31 -> R.string.alert_w31_code - AlertType.WARNING_32 -> R.string.alert_w32_code - AlertType.WARNING_33 -> R.string.alert_w33_code - AlertType.WARNING_34 -> R.string.alert_w34_code - AlertType.WARNING_36 -> R.string.alert_w36_code - AlertType.WARNING_38 -> R.string.alert_w38_code - AlertType.WARNING_39 -> R.string.alert_w39_code - AlertType.MAINTENANCE_20 -> R.string.alert_m20_code - AlertType.MAINTENANCE_21 -> R.string.alert_m21_code - AlertType.MAINTENANCE_22 -> R.string.alert_m22_code - AlertType.MAINTENANCE_23 -> R.string.alert_m23_code - AlertType.MAINTENANCE_24 -> R.string.alert_m24_code - AlertType.MAINTENANCE_25 -> R.string.alert_m25_code - AlertType.MAINTENANCE_26 -> R.string.alert_m26_code - AlertType.MAINTENANCE_27 -> R.string.alert_m27_code - AlertType.MAINTENANCE_28 -> R.string.alert_m28_code - AlertType.MAINTENANCE_29 -> R.string.alert_m29_code - AlertType.MAINTENANCE_30 -> R.string.alert_m30_code - AlertType.ERROR_6 -> R.string.alert_e6_code - AlertType.ERROR_10 -> R.string.alert_e10_code - AlertType.ERROR_13 -> R.string.alert_e13_code - }) + fun getAlertCode(alertType: AlertType) = rh.gs( + when (alertType) { + AlertType.REMINDER_01 -> R.string.alert_r1_code + AlertType.REMINDER_02 -> R.string.alert_r2_code + AlertType.REMINDER_03 -> R.string.alert_r3_code + AlertType.REMINDER_04 -> R.string.alert_r4_code + AlertType.REMINDER_07 -> R.string.alert_r7_code + AlertType.WARNING_31 -> R.string.alert_w31_code + AlertType.WARNING_32 -> R.string.alert_w32_code + AlertType.WARNING_33 -> R.string.alert_w33_code + AlertType.WARNING_34 -> R.string.alert_w34_code + AlertType.WARNING_36 -> R.string.alert_w36_code + AlertType.WARNING_38 -> R.string.alert_w38_code + AlertType.WARNING_39 -> R.string.alert_w39_code + AlertType.MAINTENANCE_20 -> R.string.alert_m20_code + AlertType.MAINTENANCE_21 -> R.string.alert_m21_code + AlertType.MAINTENANCE_22 -> R.string.alert_m22_code + AlertType.MAINTENANCE_23 -> R.string.alert_m23_code + AlertType.MAINTENANCE_24 -> R.string.alert_m24_code + AlertType.MAINTENANCE_25 -> R.string.alert_m25_code + AlertType.MAINTENANCE_26 -> R.string.alert_m26_code + AlertType.MAINTENANCE_27 -> R.string.alert_m27_code + AlertType.MAINTENANCE_28 -> R.string.alert_m28_code + AlertType.MAINTENANCE_29 -> R.string.alert_m29_code + AlertType.MAINTENANCE_30 -> R.string.alert_m30_code + AlertType.ERROR_6 -> R.string.alert_e6_code + AlertType.ERROR_10 -> R.string.alert_e10_code + AlertType.ERROR_13 -> R.string.alert_e13_code + } + ) - fun getAlertTitle(alertType: AlertType) = rh.gs(when (alertType) { - AlertType.REMINDER_01 -> R.string.alert_r1_title - AlertType.REMINDER_02 -> R.string.alert_r2_title - AlertType.REMINDER_03 -> R.string.alert_r3_title - AlertType.REMINDER_04 -> R.string.alert_r4_title - AlertType.REMINDER_07 -> R.string.alert_r7_title - AlertType.WARNING_31 -> R.string.alert_w31_title - AlertType.WARNING_32 -> R.string.alert_w32_title - AlertType.WARNING_33 -> R.string.alert_w33_title - AlertType.WARNING_34 -> R.string.alert_w34_title - AlertType.WARNING_36 -> R.string.alert_w36_title - AlertType.WARNING_38 -> R.string.alert_w38_title - AlertType.WARNING_39 -> R.string.alert_w39_title - AlertType.MAINTENANCE_20 -> R.string.alert_m20_title - AlertType.MAINTENANCE_21 -> R.string.alert_m21_title - AlertType.MAINTENANCE_22 -> R.string.alert_m22_title - AlertType.MAINTENANCE_23 -> R.string.alert_m23_title - AlertType.MAINTENANCE_24 -> R.string.alert_m24_title - AlertType.MAINTENANCE_25 -> R.string.alert_m25_title - AlertType.MAINTENANCE_26 -> R.string.alert_m26_title - AlertType.MAINTENANCE_27 -> R.string.alert_m27_title - AlertType.MAINTENANCE_28 -> R.string.alert_m28_title - AlertType.MAINTENANCE_29 -> R.string.alert_m29_title - AlertType.MAINTENANCE_30 -> R.string.alert_m30_title - AlertType.ERROR_6 -> R.string.alert_e6_title - AlertType.ERROR_10 -> R.string.alert_e10_title - AlertType.ERROR_13 -> R.string.alert_e13_title - }) + fun getAlertTitle(alertType: AlertType) = rh.gs( + when (alertType) { + AlertType.REMINDER_01 -> R.string.alert_r1_title + AlertType.REMINDER_02 -> R.string.alert_r2_title + AlertType.REMINDER_03 -> R.string.alert_r3_title + AlertType.REMINDER_04 -> R.string.alert_r4_title + AlertType.REMINDER_07 -> R.string.alert_r7_title + AlertType.WARNING_31 -> R.string.alert_w31_title + AlertType.WARNING_32 -> R.string.alert_w32_title + AlertType.WARNING_33 -> R.string.alert_w33_title + AlertType.WARNING_34 -> R.string.alert_w34_title + AlertType.WARNING_36 -> R.string.alert_w36_title + AlertType.WARNING_38 -> R.string.alert_w38_title + AlertType.WARNING_39 -> R.string.alert_w39_title + AlertType.MAINTENANCE_20 -> R.string.alert_m20_title + AlertType.MAINTENANCE_21 -> R.string.alert_m21_title + AlertType.MAINTENANCE_22 -> R.string.alert_m22_title + AlertType.MAINTENANCE_23 -> R.string.alert_m23_title + AlertType.MAINTENANCE_24 -> R.string.alert_m24_title + AlertType.MAINTENANCE_25 -> R.string.alert_m25_title + AlertType.MAINTENANCE_26 -> R.string.alert_m26_title + AlertType.MAINTENANCE_27 -> R.string.alert_m27_title + AlertType.MAINTENANCE_28 -> R.string.alert_m28_title + AlertType.MAINTENANCE_29 -> R.string.alert_m29_title + AlertType.MAINTENANCE_30 -> R.string.alert_m30_title + AlertType.ERROR_6 -> R.string.alert_e6_title + AlertType.ERROR_10 -> R.string.alert_e10_title + AlertType.ERROR_13 -> R.string.alert_e13_title + } + ) fun getAlertDescription(alert: Alert): String? { val decimalFormat = DecimalFormat("##0.00") diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/APSResultObject.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/APSResultObject.kt index 3ad966c702..642f507b04 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/APSResultObject.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/APSResultObject.kt @@ -1,26 +1,26 @@ package info.nightscout.plugins.aps import android.text.Spanned +import app.aaps.interfaces.aps.APSResult +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.core.extensions.convertedToPercent import info.nightscout.core.ui.R import info.nightscout.core.utils.HtmlHelper import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.aps.APSResult -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.utils.DecimalFormatter -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.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/OpenAPSFragment.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/OpenAPSFragment.kt index 81c6df8f15..923f87d6aa 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/OpenAPSFragment.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/OpenAPSFragment.kt @@ -13,20 +13,20 @@ import android.view.ViewGroup import androidx.core.view.MenuCompat import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.aps.databinding.OpenapsFragmentBinding import info.nightscout.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.plugins.aps.events.EventResetOpenAPSGui import info.nightscout.plugins.aps.utils.JSONFormatter -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.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/di/ApsModule.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/di/ApsModule.kt index db2efe7902..dd4c672cb8 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/di/ApsModule.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/di/ApsModule.kt @@ -1,11 +1,10 @@ package info.nightscout.plugins.aps.di +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.autotune.Autotune import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.interfaces.aps.APSResult -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.autotune.Autotune import info.nightscout.plugins.aps.APSResultObject import info.nightscout.plugins.aps.OpenAPSFragment import info.nightscout.plugins.aps.loop.LoopPlugin diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventOpenAPSUpdateGui.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventOpenAPSUpdateGui.kt index 263b5c0515..06bc0ff4b9 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventOpenAPSUpdateGui.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventOpenAPSUpdateGui.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.aps.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventOpenAPSUpdateGui : EventUpdateGui() diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventResetOpenAPSGui.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventResetOpenAPSGui.kt index da52c3d99f..90a8e2657c 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventResetOpenAPSGui.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/events/EventResetOpenAPSGui.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.aps.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventResetOpenAPSGui(val text: String) : EventUpdateGui() diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/logger/LoggerCallback.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/logger/LoggerCallback.kt index fbd81f5c34..a03138534a 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/logger/LoggerCallback.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/logger/LoggerCallback.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.aps.logger +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.plugins.aps.utils.StaticInjector -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.mozilla.javascript.ScriptableObject import javax.inject.Inject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/CarbSuggestionReceiver.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/CarbSuggestionReceiver.kt index 3f9eb6781e..d892ab09e0 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/CarbSuggestionReceiver.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/CarbSuggestionReceiver.kt @@ -2,11 +2,12 @@ package info.nightscout.plugins.aps.loop import android.content.Context import android.content.Intent +import app.aaps.interfaces.aps.Loop import dagger.android.DaggerBroadcastReceiver -import info.nightscout.interfaces.aps.Loop import javax.inject.Inject class CarbSuggestionReceiver : DaggerBroadcastReceiver() { + @Inject lateinit var loop: Loop override fun onReceive(context: Context, intent: Intent) { diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopFragment.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopFragment.kt index 46221bad0d..9d17bb1cf7 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopFragment.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopFragment.kt @@ -12,24 +12,24 @@ import android.view.ViewGroup import androidx.core.view.MenuCompat import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventLoopUpdateGui +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.pump.toHtml import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.databinding.LoopFragmentBinding import info.nightscout.plugins.aps.loop.events.EventLoopSetLastRunGui -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventLoopUpdateGui -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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt index 4dbe3da996..a1cef0afa8 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/LoopPlugin.kt @@ -13,6 +13,48 @@ import android.os.HandlerThread import android.os.SystemClock import androidx.core.app.NotificationCompat import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.APSResult +import app.aaps.interfaces.aps.ApsMode +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.aps.Loop.LastRun +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.VirtualPump +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAcceptOpenLoopChange +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventLoopUpdateGui +import app.aaps.interfaces.rx.events.EventMobileToWear +import app.aaps.interfaces.rx.events.EventNewOpenLoopNotification +import app.aaps.interfaces.rx.events.EventTempTargetChange +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.events.EventNewNotification @@ -30,52 +72,10 @@ import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.interfaces.ApsMode -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.aps.APSResult -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.aps.Loop.LastRun -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.VirtualPump -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.plugins.aps.loop.extensions.json -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAcceptOpenLoopChange -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventLoopUpdateGui -import info.nightscout.rx.events.EventMobileToWear -import info.nightscout.rx.events.EventNewOpenLoopNotification -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.sdk.interfaces.RunningConfiguration -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.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/events/EventLoopSetLastRunGui.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/events/EventLoopSetLastRunGui.kt index a158dc3f12..28e523c055 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/events/EventLoopSetLastRunGui.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/events/EventLoopSetLastRunGui.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.aps.loop.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui /** * Created by mike on 05.08.2016. diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/extensions/PumpEnactResultExtension.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/extensions/PumpEnactResultExtension.kt index f6953be0ae..fb50acfeec 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/extensions/PumpEnactResultExtension.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/loop/extensions/PumpEnactResultExtension.kt @@ -1,17 +1,17 @@ package info.nightscout.plugins.aps.loop.extensions -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.utils.Round +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.utils.Round import org.json.JSONObject fun PumpEnactResult.json(baseBasal: Double): JSONObject { val result = JSONObject() when { - bolusDelivered > 0 -> { + bolusDelivered > 0 -> { result.put("smb", bolusDelivered) } - isTempCancel -> { + isTempCancel -> { result.put("rate", 0) result.put("duration", 0) } diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt index 4ae6517b9c..75790ca3f2 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt @@ -1,26 +1,26 @@ package info.nightscout.plugins.aps.openAPSAMA +import app.aaps.interfaces.aps.DetermineBasalAdapter +import app.aaps.interfaces.aps.SMBDefaults +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.iob.MealData +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.core.extensions.getPassedDurationToTimeInMinutes import info.nightscout.core.extensions.plannedRemainingMinutes -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.DetermineBasalAdapter -import info.nightscout.interfaces.aps.SMBDefaults -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.iob.MealData -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.plugins.aps.APSResultObject import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.logger.LoggerCallback import info.nightscout.plugins.aps.utils.ScriptReader -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/DetermineBasalResultAMA.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/DetermineBasalResultAMA.kt index 46560190a0..6f73876841 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/DetermineBasalResultAMA.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/DetermineBasalResultAMA.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.aps.openAPSAMA +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.plugins.aps.APSResultObject -import info.nightscout.rx.logging.LTag import org.json.JSONException import org.json.JSONObject import org.mozilla.javascript.NativeObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index b53cf725d7..5e2337e141 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -2,6 +2,29 @@ package info.nightscout.plugins.aps.openAPSAMA import android.content.Context import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.APS +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.DetermineBasalAdapter +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profiling.Profiler +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.Round import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.extensions.target @@ -9,34 +32,11 @@ import info.nightscout.core.utils.MidnightUtils import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.aps.APS -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.DetermineBasalAdapter -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profiling.Profiler -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.aps.OpenAPSFragment import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.plugins.aps.events.EventResetOpenAPSGui import info.nightscout.plugins.aps.utils.ScriptReader -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 org.json.JSONException import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index bc15d9ccde..43ef64a361 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -1,28 +1,28 @@ package info.nightscout.plugins.aps.openAPSSMB +import app.aaps.interfaces.aps.DetermineBasalAdapter +import app.aaps.interfaces.aps.SMBDefaults +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.iob.MealData +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.SafeParse import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.core.extensions.getPassedDurationToTimeInMinutes import info.nightscout.core.extensions.plannedRemainingMinutes -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.DetermineBasalAdapter -import info.nightscout.interfaces.aps.SMBDefaults -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.iob.MealData -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.plugins.aps.APSResultObject import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.logger.LoggerCallback import info.nightscout.plugins.aps.utils.ScriptReader -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.SafeParse -import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt index 6fa9f3d375..48331565df 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.aps.openAPSSMB +import app.aaps.interfaces.aps.VariableSensitivityResult +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.plugins.aps.APSResultObject -import info.nightscout.interfaces.aps.VariableSensitivityResult -import info.nightscout.rx.logging.LTag import org.json.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index ca8c0ae5f4..c30984cbb7 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -3,41 +3,41 @@ package info.nightscout.plugins.aps.openAPSSMB import android.content.Context import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference +import app.aaps.interfaces.aps.APS +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.DetermineBasalAdapter +import app.aaps.interfaces.aps.SMBDefaults +import app.aaps.interfaces.bgQualityCheck.BgQualityCheck +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profiling.Profiler +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.Round import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.extensions.target import info.nightscout.core.utils.MidnightUtils import info.nightscout.database.ValueWrapper import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.aps.APS -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.DetermineBasalAdapter -import info.nightscout.interfaces.aps.SMBDefaults -import info.nightscout.interfaces.bgQualityCheck.BgQualityCheck -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profiling.Profiler -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.events.EventResetOpenAPSGui import info.nightscout.plugins.aps.utils.ScriptReader -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 javax.inject.Inject import javax.inject.Singleton import kotlin.math.floor @@ -117,17 +117,17 @@ open class OpenAPSSMBPlugin @Inject constructor( val profile = profileFunction.getProfile() val pump = activePlugin.activePump if (profile == null) { - rxBus.send(info.nightscout.plugins.aps.events.EventResetOpenAPSGui(rh.gs(info.nightscout.core.ui.R.string.no_profile_set))) + rxBus.send(EventResetOpenAPSGui(rh.gs(info.nightscout.core.ui.R.string.no_profile_set))) aapsLogger.debug(LTag.APS, rh.gs(info.nightscout.core.ui.R.string.no_profile_set)) return } if (!isEnabled()) { - rxBus.send(info.nightscout.plugins.aps.events.EventResetOpenAPSGui(rh.gs(R.string.openapsma_disabled))) + rxBus.send(EventResetOpenAPSGui(rh.gs(R.string.openapsma_disabled))) aapsLogger.debug(LTag.APS, rh.gs(R.string.openapsma_disabled)) return } if (glucoseStatus == null) { - rxBus.send(info.nightscout.plugins.aps.events.EventResetOpenAPSGui(rh.gs(R.string.openapsma_no_glucose_data))) + rxBus.send(EventResetOpenAPSGui(rh.gs(R.string.openapsma_no_glucose_data))) aapsLogger.debug(LTag.APS, rh.gs(R.string.openapsma_no_glucose_data)) return } diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index 9073e24655..b389af99bb 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -1,29 +1,29 @@ package info.nightscout.plugins.aps.openAPSSMBDynamicISF +import app.aaps.interfaces.aps.DetermineBasalAdapter +import app.aaps.interfaces.aps.SMBDefaults +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.iob.MealData +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.SafeParse import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.core.extensions.getPassedDurationToTimeInMinutes import info.nightscout.core.extensions.plannedRemainingMinutes -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.DetermineBasalAdapter -import info.nightscout.interfaces.aps.SMBDefaults -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.iob.MealData -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.logger.LoggerCallback import info.nightscout.plugins.aps.openAPSSMB.DetermineBasalResultSMB import info.nightscout.plugins.aps.utils.ScriptReader -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import org.json.JSONObject @@ -207,7 +207,10 @@ class DetermineBasalAdapterSMBDynamicISFJS internal constructor(private val scri this.profile.put("lgsThreshold", profileUtil.convertToMgdlDetect(sp.getDouble(R.string.key_lgs_threshold, 65.0))) //mProfile.put("high_temptarget_raises_sensitivity", SP.getBoolean(R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity)); - this.profile.put("high_temptarget_raises_sensitivity", sp.getBoolean(info.nightscout.core.utils.R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity)) + this.profile.put( + "high_temptarget_raises_sensitivity", + sp.getBoolean(info.nightscout.core.utils.R.string.key_high_temptarget_raises_sensitivity, SMBDefaults.high_temptarget_raises_sensitivity) + ) //mProfile.put("low_temptarget_lowers_sensitivity", SP.getBoolean(R.string.key_low_temptarget_lowers_sensitivity, SMBDefaults.low_temptarget_lowers_sensitivity)); this.profile.put("low_temptarget_lowers_sensitivity", sp.getBoolean(info.nightscout.core.utils.R.string.key_low_temptarget_lowers_sensitivity, SMBDefaults.low_temptarget_lowers_sensitivity)) this.profile.put("sensitivity_raises_target", sp.getBoolean(R.string.key_sensitivity_raises_target, SMBDefaults.sensitivity_raises_target)) diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt index f3bb85762d..31c42844e4 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt @@ -2,28 +2,28 @@ package info.nightscout.plugins.aps.openAPSSMBDynamicISF import android.content.Context import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.DetermineBasalAdapter +import app.aaps.interfaces.bgQualityCheck.BgQualityCheck +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profiling.Profiler +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.HardLimits import dagger.android.HasAndroidInjector import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.aps.DetermineBasalAdapter -import info.nightscout.interfaces.bgQualityCheck.BgQualityCheck -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profiling.Profiler -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.openAPSSMB.DetermineBasalAdapterSMBJS import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.plugins.aps.utils.ScriptReader -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.Inject import javax.inject.Singleton diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/JSONFormatter.kt b/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/JSONFormatter.kt index 8603cd6d9c..85c4403f5a 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/JSONFormatter.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/aps/utils/JSONFormatter.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.aps.utils import android.text.Spanned +import app.aaps.interfaces.logging.AAPSLogger import info.nightscout.core.utils.HtmlHelper -import info.nightscout.rx.logging.AAPSLogger import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneCore.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneCore.kt index a173b54a22..765191dc75 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneCore.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneCore.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.general.autotune +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.Round import info.nightscout.core.utils.Percentile -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.data.PreppedGlucose -import info.nightscout.shared.sharedPreferences.SP import java.util.Calendar import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFS.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFS.kt index 028b54ad5f..dfb7f1a684 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFS.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFS.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.general.autotune import app.aaps.annotations.OpenForTesting -import info.nightscout.interfaces.logging.LoggerUtils +import app.aaps.interfaces.logging.LoggerUtils +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose -import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONException import org.slf4j.LoggerFactory import java.io.BufferedInputStream diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 85e90953af..daaeac7c04 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -17,6 +17,26 @@ import android.widget.ArrayAdapter import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.extensions.runOnUiThread +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileStore +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventLocalProfileChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.SafeParse import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.core.profile.ProfileSealed @@ -25,31 +45,11 @@ import info.nightscout.core.ui.elements.WeekDay import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profile.ProfileStore -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.aps.R import info.nightscout.plugins.aps.databinding.AutotuneFragmentBinding import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.events.EventAutotuneUpdateGui -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventLocalProfileChanged -import info.nightscout.shared.SafeParse -import info.nightscout.shared.extensions.runOnUiThread -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject @@ -156,16 +156,16 @@ class AutotuneFragment : DaggerFragment() { rh.gs(info.nightscout.core.ui.R.string.autotune_copy_localprofile_button), rh.gs(info.nightscout.core.ui.R.string.autotune_copy_local_profile_message) + "\n" + localName, Runnable { - val profilePlugin = activePlugin.activeProfileSource - profilePlugin.addProfile(profilePlugin.copyFrom(tunedProfile.getProfile(circadian), localName)) - rxBus.send(EventLocalProfileChanged()) - uel.log( - UserEntry.Action.NEW_PROFILE, - UserEntry.Sources.Autotune, - ValueWithUnit.SimpleString(localName) - ) - updateGui() - }) + val profilePlugin = activePlugin.activeProfileSource + profilePlugin.addProfile(profilePlugin.copyFrom(tunedProfile.getProfile(circadian), localName)) + rxBus.send(EventLocalProfileChanged()) + uel.log( + UserEntry.Action.NEW_PROFILE, + UserEntry.Sources.Autotune, + ValueWithUnit.SimpleString(localName) + ) + updateGui() + }) } } @@ -175,17 +175,17 @@ class AutotuneFragment : DaggerFragment() { rh.gs(info.nightscout.core.ui.R.string.autotune_update_input_profile_button), rh.gs(info.nightscout.core.ui.R.string.autotune_update_local_profile_message, localName), Runnable { - autotunePlugin.tunedProfile?.profileName = localName - autotunePlugin.updateProfile(autotunePlugin.tunedProfile) - autotunePlugin.updateButtonVisibility = View.GONE - autotunePlugin.saveLastRun() - uel.log( - UserEntry.Action.STORE_PROFILE, - UserEntry.Sources.Autotune, - ValueWithUnit.SimpleString(localName) - ) - updateGui() - } + autotunePlugin.tunedProfile?.profileName = localName + autotunePlugin.updateProfile(autotunePlugin.tunedProfile) + autotunePlugin.updateButtonVisibility = View.GONE + autotunePlugin.saveLastRun() + uel.log( + UserEntry.Action.STORE_PROFILE, + UserEntry.Sources.Autotune, + ValueWithUnit.SimpleString(localName) + ) + updateGui() + } ) } @@ -195,17 +195,17 @@ class AutotuneFragment : DaggerFragment() { rh.gs(info.nightscout.core.ui.R.string.autotune_revert_input_profile_button), rh.gs(info.nightscout.core.ui.R.string.autotune_revert_local_profile_message, localName), Runnable { - autotunePlugin.tunedProfile?.profileName = "" - autotunePlugin.updateProfile(autotunePlugin.pumpProfile) - autotunePlugin.updateButtonVisibility = View.VISIBLE - autotunePlugin.saveLastRun() - uel.log( - UserEntry.Action.STORE_PROFILE, - UserEntry.Sources.Autotune, - ValueWithUnit.SimpleString(localName) - ) - updateGui() - } + autotunePlugin.tunedProfile?.profileName = "" + autotunePlugin.updateProfile(autotunePlugin.pumpProfile) + autotunePlugin.updateButtonVisibility = View.VISIBLE + autotunePlugin.saveLastRun() + uel.log( + UserEntry.Action.STORE_PROFILE, + UserEntry.Sources.Autotune, + ValueWithUnit.SimpleString(localName) + ) + updateGui() + } ) } @@ -482,7 +482,15 @@ class AutotuneFragment : DaggerFragment() { isfFormat ) ) - layout.addView(toTableRowValue(context, rh.gs(info.nightscout.core.ui.R.string.ic_short), Round.roundTo(autotunePlugin.pumpProfile.ic, 0.001), Round.roundTo(tuned.ic, 0.001), "%.2f")) + layout.addView( + toTableRowValue( + context, + rh.gs(info.nightscout.core.ui.R.string.ic_short), + Round.roundTo(autotunePlugin.pumpProfile.ic, 0.001), + Round.roundTo(tuned.ic, 0.001), + "%.2f" + ) + ) layout.addView( TextView(context).apply { text = rh.gs(info.nightscout.core.ui.R.string.basal) diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt index 4ea1206442..3dee5bc63b 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt @@ -1,5 +1,16 @@ package info.nightscout.plugins.general.autotune +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.iob.Iob +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.core.extensions.durationInMinutes import info.nightscout.core.extensions.toJson @@ -14,19 +25,8 @@ import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.iob.Iob -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.LocalInsulin -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 info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject @@ -249,9 +249,10 @@ open class AutotuneIob @Inject constructor( // Add specific calculation for Autotune (reference localInsulin for Peak/dia) private fun Bolus.iobCalc(time: Long, localInsulin: LocalInsulin): Iob { - if (!isValid || type == Bolus.Type.PRIMING ) return Iob() + if (!isValid || type == Bolus.Type.PRIMING) return Iob() return localInsulin.iobCalcForTreatment(this, time) } + private fun getCalculationToTimeTreatments(time: Long, localInsulin: LocalInsulin): IobTotal { val total = IobTotal(time) val detailedLog = sp.getBoolean(info.nightscout.core.utils.R.string.key_autotune_additional_log, false) diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index cf0bcb7208..8558b1de85 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -3,6 +3,26 @@ package info.nightscout.plugins.general.autotune import android.view.View +import app.aaps.interfaces.autotune.Autotune +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventLocalProfileChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed @@ -10,31 +30,11 @@ import info.nightscout.core.ui.elements.WeekDay import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.autotune.Autotune -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.plugins.aps.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.plugins.general.autotune.events.EventAutotuneUpdateGui -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventLocalProfileChanged -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 org.json.JSONException import org.json.JSONObject import java.util.TimeZone diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt index 11d0ec67b1..31dc37f5d7 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt @@ -1,10 +1,13 @@ package info.nightscout.plugins.general.autotune +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.BGDatum import info.nightscout.plugins.general.autotune.data.CRDatum @@ -12,9 +15,6 @@ import info.nightscout.plugins.general.autotune.data.DiaDeviation import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.data.PeakDeviation import info.nightscout.plugins.general.autotune.data.PreppedGlucose -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 diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index 51700b1f93..fd302192ba 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -1,29 +1,29 @@ package info.nightscout.plugins.general.autotune.data +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileStore +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.SafeParse +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.blockValueBySeconds import info.nightscout.core.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.MidnightUtils import info.nightscout.database.entities.data.Block -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileStore -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.interfaces.utils.Round -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ProfileUtil -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.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt index a9337d87ff..fce063054a 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.general.autotune.data +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.GlucoseValue.TrendArrow -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONException import org.json.JSONObject import java.util.TimeZone diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/CRDatum.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/CRDatum.kt index 698a8a4f02..f38ac42d84 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/CRDatum.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/CRDatum.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.general.autotune.data -import info.nightscout.shared.utils.DateUtil +import app.aaps.interfaces.utils.DateUtil import org.json.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt index 5f4770d0d9..480f4098d9 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt @@ -1,11 +1,12 @@ package info.nightscout.plugins.general.autotune.data +import app.aaps.interfaces.iob.Iob import info.nightscout.database.entities.Bolus -import info.nightscout.interfaces.iob.Iob import kotlin.math.exp import kotlin.math.pow -class LocalInsulin constructor(val name:String?, val peak:Int = DEFAULT_PEAK, private val userDefinedDia: Double = DEFAULT_DIA) { +class LocalInsulin(val name: String?, val peak: Int = DEFAULT_PEAK, private val userDefinedDia: Double = DEFAULT_DIA) { + val dia get(): Double { val dia = userDefinedDia @@ -39,6 +40,7 @@ class LocalInsulin constructor(val name:String?, val peak:Int = DEFAULT_PEAK, pr } companion object { + private const val MIN_DIA = 5.0 private const val DEFAULT_DIA = 6.0 private const val DEFAULT_PEAK = 75 diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/PreppedGlucose.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/PreppedGlucose.kt index ddc834902d..be3e51c96d 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/PreppedGlucose.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/data/PreppedGlucose.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.general.autotune.data -import info.nightscout.shared.utils.DateUtil +import app.aaps.interfaces.utils.DateUtil import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/events/EventAutotuneUpdateGui.kt b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/events/EventAutotuneUpdateGui.kt index 21ac5f8e1c..2c5971c397 100644 --- a/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/events/EventAutotuneUpdateGui.kt +++ b/plugins/aps/src/main/java/info/nightscout/plugins/general/autotune/events/EventAutotuneUpdateGui.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.general.autotune.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventAutotuneUpdateGui : Event() \ No newline at end of file diff --git a/plugins/aps/src/test/java/info/nightscout/plugins/aps/loop/LoopPluginTest.kt b/plugins/aps/src/test/java/info/nightscout/plugins/aps/loop/LoopPluginTest.kt index e929d32adf..d442a838cd 100644 --- a/plugins/aps/src/test/java/info/nightscout/plugins/aps/loop/LoopPluginTest.kt +++ b/plugins/aps/src/test/java/info/nightscout/plugins/aps/loop/LoopPluginTest.kt @@ -2,29 +2,29 @@ package info.nightscout.plugins.aps.loop import android.app.NotificationManager import android.content.Context +import app.aaps.interfaces.aps.ApsMode +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.ApsMode -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.virtual.VirtualPumpPlugin import info.nightscout.sdk.interfaces.RunningConfiguration -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt b/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt index 75176253d1..1b46875a65 100644 --- a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt +++ b/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt @@ -1,17 +1,17 @@ package info.nightscout.plugins.general.autotune +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.PureProfile import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import org.junit.jupiter.api.BeforeEach diff --git a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt index 21588ff3ca..ad4f71bec2 100644 --- a/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/aps/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt @@ -1,5 +1,13 @@ package info.nightscout.plugins.general.autotune +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.core.extensions.shiftBlock @@ -11,15 +19,7 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profile.PureProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose -import info.nightscout.rx.logging.AAPSLogger -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 org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt b/plugins/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt index 21667d7269..0dea29c09a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt @@ -1,15 +1,15 @@ package info.nightscout.automation +import app.aaps.interfaces.automation.AutomationEvent +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionDummy import info.nightscout.automation.actions.ActionStopProcessing import info.nightscout.automation.triggers.TriggerConnector import info.nightscout.automation.triggers.TriggerDummy -import info.nightscout.interfaces.automation.AutomationEvent -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject @@ -36,8 +36,8 @@ class AutomationEventObject(private val injector: HasAndroidInjector) : Automati injector.androidInjector().inject(this) } - override fun canRun() : Boolean = trigger.shouldRun() - override fun preconditionCanRun() : Boolean = getPreconditions().shouldRun() + override fun canRun(): Boolean = trigger.shouldRun() + override fun preconditionCanRun(): Boolean = getPreconditions().shouldRun() internal fun getPreconditions(): TriggerConnector { val trigger = TriggerConnector(injector, TriggerConnector.Type.AND) diff --git a/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt b/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt index badbe6fe3d..760e6da9e8 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt @@ -22,6 +22,11 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.automation.databinding.AutomationEventItemBinding @@ -31,19 +36,14 @@ import info.nightscout.automation.events.EventAutomationDataChanged import info.nightscout.automation.events.EventAutomationUpdateGui import info.nightscout.automation.triggers.TriggerConnector import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.dragHelpers.ItemTouchHelperAdapter +import info.nightscout.core.ui.dragHelpers.OnStartDragListener +import info.nightscout.core.ui.dragHelpers.SimpleItemTouchHelperCallback import info.nightscout.core.utils.ActionModeHelper import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.core.ui.dragHelpers.ItemTouchHelperAdapter -import info.nightscout.core.ui.dragHelpers.OnStartDragListener -import info.nightscout.core.ui.dragHelpers.SimpleItemTouchHelperCallback -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt b/plugins/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt index 67e7821063..a4c2e7cfa0 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt @@ -5,6 +5,29 @@ import android.os.Handler import android.os.HandlerThread import android.os.SystemClock import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.automation.Automation +import app.aaps.interfaces.automation.AutomationEvent +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventBTChange +import app.aaps.interfaces.rx.events.EventChargingState +import app.aaps.interfaces.rx.events.EventNetworkChange +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionAlarm @@ -44,29 +67,6 @@ import info.nightscout.automation.triggers.TriggerTimeRange import info.nightscout.automation.triggers.TriggerWifiSsid import info.nightscout.automation.ui.TimerUtil import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.automation.Automation -import info.nightscout.interfaces.automation.AutomationEvent -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventBTChange -import info.nightscout.rx.events.EventChargingState -import info.nightscout.rx.events.EventNetworkChange -import info.nightscout.rx.events.EventPreferenceChange -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.JSONArray diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/Action.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/Action.kt index 0981e487ce..0a2d4828e2 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/Action.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/Action.kt @@ -2,11 +2,11 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.HasAndroidInjector -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.triggers.Trigger -import info.nightscout.rx.logging.AAPSLogger import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt index 64a648719a..557036b805 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt @@ -3,6 +3,11 @@ package info.nightscout.automation.actions import android.content.Context import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.InputString @@ -10,11 +15,6 @@ import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.ui.TimerUtil import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt index 7e30ba1f84..ad7c19c3bb 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt @@ -2,6 +2,14 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.automation.elements.InputCarePortalMenu import info.nightscout.automation.elements.InputDuration @@ -15,14 +23,6 @@ import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.logging.LTag -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.JSONObject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionDummy.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionDummy.kt index 4e0887bbb2..d4f053abe8 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionDummy.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionDummy.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.queue.Callback import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.queue.Callback // Used for instantiation of other actions only class ActionDummy(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt index ee6301043d..e92c3a6f68 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt @@ -1,20 +1,20 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshOverview import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshOverview import javax.inject.Inject class ActionLoopDisable(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt index 30617bdd49..57b4071b8e 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt @@ -1,19 +1,19 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshOverview import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshOverview import javax.inject.Inject class ActionLoopEnable(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt index 1d94962c84..1f083017bb 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt @@ -1,21 +1,21 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt index 2601c8d736..6d076e2723 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt @@ -2,6 +2,12 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshOverview import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration @@ -11,12 +17,6 @@ import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshOverview import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt index c8d1700e04..49dae90599 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt @@ -2,6 +2,11 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.notifications.NotificationUserMessage +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshOverview import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.InputString @@ -11,11 +16,6 @@ import info.nightscout.core.events.EventNewNotification import info.nightscout.core.utils.JsonHelper import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.interfaces.notifications.NotificationUserMessage -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshOverview import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt index f051b81063..e656c1a48c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt @@ -2,6 +2,13 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.InputProfileName @@ -11,13 +18,6 @@ import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt index 4c488402c2..ca7ff31a04 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt @@ -2,6 +2,11 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator @@ -14,11 +19,6 @@ import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.logging.LTag import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt index 5b70267c56..b2253278c5 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt @@ -2,6 +2,14 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.autotune.Autotune +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputProfileName @@ -10,14 +18,6 @@ import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.core.ui.elements.WeekDay import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.autotune.Autotune -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt index 692ce192fe..b0f3447eb4 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt @@ -1,15 +1,15 @@ package info.nightscout.automation.actions import android.widget.LinearLayout +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.smsCommunicator.SmsCommunicator import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.InputString import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt index 336fde4e47..dc6e8eec36 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt @@ -2,6 +2,16 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.ComparatorExists @@ -19,16 +29,6 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopProcessing.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopProcessing.kt index 5c650eb47b..4b6a596914 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopProcessing.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopProcessing.kt @@ -1,11 +1,11 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback import com.google.gson.JsonObject import dagger.android.HasAndroidInjector import info.nightscout.automation.R -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback import org.json.JSONObject class ActionStopProcessing(injector: HasAndroidInjector) : Action(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt index 4a9757d2f5..2ba11c2250 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt @@ -1,16 +1,16 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt b/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt index a0dcd300eb..d2b006a925 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt @@ -1,5 +1,6 @@ package info.nightscout.automation.di +import app.aaps.interfaces.automation.Automation import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector @@ -49,7 +50,6 @@ import info.nightscout.automation.triggers.TriggerTempTargetValue import info.nightscout.automation.triggers.TriggerTime import info.nightscout.automation.triggers.TriggerTimeRange import info.nightscout.automation.triggers.TriggerWifiSsid -import info.nightscout.interfaces.automation.Automation @Module( includes = [ diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/BaseDialog.kt b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/BaseDialog.kt index 230116e4c0..450867534c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/BaseDialog.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/BaseDialog.kt @@ -7,9 +7,9 @@ import android.view.Window import android.view.WindowManager import android.widget.Button import androidx.fragment.app.FragmentManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import dagger.android.support.DaggerDialogFragment -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.concurrent.atomic.AtomicBoolean import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseActionDialog.kt b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseActionDialog.kt index 766e1e890e..143c9ee22a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseActionDialog.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseActionDialog.kt @@ -5,13 +5,13 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.RadioButton +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.actions.Action import info.nightscout.automation.databinding.AutomationDialogChooseActionBinding import info.nightscout.automation.events.EventAutomationAddAction import info.nightscout.automation.events.EventAutomationUpdateGui -import info.nightscout.rx.bus.RxBus import javax.inject.Inject import kotlin.reflect.full.primaryConstructor diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt index 703f2b072b..e53b2e92a4 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt @@ -5,9 +5,9 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.RadioButton +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.automation.databinding.AutomationDialogChooseOperationBinding import info.nightscout.automation.triggers.TriggerConnector -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class ChooseOperationDialog : BaseDialog() { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditActionDialog.kt b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditActionDialog.kt index 9bef5d20f7..5747e3abea 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditActionDialog.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditActionDialog.kt @@ -4,12 +4,12 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionDummy import info.nightscout.automation.databinding.AutomationDialogActionBinding import info.nightscout.automation.events.EventAutomationUpdateAction -import info.nightscout.rx.bus.RxBus import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt index 3db69b1749..85d96cf0dd 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt @@ -9,6 +9,9 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.automation.AutomationEventObject import info.nightscout.automation.AutomationPlugin @@ -22,9 +25,6 @@ import info.nightscout.automation.events.EventAutomationUpdateGui import info.nightscout.automation.events.EventAutomationUpdateTrigger import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.extensions.toVisibility import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt index e3e4104bb6..932094a04a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt @@ -4,6 +4,8 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.automation.databinding.AutomationDialogEditTriggerBinding import info.nightscout.automation.events.EventAutomationUpdateTrigger @@ -14,8 +16,6 @@ import info.nightscout.automation.triggers.Trigger import info.nightscout.automation.triggers.TriggerConnector import info.nightscout.automation.triggers.TriggerDummy import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt index 6fba8d942e..851492dc62 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt @@ -7,8 +7,8 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.automation.R -import info.nightscout.shared.interfaces.ResourceHelper class Comparator(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt index 63edc159ee..199d5d8acd 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt @@ -7,8 +7,8 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.automation.R -import info.nightscout.shared.interfaces.ResourceHelper class ComparatorConnect(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt index d3c38abe32..c82714e445 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt @@ -7,7 +7,7 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.resources.ResourceHelper class ComparatorExists(private val rh: ResourceHelper, var value: Compare = Compare.EXISTS) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt index 7fe302f257..d58501a6b7 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt @@ -2,9 +2,9 @@ package info.nightscout.automation.elements import android.view.Gravity import android.widget.LinearLayout +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileFunction import info.nightscout.core.ui.elements.NumberPicker -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.ProfileFunction import java.text.DecimalFormat class InputBg(profileFunction: ProfileFunction) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt index 5da10bfe52..37047a0c55 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt @@ -8,8 +8,8 @@ import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.DrawableRes import androidx.annotation.StringRes +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.database.entities.TherapyEvent -import info.nightscout.shared.interfaces.ResourceHelper class InputCarePortalMenu(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt index e7c4472eca..24e79dc28c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt @@ -9,12 +9,12 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil import com.google.android.material.datepicker.MaterialDatePicker import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat import info.nightscout.automation.R -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import java.util.Calendar class InputDateTime(private val rh: ResourceHelper, private val dateUtil: DateUtil, var value: Long = dateUtil.now()) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt index 7c4c4303e4..712e4aea61 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt @@ -7,9 +7,9 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.automation.R import info.nightscout.core.ui.elements.NumberPicker -import info.nightscout.shared.interfaces.ResourceHelper import java.text.DecimalFormat class InputDelta(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt index e623313100..42bae3839a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt @@ -6,7 +6,7 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.resources.ResourceHelper class InputDropdownMenu(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt index 78258a4bc3..ad0593fce2 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt @@ -7,8 +7,8 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.automation.R -import info.nightscout.shared.interfaces.ResourceHelper class InputLocationMode(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt index 6e1f62365c..6353dc57ff 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt @@ -6,8 +6,8 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper class InputProfileName(private val rh: ResourceHelper, private val activePlugin: ActivePlugin, val name: String = "", private val addActive: Boolean = false) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt index f06cecb96d..04413a8aa2 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt @@ -2,10 +2,10 @@ package info.nightscout.automation.elements import android.view.Gravity import android.widget.LinearLayout +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileFunction import info.nightscout.core.ui.elements.NumberPicker -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.ProfileFunction import java.text.DecimalFormat class InputTempTarget(profileFunction: ProfileFunction) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt index 4a3c6be6a7..4721f52c1d 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt @@ -9,14 +9,13 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat import info.nightscout.automation.R import info.nightscout.core.utils.MidnightUtils -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import java.util.Calendar class InputTime(private val rh: ResourceHelper, private val dateUtil: DateUtil) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt index 4c7c43d560..28df33bcd7 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt @@ -10,13 +10,13 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat import info.nightscout.automation.R import info.nightscout.core.utils.MidnightUtils -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import java.util.Calendar class InputTimeRange(private val rh: ResourceHelper, private val dateUtil: DateUtil) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt index b52476b965..06a8f378ae 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt @@ -4,7 +4,7 @@ import android.graphics.Typeface import android.view.Gravity import android.widget.LinearLayout import android.widget.TextView -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.resources.ResourceHelper class LabelWithElement( private val rh: ResourceHelper, diff --git a/plugins/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt b/plugins/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt index 21d218ffed..ef5297a830 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt @@ -4,8 +4,8 @@ import android.graphics.Typeface import android.view.ViewGroup import android.widget.LinearLayout import android.widget.TextView +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.automation.triggers.Trigger -import info.nightscout.shared.interfaces.ResourceHelper class StaticLabel(private val rh: ResourceHelper) : Element { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationAddAction.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationAddAction.kt index c0bb064793..ecbf7bf260 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationAddAction.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationAddAction.kt @@ -1,6 +1,6 @@ package info.nightscout.automation.events +import app.aaps.interfaces.rx.events.Event import info.nightscout.automation.actions.Action -import info.nightscout.rx.events.Event class EventAutomationAddAction(val action: Action) : Event() diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationDataChanged.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationDataChanged.kt index d0164d00b1..89ce74b2bf 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationDataChanged.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationDataChanged.kt @@ -1,5 +1,5 @@ package info.nightscout.automation.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventAutomationDataChanged : Event() diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateAction.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateAction.kt index 6b66e51230..8ffcb6a43c 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateAction.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateAction.kt @@ -1,6 +1,6 @@ package info.nightscout.automation.events +import app.aaps.interfaces.rx.events.Event import info.nightscout.automation.actions.Action -import info.nightscout.rx.events.Event class EventAutomationUpdateAction(val action: Action, val position: Int) : Event() \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateGui.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateGui.kt index 7c719cb9e3..f495409027 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateGui.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateGui.kt @@ -1,5 +1,5 @@ package info.nightscout.automation.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventAutomationUpdateGui : Event() diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateTrigger.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateTrigger.kt index 6d1d79d07a..a26f350cc8 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateTrigger.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventAutomationUpdateTrigger.kt @@ -1,6 +1,6 @@ package info.nightscout.automation.events +import app.aaps.interfaces.rx.events.Event import info.nightscout.automation.triggers.TriggerConnector -import info.nightscout.rx.events.Event class EventAutomationUpdateTrigger(val trigger: TriggerConnector) : Event() diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventLocationChange.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventLocationChange.kt index 516084aa87..378b9cbb0e 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventLocationChange.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventLocationChange.kt @@ -1,6 +1,6 @@ package info.nightscout.automation.events import android.location.Location -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventLocationChange(var location: Location) : Event() diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerChanged.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerChanged.kt index 864140086e..12fb4d3f16 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerChanged.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerChanged.kt @@ -1,5 +1,5 @@ package info.nightscout.automation.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventTriggerChanged : Event() \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerClone.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerClone.kt index f72a32c43a..e936a45ca4 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerClone.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerClone.kt @@ -1,6 +1,6 @@ package info.nightscout.automation.events +import app.aaps.interfaces.rx.events.Event import info.nightscout.automation.triggers.Trigger -import info.nightscout.rx.events.Event class EventTriggerClone(val trigger: Trigger) : Event() \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerRemove.kt b/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerRemove.kt index abd7e2bf15..59ea482511 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerRemove.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/events/EventTriggerRemove.kt @@ -1,6 +1,6 @@ package info.nightscout.automation.events +import app.aaps.interfaces.rx.events.Event import info.nightscout.automation.triggers.Trigger -import info.nightscout.rx.events.Event class EventTriggerRemove(val trigger: Trigger) : Event() \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/services/LocationService.kt b/plugins/automation/src/main/java/info/nightscout/automation/services/LocationService.kt index 8685488122..23c852e336 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/services/LocationService.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/services/LocationService.kt @@ -14,19 +14,19 @@ import android.os.Binder import android.os.Bundle import android.os.IBinder import androidx.core.app.ActivityCompat +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.NotificationHolder +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.T import com.google.android.gms.location.LocationServices import dagger.android.DaggerService import info.nightscout.automation.R import info.nightscout.automation.events.EventLocationChange import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.NotificationHolder -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/services/LocationServiceHelper.kt b/plugins/automation/src/main/java/info/nightscout/automation/services/LocationServiceHelper.kt index c4becdaac2..a7f5dd0edc 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/services/LocationServiceHelper.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/services/LocationServiceHelper.kt @@ -6,7 +6,7 @@ import android.content.Intent import android.content.ServiceConnection import android.os.IBinder import app.aaps.annotations.OpenForTesting -import info.nightscout.interfaces.NotificationHolder +import app.aaps.interfaces.notifications.NotificationHolder import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt index 9085e803ce..adc726aedb 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt @@ -7,6 +7,17 @@ import android.widget.ImageButton import android.widget.LinearLayout import android.widget.TextView import androidx.appcompat.app.AppCompatActivity +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -16,17 +27,6 @@ import info.nightscout.automation.events.EventTriggerClone import info.nightscout.automation.events.EventTriggerRemove import info.nightscout.automation.services.LastLocationDataContainer import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerAutosensValue.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerAutosensValue.kt index 8021265c1c..9739c08468 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerAutosensValue.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerAutosensValue.kt @@ -1,6 +1,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -11,7 +12,6 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper.safeGetDouble import info.nightscout.core.utils.JsonHelper.safeGetString -import info.nightscout.rx.logging.LTag import org.json.JSONObject import java.text.DecimalFormat diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt index 3c1e0f3d66..028b2f3ecf 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBTDevice.kt @@ -7,6 +7,8 @@ import android.content.pm.PackageManager import android.os.Build import android.widget.LinearLayout import androidx.core.app.ActivityCompat +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.events.EventBTChange import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.AutomationPlugin @@ -17,8 +19,6 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.JsonHelper -import info.nightscout.rx.events.EventBTChange -import info.nightscout.rx.logging.LTag import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt index d6aff68e4c..ee179b3c95 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt @@ -1,6 +1,8 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -10,8 +12,6 @@ import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.rx.logging.LTag import org.json.JSONObject class TriggerBg(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt index 2b0c75b3b2..96315fa040 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt @@ -1,6 +1,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -13,7 +14,6 @@ import info.nightscout.core.utils.JsonHelper import info.nightscout.core.utils.JsonHelper.safeGetString import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.Bolus -import info.nightscout.rx.logging.LTag import org.json.JSONObject class TriggerBolusAgo(injector: HasAndroidInjector) : Trigger(injector) { @@ -83,7 +83,7 @@ class TriggerBolusAgo(injector: HasAndroidInjector) : Trigger(injector) { LayoutBuilder() .add(StaticLabel(rh, R.string.lastboluslabel, this)) .add(comparator) - .add(LabelWithElement(rh, rh.gs(R.string.lastboluslabel) + ": ", rh.gs(info.nightscout.interfaces.R.string.unit_minutes), minutesAgo)) + .add(LabelWithElement(rh, rh.gs(R.string.lastboluslabel) + ": ", rh.gs(app.aaps.interfaces.R.string.unit_minutes), minutesAgo)) .build(root) } } \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerCOB.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerCOB.kt index 988bbbf5a7..b8324e215f 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerCOB.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerCOB.kt @@ -1,6 +1,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -11,7 +12,6 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper import info.nightscout.core.utils.JsonHelper.safeGetDouble -import info.nightscout.rx.logging.LTag import org.json.JSONObject import java.text.DecimalFormat diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt index 92c6100a1a..2b6988ccd1 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt @@ -7,14 +7,14 @@ import android.view.ViewGroup import android.widget.LinearLayout import android.widget.TextView import androidx.annotation.StringRes +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.dialogs.ChooseOperationDialog import info.nightscout.core.ui.elements.VerticalTextView import info.nightscout.core.utils.JsonHelper.safeGetString -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONArray import org.json.JSONObject diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt index bbcfba28e8..949ef50384 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt @@ -1,6 +1,8 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -11,9 +13,6 @@ import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.rx.logging.LTag import org.json.JSONObject import java.text.DecimalFormat diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerHeartRate.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerHeartRate.kt index df05a95613..8b41ecf7d6 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerHeartRate.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerHeartRate.kt @@ -2,6 +2,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import androidx.annotation.VisibleForTesting +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -11,7 +12,6 @@ import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper -import info.nightscout.rx.logging.LTag import org.json.JSONObject import java.text.DecimalFormat diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerIob.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerIob.kt index 077a5cf927..d2d5905181 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerIob.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerIob.kt @@ -1,6 +1,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -10,7 +11,6 @@ import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper -import info.nightscout.rx.logging.LTag import org.json.JSONObject class TriggerIob(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerLocation.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerLocation.kt index fadee002e0..6cd3a17143 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerLocation.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerLocation.kt @@ -2,6 +2,7 @@ package info.nightscout.automation.triggers import android.location.Location import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -13,7 +14,6 @@ import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper -import info.nightscout.rx.logging.LTag import org.json.JSONObject import java.text.DecimalFormat diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerProfilePercent.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerProfilePercent.kt index 0421b47b43..18ba191d14 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerProfilePercent.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerProfilePercent.kt @@ -1,6 +1,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -11,7 +12,6 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.JsonHelper -import info.nightscout.rx.logging.LTag import org.json.JSONObject class TriggerProfilePercent(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerPumpLastConnection.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerPumpLastConnection.kt index 5b640105a0..7d5e749768 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerPumpLastConnection.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerPumpLastConnection.kt @@ -1,6 +1,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -11,7 +12,6 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper.safeGetInt import info.nightscout.core.utils.JsonHelper.safeGetString -import info.nightscout.rx.logging.LTag import org.json.JSONObject class TriggerPumpLastConnection(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt index 45848ea9e7..88ac9b3f3d 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt @@ -1,6 +1,8 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.utils.MidnightTime import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -11,8 +13,6 @@ import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.ui.elements.WeekDay import info.nightscout.core.utils.JsonHelper import info.nightscout.core.utils.MidnightUtils -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.rx.logging.LTag import org.json.JSONObject import java.util.Calendar import java.util.Objects diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt index 50e605d5ac..281507f552 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt @@ -1,6 +1,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -9,7 +10,6 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper import info.nightscout.database.ValueWrapper -import info.nightscout.rx.logging.LTag import org.json.JSONObject class TriggerTempTarget(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt index 6942b5a870..e7b8708e2a 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt @@ -1,6 +1,8 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.LTag import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -11,9 +13,6 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper import info.nightscout.database.ValueWrapper -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.rx.logging.LTag import org.json.JSONObject class TriggerTempTargetValue(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt index 07c5f0cc08..c0a54fdb47 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt @@ -1,6 +1,8 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.utils.T import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -8,8 +10,6 @@ import info.nightscout.automation.elements.InputDateTime import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.T import org.json.JSONObject class TriggerTime(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt index f7b7910960..102b89d880 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt @@ -1,6 +1,8 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.utils.MidnightTime import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -9,8 +11,6 @@ import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper.safeGetInt import info.nightscout.core.utils.MidnightUtils -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.rx.logging.LTag import org.json.JSONObject // Trigger for time range ( from 10:00AM till 13:00PM ) diff --git a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerWifiSsid.kt b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerWifiSsid.kt index 420b4a7e9c..4bd5904a73 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerWifiSsid.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/triggers/TriggerWifiSsid.kt @@ -1,6 +1,8 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.receivers.ReceiverStatusStore import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.automation.R @@ -10,8 +12,6 @@ import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.rx.logging.LTag import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt index 4c02090d76..a4ab1ab266 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt @@ -1,5 +1,8 @@ package info.nightscout.automation +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector @@ -9,9 +12,6 @@ import info.nightscout.automation.actions.ActionStopProcessing import info.nightscout.automation.triggers.TriggerConnector import info.nightscout.automation.triggers.TriggerConnectorTest import info.nightscout.automation.triggers.TriggerDummy -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.aps.Loop -import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/BolusTimerImplTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/BolusTimerImplTest.kt index 93ce4be0d3..8cfe0e02ca 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/BolusTimerImplTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/BolusTimerImplTest.kt @@ -1,6 +1,15 @@ package info.nightscout.automation import android.content.Context +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.impl.utils.DateUtilImpl import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector @@ -9,15 +18,6 @@ import info.nightscout.automation.services.LocationServiceHelper import info.nightscout.automation.triggers.Trigger import info.nightscout.automation.ui.TimerUtil import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/CarbTimerImplTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/CarbTimerImplTest.kt index 05496f96c2..3866046456 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/CarbTimerImplTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/CarbTimerImplTest.kt @@ -1,6 +1,15 @@ package info.nightscout.automation import android.content.Context +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.impl.utils.DateUtilImpl import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector @@ -9,15 +18,6 @@ import info.nightscout.automation.services.LocationServiceHelper import info.nightscout.automation.triggers.Trigger import info.nightscout.automation.ui.TimerUtil import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt index 119277f906..38056ef521 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt @@ -1,17 +1,17 @@ package info.nightscout.automation.actions import android.content.Context +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.automation.R import info.nightscout.automation.elements.InputString import info.nightscout.automation.ui.TimerUtil -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt index 78cdeef8da..ebfc399d81 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt @@ -1,12 +1,12 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.elements.InputCarePortalMenu import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputString import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.database.impl.transactions.Transaction -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.queue.Callback import io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt index 5291e952d7..f29cec2d66 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.queue.Callback import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt index 1fd455f364..0467b68437 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.queue.Callback import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt index a1ba7a4dad..8fa5f1f82a 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt @@ -1,10 +1,10 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.database.impl.transactions.Transaction -import info.nightscout.interfaces.queue.Callback import io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopSuspendTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopSuspendTest.kt index 3741f07496..ea4b00289b 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopSuspendTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionLoopSuspendTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration -import info.nightscout.interfaces.queue.Callback import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt index 18e2da1998..d9990b4cd3 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt @@ -1,6 +1,10 @@ package info.nightscout.automation.actions import android.content.Context +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector @@ -9,10 +13,6 @@ import info.nightscout.automation.elements.InputString import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.database.impl.transactions.Transaction -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.core.Completable import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchPercentTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchPercentTest.kt index 1cef0169c2..d7c1f98533 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchPercentTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchPercentTest.kt @@ -1,9 +1,9 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputPercent -import info.nightscout.interfaces.queue.Callback import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchTest.kt index 041638710d..0ff29e7a3a 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.automation.elements.InputProfileName -import info.nightscout.interfaces.queue.Callback import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionSendSMSTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionSendSMSTest.kt index 508e3c35b3..b541be254b 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionSendSMSTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionSendSMSTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.automation.elements.InputString -import info.nightscout.interfaces.queue.Callback import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt index 6ddec319a6..d477d29c0d 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt @@ -1,13 +1,13 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputTempTarget import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.database.impl.transactions.Transaction -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.queue.Callback import io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopProcessingTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopProcessingTest.kt index 1a33a1b119..1abb6cf98f 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopProcessingTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopProcessingTest.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R -import info.nightscout.interfaces.queue.Callback import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt index 759f6f63c0..e92a3898d5 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt @@ -1,10 +1,10 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.database.impl.transactions.Transaction -import info.nightscout.interfaces.queue.Callback import io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index 822ceb517b..5b4ce5da69 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -1,5 +1,20 @@ package info.nightscout.automation.actions +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileSource +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.smsCommunicator.SmsCommunicator import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector @@ -7,21 +22,6 @@ import info.nightscout.automation.triggers.Trigger import info.nightscout.core.constraints.ConstraintObject import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileSource -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.mockito.Mock import org.mockito.Mockito.`when` diff --git a/plugins/automation/src/test/java/info/nightscout/automation/elements/InputBgTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/elements/InputBgTest.kt index 27faf51d10..037374009a 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/elements/InputBgTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/elements/InputBgTest.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.elements +import app.aaps.interfaces.db.GlucoseUnit import info.nightscout.automation.triggers.TriggerTestBase -import info.nightscout.interfaces.GlucoseUnit import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/elements/InputTempTargetTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/elements/InputTempTargetTest.kt index a07ca38f1d..9829f69b2f 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/elements/InputTempTargetTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/elements/InputTempTargetTest.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.elements +import app.aaps.interfaces.db.GlucoseUnit import info.nightscout.automation.triggers.TriggerTestBase -import info.nightscout.interfaces.GlucoseUnit import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt index 63086df349..de99cf30ba 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt @@ -1,10 +1,10 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.InMemoryGlucoseValue import com.google.common.base.Optional import info.nightscout.automation.elements.Comparator import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.iob.InMemoryGlucoseValue import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach @@ -16,7 +16,7 @@ class TriggerBgTest : TriggerTestBase() { @BeforeEach fun prepare() { `when`(profileFunction.getUnits()).thenReturn(GlucoseUnit.MGDL) - } + } @Test fun shouldRunTest() { diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt index e36e39645b..0e4f51463b 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.iob.CobInfo import com.google.common.base.Optional import info.nightscout.automation.elements.Comparator -import info.nightscout.interfaces.iob.CobInfo import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt index 97cf9aba43..9eb4deeab5 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt @@ -1,12 +1,12 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.InMemoryGlucoseValue import com.google.common.truth.Truth.assertThat import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputDelta.DeltaType import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.iob.InMemoryGlucoseValue import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test @@ -54,7 +54,7 @@ class TriggerDeltaTest : TriggerTestBase() { @Test fun copyConstructorTest() { val t: TriggerDelta = TriggerDelta(injector).units(GlucoseUnit.MGDL).setValue(213.0, DeltaType.DELTA).comparator(Comparator.Compare.IS_EQUAL_OR_LESSER) val t1 = t.duplicate() as TriggerDelta - assertThat( t1.delta.value).isWithin( 0.01).of(213.0) + assertThat(t1.delta.value).isWithin(0.01).of(213.0) assertThat(t1.units).isEqualTo(GlucoseUnit.MGDL) assertThat(t.delta.deltaType).isEqualTo(DeltaType.DELTA) assertThat(t.comparator.value).isEqualTo(Comparator.Compare.IS_EQUAL_OR_LESSER) @@ -73,7 +73,7 @@ class TriggerDeltaTest : TriggerTestBase() { val t: TriggerDelta = TriggerDelta(injector).units(GlucoseUnit.MMOL).setValue(4.1, DeltaType.DELTA).comparator(Comparator.Compare.IS_EQUAL) val t2 = TriggerDummy(injector).instantiate(JSONObject(t.toJSON())) as TriggerDelta assertThat(t2.comparator.value).isEqualTo(Comparator.Compare.IS_EQUAL) - assertThat( t2.delta.value).isWithin( 0.01).of(4.1) + assertThat(t2.delta.value).isWithin(0.01).of(4.1) assertThat(t2.units).isEqualTo(GlucoseUnit.MMOL) assertThat(t2.delta.deltaType).isEqualTo(DeltaType.DELTA) } diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerIobTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerIobTest.kt index 3bceebb791..a56794448a 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerIobTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerIobTest.kt @@ -1,9 +1,9 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.iob.IobTotal import com.google.common.base.Optional import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator -import info.nightscout.interfaces.iob.IobTotal import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerRecurringTimeTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerRecurringTimeTest.kt index 52589edf90..311ce246c1 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerRecurringTimeTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerRecurringTimeTest.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.triggers -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.utils.T +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.T import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt index cf55361d2c..f9f24dbdb6 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt @@ -1,11 +1,11 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.db.GlucoseUnit import com.google.common.base.Optional import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.interfaces.GlucoseUnit import io.reactivex.rxjava3.core.Single import org.json.JSONObject import org.junit.jupiter.api.Assertions diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt index 587b824703..65e69a1a54 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt @@ -1,5 +1,7 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.receivers.ReceiverStatusStore import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector @@ -7,8 +9,6 @@ import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.services.LastLocationDataContainer import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.iob.GlucoseStatusProviderImpl -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.receivers.ReceiverStatusStore import org.junit.jupiter.api.BeforeEach import org.mockito.Mock import org.mockito.Mockito.`when` diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeRangeTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeRangeTest.kt index e99d14fd02..8382bae5a0 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeRangeTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeRangeTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.utils.MidnightTime import com.google.common.base.Optional import info.nightscout.automation.R -import info.nightscout.interfaces.utils.MidnightTime import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt index 7aed19d16a..7ad766684c 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.utils.T import com.google.common.base.Optional import info.nightscout.automation.R -import info.nightscout.shared.utils.T import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerWifiSsidTest.kt b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerWifiSsidTest.kt index ce32d44e96..637ecbb999 100644 --- a/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerWifiSsidTest.kt +++ b/plugins/automation/src/test/java/info/nightscout/automation/triggers/TriggerWifiSsidTest.kt @@ -1,9 +1,9 @@ package info.nightscout.automation.triggers +import app.aaps.interfaces.rx.events.EventNetworkChange import com.google.common.base.Optional import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator -import info.nightscout.rx.events.EventNetworkChange import org.json.JSONException import org.json.JSONObject import org.junit.jupiter.api.Assertions diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/AndroidPermissionImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/AndroidPermissionImpl.kt index cef58cd3b6..6439a2db7d 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/AndroidPermissionImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/AndroidPermissionImpl.kt @@ -14,14 +14,14 @@ import android.provider.Settings import androidx.core.content.ContextCompat import androidx.fragment.app.FragmentActivity import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/DaggerAppCompatActivityWithResult.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/DaggerAppCompatActivityWithResult.kt index ff7ff7ed5b..b3f8e25d41 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/DaggerAppCompatActivityWithResult.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/DaggerAppCompatActivityWithResult.kt @@ -9,15 +9,15 @@ import androidx.core.app.ActivityCompat import app.aaps.configuration.R import app.aaps.configuration.maintenance.CustomWatchfaceFileContract import app.aaps.configuration.maintenance.PrefsFileContract +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.maintenance.ImportExportPrefs +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventThemeSwitch import dagger.android.support.DaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.locale.LocaleHelper -import info.nightscout.interfaces.maintenance.ImportExportPrefs -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventThemeSwitch -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/SingleFragmentActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/SingleFragmentActivity.kt index 6758343857..b28ef43445 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/SingleFragmentActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/activities/SingleFragmentActivity.kt @@ -7,10 +7,10 @@ import android.view.MenuInflater import android.view.MenuItem import androidx.core.view.MenuProvider import app.aaps.configuration.R -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.ui.UiInteraction +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.ui.UiInteraction import javax.inject.Inject class SingleFragmentActivity : DaggerAppCompatActivityWithResult() { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderFragment.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderFragment.kt index ee366d6e84..b9fc41ae2f 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderFragment.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderFragment.kt @@ -7,18 +7,18 @@ import android.view.ViewGroup import app.aaps.configuration.R import app.aaps.configuration.configBuilder.events.EventConfigBuilderUpdateGui import app.aaps.configuration.databinding.ConfigbuilderFragmentBinding +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.protection.ProtectionCheck.Protection.PREFERENCES +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction import dagger.android.support.DaggerFragment import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.protection.ProtectionCheck.Protection.PREFERENCES -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.extensions.toVisibility import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt index 0da77d5fea..82ff8bd631 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/ConfigBuilderPlugin.kt @@ -15,37 +15,37 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import app.aaps.configuration.R import app.aaps.configuration.configBuilder.events.EventConfigBuilderUpdateGui +import app.aaps.interfaces.aps.APS +import app.aaps.interfaces.aps.Sensitivity +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileSource +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppInitialized +import app.aaps.interfaces.rx.events.EventConfigBuilderChange +import app.aaps.interfaces.rx.events.EventRebuildTabs +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.smoothing.Smoothing +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.sync.NsClient +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.aps.APS -import info.nightscout.interfaces.aps.Sensitivity -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileSource -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.smoothing.Smoothing -import info.nightscout.interfaces.source.BgSource -import info.nightscout.interfaces.sync.NsClient -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppInitialized -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.extensions.toVisibility -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import java.security.InvalidParameterException import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/RunningConfigurationImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/RunningConfigurationImpl.kt index 8773c43cd1..b13e36337c 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/RunningConfigurationImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/RunningConfigurationImpl.kt @@ -1,25 +1,25 @@ package app.aaps.configuration.configBuilder import app.aaps.configuration.R -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.aps.Sensitivity -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.smoothing.Smoothing -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.aps.Sensitivity +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.smoothing.Smoothing +import app.aaps.interfaces.ui.UiInteraction import info.nightscout.sdk.interfaces.RunningConfiguration import info.nightscout.sdk.localmodel.devicestatus.NSDeviceStatus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt index acae807d24..a957dca1e7 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/configBuilder/events/EventConfigBuilderUpdateGui.kt @@ -1,5 +1,5 @@ package app.aaps.configuration.configBuilder.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventConfigBuilderUpdateGui : EventUpdateGui() \ No newline at end of file diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/di/ConfigurationModule.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/di/ConfigurationModule.kt index 8c3eacc3eb..520639560d 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/di/ConfigurationModule.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/di/ConfigurationModule.kt @@ -12,13 +12,13 @@ import app.aaps.configuration.maintenance.activities.CustomWatchfaceImportListAc import app.aaps.configuration.maintenance.activities.LogSettingActivity import app.aaps.configuration.maintenance.activities.PrefImportListActivity import app.aaps.configuration.maintenance.formats.EncryptedPrefsFormat +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.maintenance.ImportExportPrefs +import app.aaps.interfaces.maintenance.PrefFileListProvider import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.maintenance.ImportExportPrefs -import info.nightscout.interfaces.maintenance.PrefFileListProvider import info.nightscout.sdk.interfaces.RunningConfiguration @Module( diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt index e14c6897a3..6578870f86 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/ImportExportPrefsImpl.kt @@ -27,6 +27,32 @@ import app.aaps.configuration.maintenance.data.PrefsFormat import app.aaps.configuration.maintenance.data.PrefsStatusImpl import app.aaps.configuration.maintenance.dialogs.PrefImportSummaryDialog import app.aaps.configuration.maintenance.formats.EncryptedPrefsFormat +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.maintenance.ImportExportPrefs +import app.aaps.interfaces.maintenance.PrefFileListProvider +import app.aaps.interfaces.maintenance.PrefMetadata +import app.aaps.interfaces.maintenance.PrefsFile +import app.aaps.interfaces.maintenance.PrefsMetadataKey +import app.aaps.interfaces.protection.PasswordCheck +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventDiaconnG8PumpLogReset +import app.aaps.interfaces.rx.weardata.CwfData +import app.aaps.interfaces.rx.weardata.CwfMetadataKey +import app.aaps.interfaces.rx.weardata.ZipWatchfaceFormat +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.storage.Storage +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.userEntry.UserEntryPresentationHelper +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.dialogs.TwoMessagesAlertDialog @@ -36,32 +62,6 @@ import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.maintenance.ImportExportPrefs -import info.nightscout.interfaces.maintenance.PrefFileListProvider -import info.nightscout.interfaces.maintenance.PrefMetadata -import info.nightscout.interfaces.maintenance.PrefsFile -import info.nightscout.interfaces.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.protection.PasswordCheck -import info.nightscout.interfaces.storage.Storage -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.userEntry.UserEntryPresentationHelper -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventDiaconnG8PumpLogReset -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.rx.weardata.CwfData -import info.nightscout.rx.weardata.CwfMetadataKey -import info.nightscout.rx.weardata.ZipWatchfaceFormat -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 kotlinx.coroutines.Dispatchers import java.io.File import java.io.FileNotFoundException diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt index fd4ea994ba..3b7736dc2b 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenanceFragment.kt @@ -9,6 +9,25 @@ import androidx.core.text.toSpanned import app.aaps.configuration.R import app.aaps.configuration.databinding.MaintenanceFragmentBinding import app.aaps.configuration.maintenance.activities.LogSettingActivity +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.extensions.runOnUiThread +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.maintenance.ImportExportPrefs +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.OwnDatabasePlugin +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.protection.ProtectionCheck.Protection.PREFERENCES +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.sync.DataSyncSelectorXdrip +import app.aaps.interfaces.ui.UiInteraction import dagger.android.support.DaggerFragment import info.nightscout.core.graph.OverviewData import info.nightscout.core.ui.dialogs.OKDialog @@ -16,24 +35,6 @@ import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.maintenance.ImportExportPrefs -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.OwnDatabasePlugin -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.protection.ProtectionCheck.Protection.PREFERENCES -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.sync.DataSyncSelectorXdrip -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPreferenceChange -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 io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign @@ -105,7 +106,7 @@ class MaintenanceFragment : DaggerFragment() { onError = { aapsLogger.error("Error clearing databases", it) }, onComplete = { rxBus.send(EventPreferenceChange(rh.gs(info.nightscout.core.utils.R.string.key_units))) - info.nightscout.shared.extensions.runOnUiThread { activity.recreate() } + runOnUiThread { activity.recreate() } } ) uel.log(Action.RESET_DATABASES, Sources.Maintenance) diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenancePlugin.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenancePlugin.kt index 4108babb0a..f1aed50ea8 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenancePlugin.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/MaintenancePlugin.kt @@ -5,17 +5,17 @@ import android.content.Intent import android.net.Uri import androidx.core.content.FileProvider import app.aaps.configuration.R +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LoggerUtils +import app.aaps.interfaces.maintenance.PrefFileListProvider +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.logging.LoggerUtils -import info.nightscout.interfaces.maintenance.PrefFileListProvider -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -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 import java.io.File diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefFileListProviderImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefFileListProviderImpl.kt index f3b586016d..ca374e19e7 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefFileListProviderImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefFileListProviderImpl.kt @@ -7,22 +7,22 @@ import app.aaps.configuration.R import app.aaps.configuration.maintenance.data.PrefMetadataMap import app.aaps.configuration.maintenance.data.PrefsStatusImpl import app.aaps.configuration.maintenance.formats.EncryptedPrefsFormat +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.maintenance.PrefFileListProvider +import app.aaps.interfaces.maintenance.PrefMetadata +import app.aaps.interfaces.maintenance.PrefsFile +import app.aaps.interfaces.maintenance.PrefsImportDir +import app.aaps.interfaces.maintenance.PrefsMetadataKey +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.weardata.CwfData +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.rx.weardata.ZipWatchfaceFormat +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.storage.Storage +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import dagger.Lazy import dagger.Reusable -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.maintenance.PrefFileListProvider -import info.nightscout.interfaces.maintenance.PrefMetadata -import info.nightscout.interfaces.maintenance.PrefsFile -import info.nightscout.interfaces.maintenance.PrefsImportDir -import info.nightscout.interfaces.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.storage.Storage -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.weardata.CwfData -import info.nightscout.rx.weardata.EventData -import info.nightscout.rx.weardata.ZipWatchfaceFormat -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.joda.time.DateTime import org.joda.time.Days import org.joda.time.Hours diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsFileContract.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsFileContract.kt index b9c9637e5f..869fc0cd65 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsFileContract.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsFileContract.kt @@ -5,8 +5,8 @@ import android.content.Intent import androidx.activity.result.contract.ActivityResultContract import androidx.fragment.app.FragmentActivity import app.aaps.configuration.maintenance.activities.PrefImportListActivity +import app.aaps.interfaces.maintenance.PrefsFile import info.nightscout.core.utils.extensions.safeGetParcelableExtra -import info.nightscout.interfaces.maintenance.PrefsFile class PrefsFileContract : ActivityResultContract() { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsMetadataKeyImpl.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsMetadataKeyImpl.kt index ba66637b34..7b796b90b8 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsMetadataKeyImpl.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/PrefsMetadataKeyImpl.kt @@ -5,7 +5,7 @@ import androidx.annotation.DrawableRes import androidx.annotation.StringRes import app.aaps.configuration.R import app.aaps.configuration.maintenance.data.PrefsFormat -import info.nightscout.interfaces.maintenance.PrefsMetadataKey +import app.aaps.interfaces.maintenance.PrefsMetadataKey enum class PrefsMetadataKeyImpl(override val key: String, @DrawableRes override val icon: Int, @StringRes override val label: Int) : PrefsMetadataKey { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt index daf4978049..c4fccb69a1 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/CustomWatchfaceImportListActivity.kt @@ -10,27 +10,27 @@ import androidx.recyclerview.widget.RecyclerView import app.aaps.configuration.R import app.aaps.configuration.databinding.CustomWatchfaceImportListActivityBinding import app.aaps.configuration.databinding.CustomWatchfaceImportListItemBinding +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.maintenance.PrefFileListProvider +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventMobileDataToWear +import app.aaps.interfaces.rx.weardata.CUSTOM_VERSION +import app.aaps.interfaces.rx.weardata.CwfData +import app.aaps.interfaces.rx.weardata.CwfMetadataKey.CWF_AUTHOR +import app.aaps.interfaces.rx.weardata.CwfMetadataKey.CWF_AUTHOR_VERSION +import app.aaps.interfaces.rx.weardata.CwfMetadataKey.CWF_CREATED_AT +import app.aaps.interfaces.rx.weardata.CwfMetadataKey.CWF_FILENAME +import app.aaps.interfaces.rx.weardata.CwfMetadataKey.CWF_NAME +import app.aaps.interfaces.rx.weardata.CwfMetadataKey.CWF_VERSION +import app.aaps.interfaces.rx.weardata.CwfMetadataMap +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.rx.weardata.ResFileMap +import app.aaps.interfaces.rx.weardata.ZipWatchfaceFormat +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.interfaces.maintenance.PrefFileListProvider -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventMobileDataToWear -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.weardata.CUSTOM_VERSION -import info.nightscout.rx.weardata.CwfData -import info.nightscout.rx.weardata.CwfMetadataKey.CWF_AUTHOR -import info.nightscout.rx.weardata.CwfMetadataKey.CWF_AUTHOR_VERSION -import info.nightscout.rx.weardata.CwfMetadataKey.CWF_CREATED_AT -import info.nightscout.rx.weardata.CwfMetadataKey.CWF_FILENAME -import info.nightscout.rx.weardata.CwfMetadataKey.CWF_NAME -import info.nightscout.rx.weardata.CwfMetadataKey.CWF_VERSION -import info.nightscout.rx.weardata.CwfMetadataMap -import info.nightscout.rx.weardata.EventData -import info.nightscout.rx.weardata.ResFileMap -import info.nightscout.rx.weardata.ZipWatchfaceFormat -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject class CustomWatchfaceImportListActivity : TranslatedDaggerAppCompatActivity() { @@ -93,7 +93,7 @@ class CustomWatchfaceImportListActivity : TranslatedDaggerAppCompatActivity() { val drawable = customWatchfaceFile.resDatas[ResFileMap.CUSTOM_WATCHFACE.fileName]?.toDrawable(resources) with(holder.customWatchfaceImportListItemBinding) { val fileName = metadata[CWF_FILENAME]?.let { "$it${ZipWatchfaceFormat.CWF_EXTENTION}" } ?: "" - filelistName.text = rh.gs(info.nightscout.interfaces.R.string.metadata_wear_import_filename, fileName) + filelistName.text = rh.gs(app.aaps.interfaces.R.string.metadata_wear_import_filename, fileName) filelistName.tag = customWatchfaceFile customWatchface.setImageDrawable(drawable) customName.text = rh.gs(CWF_NAME.label, metadata[CWF_NAME]) diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/LogSettingActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/LogSettingActivity.kt index 7d16d03bcd..0a78233521 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/LogSettingActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/LogSettingActivity.kt @@ -7,10 +7,10 @@ import android.widget.LinearLayout import android.widget.TextView import app.aaps.configuration.R import app.aaps.configuration.databinding.ActivityLogsettingBinding +import app.aaps.interfaces.logging.L +import app.aaps.interfaces.logging.LogElement +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.rx.interfaces.L -import info.nightscout.rx.interfaces.LogElement -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class LogSettingActivity : TranslatedDaggerAppCompatActivity() { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/PrefImportListActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/PrefImportListActivity.kt index 7f36ce5512..113677ff00 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/PrefImportListActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/activities/PrefImportListActivity.kt @@ -14,10 +14,10 @@ import app.aaps.configuration.databinding.MaintenanceImportListItemBinding import app.aaps.configuration.maintenance.PrefsFileContract import app.aaps.configuration.maintenance.PrefsMetadataKeyImpl import app.aaps.configuration.maintenance.data.PrefsStatusImpl +import app.aaps.interfaces.maintenance.PrefFileListProvider +import app.aaps.interfaces.maintenance.PrefsFile +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.interfaces.maintenance.PrefFileListProvider -import info.nightscout.interfaces.maintenance.PrefsFile -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class PrefImportListActivity : TranslatedDaggerAppCompatActivity() { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/data/PrefsFormat.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/data/PrefsFormat.kt index fad0e4959c..888df1b663 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/data/PrefsFormat.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/data/PrefsFormat.kt @@ -2,9 +2,9 @@ package app.aaps.configuration.maintenance.data import androidx.annotation.DrawableRes import app.aaps.configuration.R -import info.nightscout.interfaces.maintenance.PrefMetadata -import info.nightscout.interfaces.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.maintenance.PrefsStatus +import app.aaps.interfaces.maintenance.PrefMetadata +import app.aaps.interfaces.maintenance.PrefsMetadataKey +import app.aaps.interfaces.maintenance.PrefsStatus import kotlinx.parcelize.Parcelize import java.io.File diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt index e0a59b7c57..53701fbd3b 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/dialogs/PrefImportSummaryDialog.kt @@ -19,9 +19,9 @@ import androidx.appcompat.view.ContextThemeWrapper import app.aaps.configuration.R import app.aaps.configuration.maintenance.data.Prefs import app.aaps.configuration.maintenance.data.PrefsStatusImpl +import app.aaps.interfaces.extensions.runOnUiThread import com.google.android.material.dialog.MaterialAlertDialogBuilder import info.nightscout.core.ui.toast.ToastUtils -import info.nightscout.shared.extensions.runOnUiThread import java.util.LinkedList object PrefImportSummaryDialog { @@ -57,8 +57,8 @@ object PrefImportSummaryDialog { (rowLayout.findViewById(R.id.summary_icon) as ImageView).setImageResource(metaKey.icon) (rowLayout.findViewById(R.id.status_icon) as ImageView).setImageResource(metaEntry.status.icon) - if (metaEntry.status == PrefsStatusImpl.WARN) label.setTextColor(themedCtx.getColor(info.nightscout.interfaces.R.color.metadataTextWarning)) - else if (metaEntry.status == PrefsStatusImpl.ERROR) label.setTextColor(themedCtx.getColor(info.nightscout.interfaces.R.color.metadataTextError)) + if (metaEntry.status == PrefsStatusImpl.WARN) label.setTextColor(themedCtx.getColor(app.aaps.interfaces.R.color.metadataTextWarning)) + else if (metaEntry.status == PrefsStatusImpl.ERROR) label.setTextColor(themedCtx.getColor(app.aaps.interfaces.R.color.metadataTextError)) if (metaEntry.info != null) { details.add("${context.getString(metaKey.label)}: ${metaEntry.value}
${metaEntry.info}") diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormat.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormat.kt index 2c5d2b188c..fc045d5fbc 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormat.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormat.kt @@ -9,14 +9,14 @@ import app.aaps.configuration.maintenance.data.PrefMetadataMap import app.aaps.configuration.maintenance.data.Prefs import app.aaps.configuration.maintenance.data.PrefsFormat import app.aaps.configuration.maintenance.data.PrefsStatusImpl +import app.aaps.interfaces.maintenance.PrefMetadata +import app.aaps.interfaces.maintenance.PrefsMetadataKey +import app.aaps.interfaces.maintenance.PrefsStatus +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.storage.Storage import info.nightscout.core.utils.CryptoUtil import info.nightscout.core.utils.hexStringToByteArray import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.maintenance.PrefMetadata -import info.nightscout.interfaces.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.maintenance.PrefsStatus -import info.nightscout.interfaces.storage.Storage -import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONException import org.json.JSONObject import java.io.File diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWDefinition.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWDefinition.kt index f55d75e2df..1e3974b013 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWDefinition.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWDefinition.kt @@ -20,34 +20,34 @@ import app.aaps.configuration.setupwizard.elements.SWInfoText import app.aaps.configuration.setupwizard.elements.SWPlugin import app.aaps.configuration.setupwizard.elements.SWPreference import app.aaps.configuration.setupwizard.elements.SWRadioButton +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.Objectives +import app.aaps.interfaces.maintenance.ImportExportPrefs +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.Medtrum +import app.aaps.interfaces.pump.OmnipodDash +import app.aaps.interfaces.pump.OmnipodEros +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventSWRLStatus +import app.aaps.interfaces.rx.events.EventSWSyncStatus +import app.aaps.interfaces.rx.events.EventSWUpdate +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import dagger.android.HasAndroidInjector import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.CryptoUtil import info.nightscout.core.utils.isRunningTest -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.Objectives -import info.nightscout.interfaces.maintenance.ImportExportPrefs -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.Medtrum -import info.nightscout.interfaces.pump.OmnipodDash -import info.nightscout.interfaces.pump.OmnipodEros -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventSWRLStatus -import info.nightscout.rx.events.EventSWSyncStatus -import info.nightscout.rx.events.EventSWUpdate -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWEventListener.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWEventListener.kt index 470763b1e9..ac27a72eb4 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWEventListener.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWEventListener.kt @@ -6,9 +6,9 @@ import android.view.View import android.widget.LinearLayout import android.widget.TextView import app.aaps.configuration.setupwizard.elements.SWItem +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.events.EventStatus import dagger.android.HasAndroidInjector -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.events.EventStatus import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWScreen.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWScreen.kt index a521d7b5ef..2a8dd17247 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWScreen.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SWScreen.kt @@ -1,8 +1,8 @@ package app.aaps.configuration.setupwizard import app.aaps.configuration.setupwizard.elements.SWItem +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.HasAndroidInjector -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class SWScreen(val injector: HasAndroidInjector, private var header: Int) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SetupWizardActivity.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SetupWizardActivity.kt index 12b0744e67..43419088ff 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SetupWizardActivity.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/SetupWizardActivity.kt @@ -13,19 +13,19 @@ import app.aaps.configuration.R import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult import app.aaps.configuration.databinding.ActivitySetupwizardBinding import app.aaps.configuration.setupwizard.elements.SWItem +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.events.EventProfileStoreChanged +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventSWRLStatus +import app.aaps.interfaces.rx.events.EventSWSyncStatus +import app.aaps.interfaces.rx.events.EventSWUpdate +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.locale.LocaleHelper.update import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.events.EventProfileStoreChanged -import info.nightscout.rx.events.EventProfileSwitchChanged -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventSWRLStatus -import info.nightscout.rx.events.EventSWSyncStatus -import info.nightscout.rx.events.EventSWUpdate -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditEncryptedPassword.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditEncryptedPassword.kt index 85b9288161..63bdf90d61 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditEncryptedPassword.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditEncryptedPassword.kt @@ -9,9 +9,9 @@ import android.widget.Button import android.widget.EditText import android.widget.LinearLayout import android.widget.TextView +import app.aaps.interfaces.extensions.toVisibility import dagger.android.HasAndroidInjector import info.nightscout.core.utils.CryptoUtil -import info.nightscout.shared.extensions.toVisibility class SWEditEncryptedPassword(injector: HasAndroidInjector, private val cryptoUtil: CryptoUtil) : SWItem(injector, Type.STRING) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditIntNumber.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditIntNumber.kt index 199a739bcf..19147aed56 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditIntNumber.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditIntNumber.kt @@ -6,9 +6,9 @@ import android.text.TextWatcher import android.view.View import android.widget.LinearLayout import android.widget.TextView +import app.aaps.interfaces.utils.SafeParse import dagger.android.HasAndroidInjector import info.nightscout.core.ui.elements.NumberPicker -import info.nightscout.shared.SafeParse import java.text.DecimalFormat class SWEditIntNumber(injector: HasAndroidInjector, private val init: Int, private val min: Int, private val max: Int) : SWItem(injector, Type.NUMBER) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumber.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumber.kt index 8a97027d8b..95e857840c 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumber.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumber.kt @@ -6,9 +6,9 @@ import android.text.TextWatcher import android.view.View import android.widget.LinearLayout import android.widget.TextView +import app.aaps.interfaces.utils.SafeParse import dagger.android.HasAndroidInjector import info.nightscout.core.ui.elements.NumberPicker -import info.nightscout.shared.SafeParse import java.text.DecimalFormat class SWEditNumber(injector: HasAndroidInjector, private val init: Double, private val min: Double, private val max: Double) : SWItem(injector, Type.DECIMAL_NUMBER) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumberWithUnits.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumberWithUnits.kt index a04d0c4e7e..ea1581ad63 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumberWithUnits.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWEditNumberWithUnits.kt @@ -6,12 +6,12 @@ import android.text.TextWatcher import android.view.View import android.widget.LinearLayout import android.widget.TextView +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.utils.SafeParse import dagger.android.HasAndroidInjector import info.nightscout.core.ui.elements.NumberPicker -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ProfileUtil import java.text.DecimalFormat import javax.inject.Inject diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWItem.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWItem.kt index ccfdc1a1cb..40e8421fd8 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWItem.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWItem.kt @@ -6,15 +6,15 @@ import android.view.View import android.widget.LinearLayout import androidx.annotation.StringRes import androidx.appcompat.app.AppCompatActivity +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.protection.PasswordCheck +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventSWUpdate +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.protection.PasswordCheck -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventSWUpdate -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 java.util.concurrent.Executors import java.util.concurrent.ScheduledFuture import java.util.concurrent.TimeUnit diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPlugin.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPlugin.kt index e1816a5316..1f2b7a42a6 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPlugin.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPlugin.kt @@ -4,13 +4,13 @@ import android.widget.LinearLayout import androidx.annotation.StringRes import app.aaps.configuration.configBuilder.events.EventConfigBuilderUpdateGui import app.aaps.configuration.setupwizard.SWDefinition +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.security.InvalidParameterException diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPreference.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPreference.kt index d0196a6363..ae42eabc36 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPreference.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/elements/SWPreference.kt @@ -4,8 +4,8 @@ import android.os.Bundle import android.widget.LinearLayout import androidx.fragment.app.Fragment import app.aaps.configuration.setupwizard.SWDefinition +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.ui.UiInteraction import javax.inject.Inject class SWPreference(injector: HasAndroidInjector, private val definition: SWDefinition) : SWItem(injector, Type.PREFERENCE) { diff --git a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/events/EventSWLabel.kt b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/events/EventSWLabel.kt index 4df4e42ac9..cf98c43f45 100644 --- a/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/events/EventSWLabel.kt +++ b/plugins/configuration/src/main/kotlin/app/aaps/configuration/setupwizard/events/EventSWLabel.kt @@ -1,5 +1,5 @@ package app.aaps.configuration.setupwizard.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventSWLabel(var label: String) : Event() \ No newline at end of file diff --git a/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormatTest.kt b/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormatTest.kt index 99b2bea211..06188c8cf7 100644 --- a/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormatTest.kt +++ b/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/EncryptedPrefsFormatTest.kt @@ -5,11 +5,11 @@ import app.aaps.configuration.maintenance.data.PrefFormatError import app.aaps.configuration.maintenance.data.Prefs import app.aaps.configuration.maintenance.data.PrefsFormat import app.aaps.configuration.maintenance.data.PrefsStatusImpl +import app.aaps.interfaces.maintenance.PrefMetadata +import app.aaps.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase import com.google.common.truth.TruthJUnit.assume import info.nightscout.core.utils.CryptoUtil -import info.nightscout.interfaces.maintenance.PrefMetadata -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/SingleStringStorage.kt b/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/SingleStringStorage.kt index 2c6c8b8908..809d7364fa 100644 --- a/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/SingleStringStorage.kt +++ b/plugins/configuration/src/test/kotlin/app/aaps/configuration/maintenance/formats/SingleStringStorage.kt @@ -1,6 +1,6 @@ package app.aaps.configuration.maintenance.formats -import info.nightscout.interfaces.storage.Storage +import app.aaps.interfaces.storage.Storage import java.io.File class SingleStringStorage(var contents: String) : Storage { diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/ConstraintsCheckerImpl.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/ConstraintsCheckerImpl.kt index 527e9051b2..3065a1c5ba 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/ConstraintsCheckerImpl.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/ConstraintsCheckerImpl.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.constraints +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt index 3e2a9adf07..3aa717f150 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt @@ -1,25 +1,25 @@ package info.nightscout.plugins.constraints.bgQualityCheck import androidx.annotation.DrawableRes +import app.aaps.interfaces.bgQualityCheck.BgQualityCheck +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventBucketedDataCreated +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.bgQualityCheck.BgQualityCheck -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.constraints.R -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventBucketedDataCreated -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -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 diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/PluginsConstraintsModule.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/PluginsConstraintsModule.kt index f212ea58de..28853d174b 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/PluginsConstraintsModule.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/di/PluginsConstraintsModule.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.constraints.di +import app.aaps.interfaces.bgQualityCheck.BgQualityCheck +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import dagger.Binds import dagger.Module -import info.nightscout.interfaces.bgQualityCheck.BgQualityCheck -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.plugins.constraints.ConstraintsCheckerImpl import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin import info.nightscout.plugins.constraints.versionChecker.VersionCheckerUtilsImpl diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt index d51b2d833e..e370d7633b 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt @@ -1,20 +1,20 @@ package info.nightscout.plugins.constraints.dstHelper +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.constraints.R -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 java.util.Calendar import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt index 6c299b94c1..cef2a3875e 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesFragment.kt @@ -16,6 +16,16 @@ import androidx.appcompat.app.AppCompatActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearSmoothScroller import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNtpStatus +import app.aaps.interfaces.rx.events.EventSWUpdate +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.HtmlHelper @@ -23,8 +33,6 @@ import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.receivers.ReceiverStatusStore import info.nightscout.plugins.constraints.R import info.nightscout.plugins.constraints.databinding.ObjectivesFragmentBinding import info.nightscout.plugins.constraints.databinding.ObjectivesItemBinding @@ -32,14 +40,6 @@ import info.nightscout.plugins.constraints.objectives.activities.ObjectivesExamD import info.nightscout.plugins.constraints.objectives.dialogs.NtpProgressDialog import info.nightscout.plugins.constraints.objectives.events.EventObjectivesUpdateGui import info.nightscout.plugins.constraints.objectives.objectives.Objective.ExamTask -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNtpStatus -import info.nightscout.rx.events.EventSWUpdate -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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesPlugin.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesPlugin.kt index 9fec153972..7c6ec336ff 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesPlugin.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/ObjectivesPlugin.kt @@ -1,21 +1,24 @@ package info.nightscout.plugins.constraints.objectives +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.Objectives +import app.aaps.interfaces.constraints.Objectives.Companion.AUTOSENS_OBJECTIVE +import app.aaps.interfaces.constraints.Objectives.Companion.AUTO_OBJECTIVE +import app.aaps.interfaces.constraints.Objectives.Companion.DYN_ISF_OBJECTIVE +import app.aaps.interfaces.constraints.Objectives.Companion.FIRST_OBJECTIVE +import app.aaps.interfaces.constraints.Objectives.Companion.MAXBASAL_OBJECTIVE +import app.aaps.interfaces.constraints.Objectives.Companion.MAXIOB_ZERO_CL_OBJECTIVE +import app.aaps.interfaces.constraints.Objectives.Companion.SMB_OBJECTIVE +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.Objectives -import info.nightscout.interfaces.constraints.Objectives.Companion.AUTOSENS_OBJECTIVE -import info.nightscout.interfaces.constraints.Objectives.Companion.AUTO_OBJECTIVE -import info.nightscout.interfaces.constraints.Objectives.Companion.DYN_ISF_OBJECTIVE -import info.nightscout.interfaces.constraints.Objectives.Companion.FIRST_OBJECTIVE -import info.nightscout.interfaces.constraints.Objectives.Companion.MAXBASAL_OBJECTIVE -import info.nightscout.interfaces.constraints.Objectives.Companion.MAXIOB_ZERO_CL_OBJECTIVE -import info.nightscout.interfaces.constraints.Objectives.Companion.SMB_OBJECTIVE -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.constraints.R import info.nightscout.plugins.constraints.objectives.objectives.Objective import info.nightscout.plugins.constraints.objectives.objectives.Objective0 @@ -29,9 +32,6 @@ import info.nightscout.plugins.constraints.objectives.objectives.Objective5 import info.nightscout.plugins.constraints.objectives.objectives.Objective6 import info.nightscout.plugins.constraints.objectives.objectives.Objective7 import info.nightscout.plugins.constraints.objectives.objectives.Objective9 -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 diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/SntpClient.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/SntpClient.kt index f2d7a1d0dc..b7b6444bad 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/SntpClient.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/SntpClient.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.constraints.objectives import android.os.SystemClock -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.DateUtil +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.utils.DateUtil import java.net.DatagramPacket import java.net.DatagramSocket import java.net.InetAddress @@ -11,191 +11,192 @@ import javax.inject.Inject import javax.inject.Singleton /** -* {@hide} -* -* -* Simple SNTP client class for retrieving network time. -* -* -* Sample usage: -*
SntpClient client = new SntpClient();
-* if (client.requestTime("time.foo.com")) {
-* long now = client.getNtpTime() + SystemClock.elapsedRealtime() - client.getNtpTimeReference();
-* }
+ * {@hide}
+ *
+ *
+ * Simple SNTP client class for retrieving network time.
+ *
+ *
+ * Sample usage:
+ * 
SntpClient client = new SntpClient();
+ * if (client.requestTime("time.foo.com")) {
+ * long now = client.getNtpTime() + SystemClock.elapsedRealtime() - client.getNtpTimeReference();
+ * }
 
* -*/ + */ @Singleton class SntpClient @Inject constructor( private val aapsLogger: AAPSLogger, private val dateUtil: DateUtil ) { - companion object { - //private final int REFERENCE_TIME_OFFSET = 16; - private const val ORIGINATE_TIME_OFFSET = 24 - private const val RECEIVE_TIME_OFFSET = 32 - private const val TRANSMIT_TIME_OFFSET = 40 - private const val NTP_PACKET_SIZE = 48 - private const val NTP_PORT = 123 - private const val NTP_MODE_CLIENT = 3 - private const val NTP_VERSION = 3 + companion object { - // Number of seconds between Jan 1, 1900 and Jan 1, 1970 - // 70 years plus 17 leap days - private const val OFFSET_1900_TO_1970 = (365L * 70L + 17L) * 24L * 60L * 60L - } + //private final int REFERENCE_TIME_OFFSET = 16; + private const val ORIGINATE_TIME_OFFSET = 24 + private const val RECEIVE_TIME_OFFSET = 32 + private const val TRANSMIT_TIME_OFFSET = 40 + private const val NTP_PACKET_SIZE = 48 + private const val NTP_PORT = 123 + private const val NTP_MODE_CLIENT = 3 + private const val NTP_VERSION = 3 - /** - * Returns the time computed from the NTP transaction. - * - * @return time value computed from NTP server response. - */ - // system time computed from NTP server response - private var ntpTime: Long = 0 + // Number of seconds between Jan 1, 1900 and Jan 1, 1970 + // 70 years plus 17 leap days + private const val OFFSET_1900_TO_1970 = (365L * 70L + 17L) * 24L * 60L * 60L + } - /** - * Returns the reference clock value (value of SystemClock.elapsedRealtime()) - * corresponding to the NTP time. - * - * @return reference clock corresponding to the NTP time. - */ - // value of SystemClock.elapsedRealtime() corresponding to mNtpTime - private var ntpTimeReference: Long = 0 + /** + * Returns the time computed from the NTP transaction. + * + * @return time value computed from NTP server response. + */ + // system time computed from NTP server response + private var ntpTime: Long = 0 - /** - * Returns the round trip time of the NTP transaction - * - * @return round trip time in milliseconds. - */ - // round trip time in milliseconds - private var roundTripTime: Long = 0 + /** + * Returns the reference clock value (value of SystemClock.elapsedRealtime()) + * corresponding to the NTP time. + * + * @return reference clock corresponding to the NTP time. + */ + // value of SystemClock.elapsedRealtime() corresponding to mNtpTime + private var ntpTimeReference: Long = 0 - abstract class Callback : Runnable { + /** + * Returns the round trip time of the NTP transaction + * + * @return round trip time in milliseconds. + */ + // round trip time in milliseconds + private var roundTripTime: Long = 0 - var networkConnected = false - var success = false - var time: Long = 0 - } + abstract class Callback : Runnable { - @Synchronized fun ntpTime(callback: Callback, isConnected: Boolean) { - callback.networkConnected = isConnected - if (callback.networkConnected) { - Thread { doNtpTime(callback) }.start() - } else { - callback.run() - } - } + var networkConnected = false + var success = false + var time: Long = 0 + } - fun doNtpTime(callback: Callback) { - aapsLogger.debug("Time detection started") - callback.success = requestTime("time.google.com", 5000) - callback.time = ntpTime + SystemClock.elapsedRealtime() - ntpTimeReference - aapsLogger.debug("Time detection ended: " + callback.success + " " + dateUtil.dateAndTimeString(ntpTime)) - callback.run() - } + @Synchronized fun ntpTime(callback: Callback, isConnected: Boolean) { + callback.networkConnected = isConnected + if (callback.networkConnected) { + Thread { doNtpTime(callback) }.start() + } else { + callback.run() + } + } - /** - * Sends an SNTP request to the given host and processes the response. - * - * @param host host name of the server. - * @param timeout network timeout in milliseconds. - * @return true if the transaction was successful. - */ - @Suppress("SameParameterValue") - @Synchronized private fun requestTime(host: String, timeout: Int): Boolean { - try { - val socket = DatagramSocket() - socket.soTimeout = timeout - val address = InetAddress.getByName(host) - val buffer = ByteArray(NTP_PACKET_SIZE) - val request = DatagramPacket(buffer, buffer.size, address, NTP_PORT) + fun doNtpTime(callback: Callback) { + aapsLogger.debug("Time detection started") + callback.success = requestTime("time.google.com", 5000) + callback.time = ntpTime + SystemClock.elapsedRealtime() - ntpTimeReference + aapsLogger.debug("Time detection ended: " + callback.success + " " + dateUtil.dateAndTimeString(ntpTime)) + callback.run() + } - // set mode = 3 (client) and version = 3 - // mode is in low 3 bits of first byte - // version is in bits 3-5 of first byte - buffer[0] = (NTP_MODE_CLIENT or (NTP_VERSION shl 3)).toByte() + /** + * Sends an SNTP request to the given host and processes the response. + * + * @param host host name of the server. + * @param timeout network timeout in milliseconds. + * @return true if the transaction was successful. + */ + @Suppress("SameParameterValue") + @Synchronized private fun requestTime(host: String, timeout: Int): Boolean { + try { + val socket = DatagramSocket() + socket.soTimeout = timeout + val address = InetAddress.getByName(host) + val buffer = ByteArray(NTP_PACKET_SIZE) + val request = DatagramPacket(buffer, buffer.size, address, NTP_PORT) - // get current time and write it to the request packet - val requestTime = System.currentTimeMillis() - val requestTicks = SystemClock.elapsedRealtime() - writeTimeStamp(buffer, TRANSMIT_TIME_OFFSET, requestTime) - socket.send(request) + // set mode = 3 (client) and version = 3 + // mode is in low 3 bits of first byte + // version is in bits 3-5 of first byte + buffer[0] = (NTP_MODE_CLIENT or (NTP_VERSION shl 3)).toByte() - // read the response - val response = DatagramPacket(buffer, buffer.size) - socket.receive(response) - val responseTicks = SystemClock.elapsedRealtime() - val responseTime = requestTime + (responseTicks - requestTicks) - socket.close() + // get current time and write it to the request packet + val requestTime = System.currentTimeMillis() + val requestTicks = SystemClock.elapsedRealtime() + writeTimeStamp(buffer, TRANSMIT_TIME_OFFSET, requestTime) + socket.send(request) - // extract the results - val originateTime = readTimeStamp(buffer, ORIGINATE_TIME_OFFSET) - val receiveTime = readTimeStamp(buffer, RECEIVE_TIME_OFFSET) - val transmitTime = readTimeStamp(buffer, TRANSMIT_TIME_OFFSET) - val roundTripTime = responseTicks - requestTicks - (transmitTime - receiveTime) - val clockOffset = (receiveTime - originateTime + (transmitTime - responseTime)) / 2 + // read the response + val response = DatagramPacket(buffer, buffer.size) + socket.receive(response) + val responseTicks = SystemClock.elapsedRealtime() + val responseTime = requestTime + (responseTicks - requestTicks) + socket.close() - // save our results - use the times on this side of the network latency - // (response rather than request time) - ntpTime = responseTime + clockOffset - ntpTimeReference = responseTicks - this.roundTripTime = roundTripTime - } catch (e: Exception) { - aapsLogger.debug("request time failed: $e") - return false - } - return true - } + // extract the results + val originateTime = readTimeStamp(buffer, ORIGINATE_TIME_OFFSET) + val receiveTime = readTimeStamp(buffer, RECEIVE_TIME_OFFSET) + val transmitTime = readTimeStamp(buffer, TRANSMIT_TIME_OFFSET) + val roundTripTime = responseTicks - requestTicks - (transmitTime - receiveTime) + val clockOffset = (receiveTime - originateTime + (transmitTime - responseTime)) / 2 - /** - * Reads an unsigned 32 bit big endian number from the given offset in the buffer. - */ - private fun read32(buffer: ByteArray, offset: Int): Long { - val b0 = buffer[offset] - val b1 = buffer[offset + 1] - val b2 = buffer[offset + 2] - val b3 = buffer[offset + 3] + // save our results - use the times on this side of the network latency + // (response rather than request time) + ntpTime = responseTime + clockOffset + ntpTimeReference = responseTicks + this.roundTripTime = roundTripTime + } catch (e: Exception) { + aapsLogger.debug("request time failed: $e") + return false + } + return true + } - // convert signed bytes to unsigned values - val i0 = if (b0.toInt() and 0x80 == 0x80) (b0.toInt() and 0x7F) + 0x80 else b0.toInt() - val i1 = if (b1.toInt() and 0x80 == 0x80) (b1.toInt() and 0x7F) + 0x80 else b1.toInt() - val i2 = if (b2.toInt() and 0x80 == 0x80) (b2.toInt() and 0x7F) + 0x80 else b2.toInt() - val i3 = if (b3.toInt() and 0x80 == 0x80) (b3.toInt() and 0x7F) + 0x80 else b3.toInt() - return (i0.toLong() shl 24) + (i1.toLong() shl 16) + (i2.toLong() shl 8) + i3.toLong() - } + /** + * Reads an unsigned 32 bit big endian number from the given offset in the buffer. + */ + private fun read32(buffer: ByteArray, offset: Int): Long { + val b0 = buffer[offset] + val b1 = buffer[offset + 1] + val b2 = buffer[offset + 2] + val b3 = buffer[offset + 3] - /** - * Reads the NTP time stamp at the given offset in the buffer and returns - * it as a system time (milliseconds since January 1, 1970). - */ - private fun readTimeStamp(buffer: ByteArray, offset: Int): Long { - val seconds = read32(buffer, offset) - val fraction = read32(buffer, offset + 4) - return (seconds - OFFSET_1900_TO_1970) * 1000 + fraction * 1000L / 0x100000000L - } + // convert signed bytes to unsigned values + val i0 = if (b0.toInt() and 0x80 == 0x80) (b0.toInt() and 0x7F) + 0x80 else b0.toInt() + val i1 = if (b1.toInt() and 0x80 == 0x80) (b1.toInt() and 0x7F) + 0x80 else b1.toInt() + val i2 = if (b2.toInt() and 0x80 == 0x80) (b2.toInt() and 0x7F) + 0x80 else b2.toInt() + val i3 = if (b3.toInt() and 0x80 == 0x80) (b3.toInt() and 0x7F) + 0x80 else b3.toInt() + return (i0.toLong() shl 24) + (i1.toLong() shl 16) + (i2.toLong() shl 8) + i3.toLong() + } - /** - * Writes system time (milliseconds since January 1, 1970) as an NTP time stamp - * at the given offset in the buffer. - */ - @Suppress("SameParameterValue") - private fun writeTimeStamp(buffer: ByteArray, offsetParam: Int, time: Long) { - var offset = offsetParam - var seconds = time / 1000L - val milliseconds = time - seconds * 1000L - seconds += OFFSET_1900_TO_1970 + /** + * Reads the NTP time stamp at the given offset in the buffer and returns + * it as a system time (milliseconds since January 1, 1970). + */ + private fun readTimeStamp(buffer: ByteArray, offset: Int): Long { + val seconds = read32(buffer, offset) + val fraction = read32(buffer, offset + 4) + return (seconds - OFFSET_1900_TO_1970) * 1000 + fraction * 1000L / 0x100000000L + } - // write seconds in big endian format - buffer[offset++] = (seconds shr 24).toByte() - buffer[offset++] = (seconds shr 16).toByte() - buffer[offset++] = (seconds shr 8).toByte() - buffer[offset++] = (seconds shr 0).toByte() - val fraction = milliseconds * 0x100000000L / 1000L - // write fraction in big endian format - buffer[offset++] = (fraction shr 24).toByte() - buffer[offset++] = (fraction shr 16).toByte() - buffer[offset++] = (fraction shr 8).toByte() - // low order bits should be random data - buffer[offset] = SecureRandom().nextInt(256).toByte() - } + /** + * Writes system time (milliseconds since January 1, 1970) as an NTP time stamp + * at the given offset in the buffer. + */ + @Suppress("SameParameterValue") + private fun writeTimeStamp(buffer: ByteArray, offsetParam: Int, time: Long) { + var offset = offsetParam + var seconds = time / 1000L + val milliseconds = time - seconds * 1000L + seconds += OFFSET_1900_TO_1970 + + // write seconds in big endian format + buffer[offset++] = (seconds shr 24).toByte() + buffer[offset++] = (seconds shr 16).toByte() + buffer[offset++] = (seconds shr 8).toByte() + buffer[offset++] = (seconds shr 0).toByte() + val fraction = milliseconds * 0x100000000L / 1000L + // write fraction in big endian format + buffer[offset++] = (fraction shr 24).toByte() + buffer[offset++] = (fraction shr 16).toByte() + buffer[offset++] = (fraction shr 8).toByte() + // low order bits should be random data + buffer[offset] = SecureRandom().nextInt(256).toByte() + } } \ No newline at end of file diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt index 3ac4ebfdda..9801da3ea6 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt @@ -4,6 +4,10 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerDialogFragment import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.plugins.constraints.R @@ -12,10 +16,6 @@ import info.nightscout.plugins.constraints.objectives.events.EventObjectivesUpda import info.nightscout.plugins.constraints.objectives.objectives.Objective import info.nightscout.plugins.constraints.objectives.objectives.Objective.ExamTask import info.nightscout.plugins.constraints.objectives.objectives.Objective.Option -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import javax.inject.Inject class ObjectivesExamDialog : DaggerDialogFragment() { @@ -37,8 +37,10 @@ class ObjectivesExamDialog : DaggerDialogFragment() { // onDestroyView. private val binding get() = _binding!! - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { // load data from bundle (savedInstanceState ?: arguments)?.let { bundle -> currentTask = bundle.getInt("currentTask", 0) diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt index 0c8b0738e8..714a5a3219 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/dialogs/NtpProgressDialog.kt @@ -5,15 +5,15 @@ import android.os.SystemClock import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNtpStatus import dagger.android.support.DaggerDialogFragment import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.plugins.constraints.databinding.DialogNtpProgressBinding -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNtpStatus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -37,8 +37,10 @@ class NtpProgressDialog : DaggerDialogFragment() { // onDestroyView. private val binding get() = _binding!! - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { isCancelable = false state = savedInstanceState?.getString("state", null) @@ -73,18 +75,18 @@ class NtpProgressDialog : DaggerDialogFragment() { .toObservable(EventNtpStatus::class.java) .observeOn(aapsSchedulers.main) .subscribe({ event: EventNtpStatus -> - if (_binding != null) { - aapsLogger.debug(LTag.UI, "Status: " + event.status + " Percent: " + event.percent) - binding.status.text = event.status - binding.progressbar.progress = event.percent - if (event.percent == 100) { - SystemClock.sleep(100) - dismiss() - } - state = event.status - percent = event.percent - } - }, fabricPrivacy::logException) + if (_binding != null) { + aapsLogger.debug(LTag.UI, "Status: " + event.status + " Percent: " + event.percent) + binding.status.text = event.status + binding.progressbar.progress = event.percent + if (event.percent == 100) { + SystemClock.sleep(100) + dismiss() + } + state = event.status + percent = event.percent + } + }, fabricPrivacy::logException) } override fun onPause() { diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt index 208d11625e..a10cc409e5 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/events/EventObjectivesUpdateGui.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.constraints.objectives.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventObjectivesUpdateGui : EventUpdateGui() \ No newline at end of file diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective.kt index f87d5e86ec..e50dc6f058 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective.kt @@ -6,12 +6,12 @@ import android.widget.CheckBox import android.widget.TextView import androidx.annotation.StringRes import androidx.fragment.app.FragmentActivity +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.plugins.constraints.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 javax.inject.Inject import kotlin.math.floor @@ -75,7 +75,8 @@ abstract class Objective(injector: HasAndroidInjector, spName: String, @StringRe open fun specialActionEnabled(): Boolean = true @Suppress("unused") - open fun specialAction(activity: FragmentActivity, input: String) {} + open fun specialAction(activity: FragmentActivity, input: String) { + } abstract inner class Task(var objective: Objective, @StringRes val task: Int) { @@ -185,5 +186,5 @@ abstract class Objective(injector: HasAndroidInjector, spName: String, @StringRe } } - inner class Learned internal constructor(@StringRes var learned: Int) + inner class Learned internal constructor(@StringRes var learned: Int) } \ No newline at end of file diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt index 30f8842359..dec690b8d9 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective0.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.pump.VirtualPump +import app.aaps.interfaces.sync.Tidepool import dagger.android.HasAndroidInjector import info.nightscout.database.ValueWrapper -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.pump.VirtualPump -import info.nightscout.interfaces.sync.Tidepool import info.nightscout.plugins.constraints.R import javax.inject.Inject diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective1.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective1.kt index 3947dabca8..f2b48df603 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective1.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective1.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.actions.Actions +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.actions.Actions -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.constraints.R import javax.inject.Inject diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective10.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective10.kt index 7bbfe25256..a4163faaf2 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective10.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective10.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.plugins.constraints.R -import info.nightscout.shared.utils.T class Objective10(injector: HasAndroidInjector) : Objective(injector, "auto", R.string.objectives_auto_objective, R.string.objectives_auto_gate) { diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective11.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective11.kt index febdc830f2..466d241d4e 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective11.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective11.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.plugins.constraints.R -import info.nightscout.shared.utils.T class Objective11(injector: HasAndroidInjector) : Objective(injector, "dyn_isf", R.string.objectives_dyn_isf_objective, R.string.objectives_dyn_isf_gate) { diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective3.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective3.kt index 3ce157f2d6..d9ffc29830 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective3.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective3.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.constraints.R -import info.nightscout.shared.utils.T import javax.inject.Inject @Suppress("SpellCheckingInspection") diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective4.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective4.kt index 5081cbfbef..ac44e3d166 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective4.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective4.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.plugins.constraints.R -import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject @Suppress("SpellCheckingInspection") diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective5.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective5.kt index a540cc659a..34901bc6d4 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective5.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective5.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.plugins.constraints.R import info.nightscout.plugins.constraints.safety.SafetyPlugin -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.T import javax.inject.Inject @Suppress("SpellCheckingInspection") diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective6.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective6.kt index 0b0b586b5d..c493308916 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective6.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective6.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.aps.ApsMode +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.ApsMode -import info.nightscout.interfaces.constraints.ConstraintsChecker import info.nightscout.plugins.constraints.R -import info.nightscout.shared.utils.T import javax.inject.Inject @Suppress("SpellCheckingInspection") diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective7.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective7.kt index e4b91808b6..8447003018 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective7.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective7.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.plugins.constraints.R -import info.nightscout.shared.utils.T class Objective7(injector: HasAndroidInjector) : Objective(injector, "autosens", R.string.objectives_autosens_objective, R.string.objectives_autosens_gate) { diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective9.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective9.kt index b8ac9b6d74..76c9ef1516 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective9.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/objectives/objectives/Objective9.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.constraints.objectives.objectives +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.plugins.constraints.R -import info.nightscout.shared.utils.T class Objective9(injector: HasAndroidInjector) : Objective(injector, "smb", R.string.objectives_smb_objective, R.string.objectives_smb_gate) { diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt index bab63a246d..fedf5746b5 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt @@ -2,15 +2,15 @@ package info.nightscout.plugins.constraints.phoneChecker import android.content.Context import android.os.Build +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper import com.scottyab.rootbeer.RootBeer import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.constraints.R -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/safety/SafetyPlugin.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/safety/SafetyPlugin.kt index 802110d7be..f30a659a93 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/safety/SafetyPlugin.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/safety/SafetyPlugin.kt @@ -1,5 +1,27 @@ package info.nightscout.plugins.constraints.safety +import app.aaps.interfaces.aps.ApsMode +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.constraints.Safety +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.Round import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.utils.extensions.putDouble @@ -8,29 +30,7 @@ import info.nightscout.core.utils.extensions.putString import info.nightscout.core.utils.extensions.storeDouble import info.nightscout.core.utils.extensions.storeInt import info.nightscout.core.utils.extensions.storeString -import info.nightscout.interfaces.ApsMode -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.constraints.Safety -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.constraints.R -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 org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt index 97f966f3e1..e5e3239aac 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt @@ -4,18 +4,18 @@ import android.content.Context import android.content.pm.PackageManager import android.os.Handler import android.os.HandlerThread +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.constraints.R -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.spongycastle.util.encoders.Hex import java.io.ByteArrayOutputStream import java.io.File diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt index 5d9c7f1603..026a51e58a 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt @@ -3,19 +3,19 @@ package info.nightscout.plugins.constraints.storage import android.os.Environment import android.os.StatFs import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.constraints.R -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 diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt index b2f27e1b9a..d15deac7d7 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt @@ -1,21 +1,21 @@ package info.nightscout.plugins.constraints.versionChecker +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.plugins.constraints.R -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 java.util.concurrent.TimeUnit import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt index cdd2b8d0c5..a2484be80a 100644 --- a/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt +++ b/plugins/constraints/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerUtilsImpl.kt @@ -1,19 +1,19 @@ package info.nightscout.plugins.constraints.versionChecker import android.os.Build +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import dagger.Lazy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.plugins.constraints.R -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 java.io.IOException import java.net.URL import java.util.concurrent.TimeUnit diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt index b27c5e8d82..e6d16f5405 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/ConstraintsCheckerImplTest.kt @@ -1,5 +1,22 @@ package info.nightscout.plugins.constraints +import app.aaps.interfaces.aps.ApsMode +import app.aaps.interfaces.bgQualityCheck.BgQualityCheck +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.Objectives +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profiling.Profiler +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -11,23 +28,6 @@ import info.nightscout.androidaps.insight.database.InsightDbHelper import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.iob.GlucoseStatusProviderImpl -import info.nightscout.interfaces.ApsMode -import info.nightscout.interfaces.bgQualityCheck.BgQualityCheck -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.Objectives -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.profiling.Profiler -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt index 0b2289f04a..5689924f48 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt @@ -1,5 +1,13 @@ package info.nightscout.plugins.constraints.bgQualityCheck +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.bgQualityCheck.BgQualityCheck +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -7,15 +15,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.bgQualityCheck.BgQualityCheck -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.constraints.R -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers.any diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt index 2088d8cf81..39ec1a7b5b 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.constraints.dstHelper +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/objectives/ObjectivesPluginTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/objectives/ObjectivesPluginTest.kt index 13ad8819b2..22360e49cd 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/objectives/ObjectivesPluginTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/objectives/ObjectivesPluginTest.kt @@ -1,18 +1,18 @@ package info.nightscout.plugins.constraints.objectives +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.Objectives +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.constraints.Objectives -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.constraints.R import info.nightscout.plugins.constraints.objectives.objectives.Objective -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/objectives/SntpClientTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/objectives/SntpClientTest.kt index 3e78a1f826..1658cbe2e7 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/objectives/SntpClientTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/objectives/SntpClientTest.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.constraints.objectives +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.Test import org.mockito.Mock import kotlin.math.abs diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/safety/SafetyPluginTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/safety/SafetyPluginTest.kt index 8ed36396aa..1dfb87bbe7 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/safety/SafetyPluginTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/safety/SafetyPluginTest.kt @@ -1,22 +1,22 @@ package info.nightscout.plugins.constraints.safety +import app.aaps.interfaces.aps.ApsMode +import app.aaps.interfaces.bgQualityCheck.BgQualityCheck +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profiling.Profiler +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.ApsMode -import info.nightscout.interfaces.bgQualityCheck.BgQualityCheck -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profiling.Profiler -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.pump.virtual.VirtualPumpPlugin diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/signatureVerifier/VersionCheckerUtilsKtTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/signatureVerifier/VersionCheckerUtilsKtTest.kt index fc0e9cfc3f..4f980ec25a 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/signatureVerifier/VersionCheckerUtilsKtTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/signatureVerifier/VersionCheckerUtilsKtTest.kt @@ -1,17 +1,17 @@ package info.nightscout.plugins.constraints.signatureVerifier +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.Lazy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.plugins.constraints.versionChecker.VersionCheckerUtilsImpl import info.nightscout.plugins.constraints.versionChecker.numericVersionPart -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers.anyInt diff --git a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt index 7e2c1d7597..52fe9ed167 100644 --- a/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt +++ b/plugins/constraints/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.constraints.storage +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinFragment.kt b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinFragment.kt index 6c55e30cce..3a19426281 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinFragment.kt +++ b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinFragment.kt @@ -4,10 +4,10 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.support.DaggerFragment import info.nightscout.insulin.databinding.InsulinFragmentBinding -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class InsulinFragment : DaggerFragment() { @@ -21,8 +21,10 @@ class InsulinFragment : DaggerFragment() { // onDestroyView. private val binding get() = _binding!! - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { _binding = InsulinFragmentBinding.inflate(inflater, container, false) return binding.root } diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinLyumjevPlugin.kt b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinLyumjevPlugin.kt index dbd270c221..9045b64d11 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinLyumjevPlugin.kt +++ b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinLyumjevPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt index 4e5d3582ef..61419d6b16 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefBasePlugin.kt @@ -1,22 +1,22 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.iob.Iob +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InsulinConfiguration -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.iob.Iob -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.T import kotlin.math.exp import kotlin.math.pow diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefFreePeakPlugin.kt b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefFreePeakPlugin.kt index 60582ac68f..acc8cc66ae 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefFreePeakPlugin.kt +++ b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefFreePeakPlugin.kt @@ -1,17 +1,17 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import dagger.android.HasAndroidInjector import info.nightscout.core.utils.extensions.putInt import info.nightscout.core.utils.extensions.storeInt -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -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 org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefRapidActingPlugin.kt b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefRapidActingPlugin.kt index 16d4764b96..3c32ad0593 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefRapidActingPlugin.kt +++ b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefRapidActingPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPlugin.kt b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPlugin.kt index b4a0bb19a5..3cf96d4341 100644 --- a/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPlugin.kt +++ b/plugins/insulin/src/main/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinLyumjevPluginTest.kt b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinLyumjevPluginTest.kt index 1d3f02b7df..01411bf67f 100644 --- a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinLyumjevPluginTest.kt +++ b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinLyumjevPluginTest.kt @@ -1,16 +1,16 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefBasePluginTest.kt b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefBasePluginTest.kt index 76874d63fc..ee1ef0d981 100644 --- a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefBasePluginTest.kt +++ b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefBasePluginTest.kt @@ -1,18 +1,18 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.entities.Bolus -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefFreePeakPluginTest.kt b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefFreePeakPluginTest.kt index af2a707086..b90a4c5cee 100644 --- a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefFreePeakPluginTest.kt +++ b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefFreePeakPluginTest.kt @@ -1,16 +1,16 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers.anyInt diff --git a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefRapidActingPluginTest.kt b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefRapidActingPluginTest.kt index cd56e05515..f317c45a42 100644 --- a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefRapidActingPluginTest.kt +++ b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefRapidActingPluginTest.kt @@ -1,16 +1,16 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPluginTest.kt b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPluginTest.kt index 6082a7fe9b..33efaacf51 100644 --- a/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPluginTest.kt +++ b/plugins/insulin/src/test/java/info/nightscout/insulin/InsulinOrefUltraRapidActingPluginTest.kt @@ -1,16 +1,16 @@ package info.nightscout.insulin +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.HardLimits import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/plugins/main/src/main/java/info/nightscout/plugins/di/OverviewModule.kt b/plugins/main/src/main/java/info/nightscout/plugins/di/OverviewModule.kt index 30ed8c5ea0..d0d15ef4a4 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/di/OverviewModule.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/di/OverviewModule.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.di +import app.aaps.interfaces.overview.OverviewMenus import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.interfaces.overview.OverviewMenus import info.nightscout.plugins.general.overview.OverviewFragment import info.nightscout.plugins.general.overview.OverviewMenusImpl import info.nightscout.plugins.general.overview.graphData.GraphData diff --git a/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt b/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt index 7cf567fff0..f5a24196ec 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.di +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.smsCommunicator.SmsCommunicator import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.plugins.general.persistentNotification.DummyService import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.general.wear.WearFragment @@ -33,7 +33,6 @@ abstract class PluginsModule { @ContributesAndroidInjector abstract fun contributesDummyService(): DummyService @ContributesAndroidInjector abstract fun autosensDataObjectInjector(): AutosensDataObject - @Module interface Bindings { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/di/ProfileModule.kt b/plugins/main/src/main/java/info/nightscout/plugins/di/ProfileModule.kt index f9a1642a8e..8409b312cf 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/di/ProfileModule.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/di/ProfileModule.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.di +import app.aaps.interfaces.profile.ProfileSource import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.plugins.profile.ProfileFragment import info.nightscout.plugins.profile.ProfilePlugin diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt index e47ea70c75..4da7cf669c 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsFragment.kt @@ -7,6 +7,30 @@ import android.view.View import android.view.ViewGroup import android.widget.LinearLayout import androidx.core.content.ContextCompat +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.pump.actions.CustomAction +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventCustomActionsChanged +import app.aaps.interfaces.rx.events.EventExtendedBolusChange +import app.aaps.interfaces.rx.events.EventInitializationChanged +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.rx.events.EventTherapyEventChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import dagger.android.support.DaggerFragment import info.nightscout.core.extensions.toStringMedium import info.nightscout.core.extensions.toStringShort @@ -18,34 +42,10 @@ import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.R import info.nightscout.plugins.databinding.ActionsFragmentBinding import info.nightscout.plugins.general.overview.ui.StatusLightHandler import info.nightscout.plugins.skins.SkinProvider -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventCustomActionsChanged -import info.nightscout.rx.events.EventExtendedBolusChange -import info.nightscout.rx.events.EventInitializationChanged -import info.nightscout.rx.events.EventTempBasalChange -import info.nightscout.rx.events.EventTherapyEventChange -import info.nightscout.rx.logging.AAPSLogger -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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsPlugin.kt index c4d93b566b..b0e5509d7d 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/actions/ActionsPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.general.actions +import app.aaps.interfaces.actions.Actions +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.actions.Actions -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt index b9e3f6a094..00d2628c77 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt @@ -11,6 +11,16 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventFoodDatabaseChanged +import app.aaps.interfaces.ui.UiInteraction import dagger.android.support.DaggerFragment import info.nightscout.core.ui.UIRunnable import info.nightscout.core.ui.dialogs.OKDialog @@ -20,19 +30,9 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateFoodTransaction -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.R import info.nightscout.plugins.databinding.FoodFragmentBinding import info.nightscout.plugins.databinding.FoodItemBinding -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventFoodDatabaseChanged -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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Locale diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt index 0f7e008f65..4b136bbd15 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.general.food +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton @@ -17,11 +17,11 @@ class FoodPlugin @Inject constructor( rh: ResourceHelper ) : PluginBase( PluginDescription() - .mainType(PluginType.GENERAL) - .fragmentClass(FoodFragment::class.java.name) - .pluginIcon(info.nightscout.core.main.R.drawable.ic_food) - .pluginName(R.string.food) - .shortName(R.string.food_short) - .description(R.string.description_food), + .mainType(PluginType.GENERAL) + .fragmentClass(FoodFragment::class.java.name) + .pluginIcon(info.nightscout.core.main.R.drawable.ic_food) + .pluginName(R.string.food) + .shortName(R.string.food_short) + .description(R.string.description_food), aapsLogger, rh, injector ) \ No newline at end of file diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt index 6a166b5cb8..bc3e43a2dd 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewFragment.kt @@ -24,6 +24,58 @@ import android.widget.RelativeLayout import android.widget.TextView import androidx.core.text.toSpanned import androidx.recyclerview.widget.LinearLayoutManager +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.aps.VariableSensitivityResult +import app.aaps.interfaces.automation.Automation +import app.aaps.interfaces.bgQualityCheck.BgQualityCheck +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.extensions.runOnUiThread +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.extensions.toVisibilityKeepSpace +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.overview.OverviewMenus +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAcceptOpenLoopChange +import app.aaps.interfaces.rx.events.EventBucketedDataCreated +import app.aaps.interfaces.rx.events.EventEffectiveProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventExtendedBolusChange +import app.aaps.interfaces.rx.events.EventMobileToWear +import app.aaps.interfaces.rx.events.EventNewOpenLoopNotification +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.rx.events.EventScale +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.rx.events.EventTempTargetChange +import app.aaps.interfaces.rx.events.EventUpdateOverviewCalcProgress +import app.aaps.interfaces.rx.events.EventUpdateOverviewGraph +import app.aaps.interfaces.rx.events.EventUpdateOverviewIobCob +import app.aaps.interfaces.rx.events.EventUpdateOverviewSensitivity +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.DexcomBoyda +import app.aaps.interfaces.source.XDripSource +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.TrendCalculator import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment @@ -43,31 +95,6 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.aps.VariableSensitivityResult -import info.nightscout.interfaces.automation.Automation -import info.nightscout.interfaces.bgQualityCheck.BgQualityCheck -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.overview.OverviewMenus -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.source.DexcomBoyda -import info.nightscout.interfaces.source.XDripSource -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.TrendCalculator import info.nightscout.plugins.R import info.nightscout.plugins.databinding.OverviewFragmentBinding import info.nightscout.plugins.general.overview.graphData.GraphData @@ -75,33 +102,6 @@ import info.nightscout.plugins.general.overview.notifications.NotificationStore import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification import info.nightscout.plugins.general.overview.ui.StatusLightHandler import info.nightscout.plugins.skins.SkinProvider -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAcceptOpenLoopChange -import info.nightscout.rx.events.EventBucketedDataCreated -import info.nightscout.rx.events.EventEffectiveProfileSwitchChanged -import info.nightscout.rx.events.EventExtendedBolusChange -import info.nightscout.rx.events.EventMobileToWear -import info.nightscout.rx.events.EventNewOpenLoopNotification -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.events.EventScale -import info.nightscout.rx.events.EventTempBasalChange -import info.nightscout.rx.events.EventTempTargetChange -import info.nightscout.rx.events.EventUpdateOverviewCalcProgress -import info.nightscout.rx.events.EventUpdateOverviewGraph -import info.nightscout.rx.events.EventUpdateOverviewIobCob -import info.nightscout.rx.events.EventUpdateOverviewSensitivity -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.extensions.toVisibilityKeepSpace -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Locale @@ -1089,7 +1089,8 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList _binding ?: return val lastAutosensData = overviewData.lastAutosensData(iobCobCalculator) if (config.NSCLIENT && sp.getBoolean(info.nightscout.core.utils.R.string.key_used_autosens_on_main_phone, false) || - !config.NSCLIENT && constraintChecker.isAutosensModeEnabled().value()) { + !config.NSCLIENT && constraintChecker.isAutosensModeEnabled().value() + ) { binding.infoLayout.sensitivityIcon.setImageResource(info.nightscout.core.main.R.drawable.ic_swap_vert_black_48dp_green) } else { binding.infoLayout.sensitivityIcon.setImageResource(info.nightscout.core.main.R.drawable.ic_x_swap_vert) diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewMenusImpl.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewMenusImpl.kt index b8871d5beb..b52e210085 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewMenusImpl.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewMenusImpl.kt @@ -10,18 +10,18 @@ import android.widget.ImageButton import androidx.annotation.AttrRes import androidx.annotation.StringRes import androidx.appcompat.widget.PopupMenu +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.overview.OverviewMenus +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.rx.events.EventScale +import app.aaps.interfaces.sharedPreferences.SP import com.google.gson.Gson import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.overview.OverviewMenus import info.nightscout.plugins.R -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.events.EventScale -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 @@ -36,19 +36,108 @@ class OverviewMenusImpl @Inject constructor( private val fabricPrivacy: FabricPrivacy ) : OverviewMenus { - enum class CharTypeData(@StringRes val nameId: Int, @AttrRes val attrId: Int, @AttrRes val attrTextId: Int, val primary: Boolean, val secondary: Boolean, @StringRes val shortnameId: Int, val enabledByDefault: Boolean = false) { - PRE(R.string.overview_show_predictions, info.nightscout.core.ui.R.attr.predictionColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = true, secondary = false, shortnameId = R.string.prediction_shortname, enabledByDefault = true), - TREAT(R.string.overview_show_treatments, info.nightscout.core.ui.R.attr.cobColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = true, secondary = false, shortnameId = R.string.treatments_shortname, enabledByDefault = true), - BAS(R.string.overview_show_basals, info.nightscout.core.ui.R.attr.basal, info.nightscout.core.ui.R.attr.menuTextColor, primary = true, secondary = false, shortnameId = R.string.basal_shortname, enabledByDefault = true), - ABS(R.string.overview_show_abs_insulin, info.nightscout.core.ui.R.attr.iobColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = false, secondary = true, shortnameId = R.string.abs_insulin_shortname), - IOB(R.string.overview_show_iob, info.nightscout.core.ui.R.attr.iobColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = false, secondary = true, shortnameId = info.nightscout.core.ui.R.string.iob), - COB(R.string.overview_show_cob, info.nightscout.core.ui.R.attr.cobColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = false, secondary = true, shortnameId = info.nightscout.core.ui.R.string.cob), - DEV(R.string.overview_show_deviations, info.nightscout.core.ui.R.attr.bgiColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = false, secondary = true, shortnameId = R.string.deviation_shortname), + enum class CharTypeData( + @StringRes val nameId: Int, + @AttrRes val attrId: Int, + @AttrRes val attrTextId: Int, + val primary: Boolean, + val secondary: Boolean, + @StringRes val shortnameId: Int, + val enabledByDefault: Boolean = false + ) { + + PRE( + R.string.overview_show_predictions, + info.nightscout.core.ui.R.attr.predictionColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = true, + secondary = false, + shortnameId = R.string.prediction_shortname, + enabledByDefault = true + ), + TREAT( + R.string.overview_show_treatments, + info.nightscout.core.ui.R.attr.cobColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = true, + secondary = false, + shortnameId = R.string.treatments_shortname, + enabledByDefault = true + ), + BAS( + R.string.overview_show_basals, + info.nightscout.core.ui.R.attr.basal, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = true, + secondary = false, + shortnameId = R.string.basal_shortname, + enabledByDefault = true + ), + ABS( + R.string.overview_show_abs_insulin, + info.nightscout.core.ui.R.attr.iobColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = false, + secondary = true, + shortnameId = R.string.abs_insulin_shortname + ), + IOB( + R.string.overview_show_iob, + info.nightscout.core.ui.R.attr.iobColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = false, + secondary = true, + shortnameId = info.nightscout.core.ui.R.string.iob + ), + COB( + R.string.overview_show_cob, + info.nightscout.core.ui.R.attr.cobColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = false, + secondary = true, + shortnameId = info.nightscout.core.ui.R.string.cob + ), + DEV( + R.string.overview_show_deviations, + info.nightscout.core.ui.R.attr.bgiColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = false, + secondary = true, + shortnameId = R.string.deviation_shortname + ), BGI(R.string.overview_show_bgi, info.nightscout.core.ui.R.attr.bgiColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = false, secondary = true, shortnameId = R.string.bgi_shortname), - SEN(R.string.overview_show_sensitivity, info.nightscout.core.ui.R.attr.ratioColor, info.nightscout.core.ui.R.attr.menuTextColorInverse, primary = false, secondary = true, shortnameId = R.string.sensitivity_shortname), - ACT(R.string.overview_show_activity, info.nightscout.core.ui.R.attr.activityColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = true, secondary = false, shortnameId = R.string.activity_shortname), - DEVSLOPE(R.string.overview_show_deviation_slope, info.nightscout.core.ui.R.attr.devSlopePosColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = false, secondary = true, shortnameId = R.string.devslope_shortname), - HR(R.string.overview_show_heartRate, info.nightscout.core.ui.R.attr.heartRateColor, info.nightscout.core.ui.R.attr.menuTextColor, primary = false, secondary = true, shortnameId = R.string.heartRate_shortname), + SEN( + R.string.overview_show_sensitivity, + info.nightscout.core.ui.R.attr.ratioColor, + info.nightscout.core.ui.R.attr.menuTextColorInverse, + primary = false, + secondary = true, + shortnameId = R.string.sensitivity_shortname + ), + ACT( + R.string.overview_show_activity, + info.nightscout.core.ui.R.attr.activityColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = true, + secondary = false, + shortnameId = R.string.activity_shortname + ), + DEVSLOPE( + R.string.overview_show_deviation_slope, + info.nightscout.core.ui.R.attr.devSlopePosColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = false, + secondary = true, + shortnameId = R.string.devslope_shortname + ), + HR( + R.string.overview_show_heartRate, + info.nightscout.core.ui.R.attr.heartRateColor, + info.nightscout.core.ui.R.attr.menuTextColor, + primary = false, + secondary = true, + shortnameId = R.string.heartRate_shortname + ), } companion object { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewPlugin.kt index d2cecb65b3..3ea5da2ea7 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/OverviewPlugin.kt @@ -4,6 +4,22 @@ import android.content.Context import androidx.annotation.StringRes import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.overview.Overview +import app.aaps.interfaces.overview.OverviewMenus +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventNewHistoryData +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventUpdateOverviewCalcProgress +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.impl.rx.bus.RxBusImpl import dagger.android.HasAndroidInjector import info.nightscout.core.events.EventIobCalculationProgress @@ -19,26 +35,10 @@ import info.nightscout.core.utils.extensions.storeInt import info.nightscout.core.utils.extensions.storeString import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.validators.ValidatingEditTextPreference -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Overview -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.overview.OverviewMenus -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.plugins.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.events.EventDismissNotification -import info.nightscout.rx.events.EventNewHistoryData -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventUpdateOverviewCalcProgress -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 import org.json.JSONObject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/graphData/GraphData.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/graphData/GraphData.kt index 9beba3b713..52c4680ba8 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/graphData/GraphData.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/graphData/GraphData.kt @@ -3,6 +3,12 @@ package info.nightscout.plugins.general.overview.graphData import android.content.Context import android.graphics.DashPathEffect import android.graphics.Paint +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.Round import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries @@ -14,12 +20,6 @@ import info.nightscout.core.graph.data.EffectiveProfileSwitchDataPoint import info.nightscout.core.graph.data.GlucoseValueDataPoint import info.nightscout.core.graph.data.TimeAsXAxisLabelFormatter import info.nightscout.core.ui.toast.ToastUtils -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.utils.Round -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import kotlin.math.abs import kotlin.math.max diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/DismissNotificationService.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/DismissNotificationService.kt index beed4291be..d5cf22a22a 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/DismissNotificationService.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/DismissNotificationService.kt @@ -1,12 +1,13 @@ package info.nightscout.plugins.general.overview.notifications import android.content.Intent +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.DaggerIntentService -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification import javax.inject.Inject class DismissNotificationService : DaggerIntentService(DismissNotificationService::class.simpleName) { + @Inject lateinit var rxBus: RxBus override fun onHandleIntent(intent: Intent?) { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt index f14dfb8250..5721cd3b83 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt @@ -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.interfaces.NotificationHolder -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.ui.IconsProvider -import info.nightscout.interfaces.ui.UiInteraction +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.notifications.NotificationHolder +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.IconsProvider +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil 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 diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationWithAction.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationWithAction.kt index 27c2be99fe..2bc008a501 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationWithAction.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationWithAction.kt @@ -1,19 +1,19 @@ package info.nightscout.plugins.general.overview.notifications +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.nsclient.NSAlarm +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.nsclient.NSAlarm -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.R -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") -class NotificationWithAction constructor( +class NotificationWithAction( injector: HasAndroidInjector ) : Notification() { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/events/EventUpdateOverviewNotification.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/events/EventUpdateOverviewNotification.kt index 5b12aea539..6868a0f631 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/events/EventUpdateOverviewNotification.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/notifications/events/EventUpdateOverviewNotification.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.general.overview.notifications.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventUpdateOverviewNotification(val from: String) : Event() \ No newline at end of file diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/ui/StatusLightHandler.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/ui/StatusLightHandler.kt index b499553e72..0cdd41e2fd 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/overview/ui/StatusLightHandler.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/overview/ui/StatusLightHandler.kt @@ -5,20 +5,20 @@ import android.os.Handler import android.os.HandlerThread import android.widget.TextView import androidx.annotation.StringRes +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.runOnUiThread +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.WarnColors +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.WarnColors -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.R -import info.nightscout.shared.extensions.runOnUiThread -import info.nightscout.shared.interfaces.ResourceHelper -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 @@ -35,6 +35,7 @@ class StatusLightHandler @Inject constructor( private val tddCalculator: TddCalculator, private val decimalFormatter: DecimalFormatter ) { + private var handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper) /** @@ -52,11 +53,39 @@ class StatusLightHandler @Inject constructor( ) { val pump = activePlugin.activePump val bgSource = activePlugin.activeBgSource - handleAge(cannulaAge, TherapyEvent.Type.CANNULA_CHANGE, info.nightscout.core.utils.R.string.key_statuslights_cage_warning, 48.0, info.nightscout.core.utils.R.string.key_statuslights_cage_critical, 72.0) - handleAge(insulinAge, TherapyEvent.Type.INSULIN_CHANGE, info.nightscout.core.utils.R.string.key_statuslights_iage_warning, 72.0, info.nightscout.core.utils.R.string.key_statuslights_iage_critical, 144.0) - handleAge(sensorAge, TherapyEvent.Type.SENSOR_CHANGE, info.nightscout.core.utils.R.string.key_statuslights_sage_warning, 216.0, info.nightscout.core.utils.R.string.key_statuslights_sage_critical, 240.0) + handleAge( + cannulaAge, + TherapyEvent.Type.CANNULA_CHANGE, + info.nightscout.core.utils.R.string.key_statuslights_cage_warning, + 48.0, + info.nightscout.core.utils.R.string.key_statuslights_cage_critical, + 72.0 + ) + handleAge( + insulinAge, + TherapyEvent.Type.INSULIN_CHANGE, + info.nightscout.core.utils.R.string.key_statuslights_iage_warning, + 72.0, + info.nightscout.core.utils.R.string.key_statuslights_iage_critical, + 144.0 + ) + handleAge( + sensorAge, + TherapyEvent.Type.SENSOR_CHANGE, + info.nightscout.core.utils.R.string.key_statuslights_sage_warning, + 216.0, + info.nightscout.core.utils.R.string.key_statuslights_sage_critical, + 240.0 + ) if (pump.pumpDescription.isBatteryReplaceable || pump.isBatteryChangeLoggingEnabled()) { - handleAge(batteryAge, TherapyEvent.Type.PUMP_BATTERY_CHANGE, info.nightscout.core.utils.R.string.key_statuslights_bage_warning, 216.0, info.nightscout.core.utils.R.string.key_statuslights_bage_critical, 240.0) + handleAge( + batteryAge, + TherapyEvent.Type.PUMP_BATTERY_CHANGE, + info.nightscout.core.utils.R.string.key_statuslights_bage_warning, + 216.0, + info.nightscout.core.utils.R.string.key_statuslights_bage_critical, + 240.0 + ) } val insulinUnit = rh.gs(info.nightscout.core.ui.R.string.insulin_unit_shortname) @@ -144,13 +173,14 @@ class StatusLightHandler @Inject constructor( } } } + private fun TherapyEvent.age(useShortText: Boolean, rh: ResourceHelper, dateUtil: DateUtil): String { val diff = dateUtil.computeDiff(timestamp, System.currentTimeMillis()) - var days = " " + rh.gs(info.nightscout.interfaces.R.string.days) + " " - var hours = " " + rh.gs(info.nightscout.interfaces.R.string.hours) + " " + var days = " " + rh.gs(app.aaps.interfaces.R.string.days) + " " + var hours = " " + rh.gs(app.aaps.interfaces.R.string.hours) + " " if (useShortText) { - days = rh.gs(info.nightscout.interfaces.R.string.shortday) - hours = rh.gs(info.nightscout.interfaces.R.string.shorthour) + days = rh.gs(app.aaps.interfaces.R.string.shortday) + hours = rh.gs(app.aaps.interfaces.R.string.shorthour) } return diff[TimeUnit.DAYS].toString() + days + diff[TimeUnit.HOURS] + hours } diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/DummyService.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/DummyService.kt index 0d4e010cdc..3f3471e77c 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/DummyService.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/DummyService.kt @@ -5,14 +5,14 @@ import android.app.Service import android.content.Intent import android.os.Binder import android.os.IBinder +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.NotificationHolder +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit import dagger.android.DaggerService import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.NotificationHolder -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject @@ -45,13 +45,14 @@ class DummyService : DaggerService() { } catch (e: Exception) { startForeground(4711, Notification()) } - disposable.add(rxBus - .toObservable(EventAppExit::class.java) - .observeOn(aapsSchedulers.io) - .subscribe({ - aapsLogger.debug(LTag.CORE, "EventAppExit received") - stopSelf() - }, fabricPrivacy::logException) + disposable.add( + rxBus + .toObservable(EventAppExit::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ + aapsLogger.debug(LTag.CORE, "EventAppExit received") + stopSelf() + }, fabricPrivacy::logException) ) } diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/DummyServiceHelper.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/DummyServiceHelper.kt index b01b040383..0186751b2c 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/DummyServiceHelper.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/DummyServiceHelper.kt @@ -5,7 +5,7 @@ import android.content.Context import android.content.Intent import android.content.ServiceConnection import android.os.IBinder -import info.nightscout.interfaces.NotificationHolder +import app.aaps.interfaces.notifications.NotificationHolder import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index 765f50b76c..f0331b9e57 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -6,32 +6,32 @@ import android.content.Context import android.content.Intent import androidx.core.app.NotificationCompat import androidx.core.app.RemoteInput +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.notifications.NotificationHolder +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAutosensCalculationFinished +import app.aaps.interfaces.rx.events.EventInitializationChanged +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.ui.IconsProvider +import app.aaps.interfaces.utils.DecimalFormatter import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.toStringShort import info.nightscout.core.iob.generateCOBString import info.nightscout.core.iob.round import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.NotificationHolder -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.IconsProvider -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.R -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAutosensCalculationFinished -import info.nightscout.rx.events.EventInitializationChanged -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt index 31f8232882..1b24c1518d 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt @@ -1,19 +1,19 @@ package info.nightscout.plugins.general.smsCommunicator import android.os.SystemClock +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.smsCommunicator.Sms +import app.aaps.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.smsCommunicator.Sms -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import javax.inject.Inject class AuthRequest( diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt index 04221f3cba..3d01e88cb9 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt @@ -4,16 +4,16 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.smsCommunicator.Sms +import app.aaps.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.smsCommunicator.Sms -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.plugins.databinding.SmscommunicatorFragmentBinding import info.nightscout.plugins.general.smsCommunicator.events.EventSmsCommunicatorUpdateGui -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Collections diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index 4b9950f7d6..b0c26581b1 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -10,6 +10,42 @@ import androidx.preference.PreferenceFragmentCompat import androidx.work.WorkerParameters import androidx.work.workDataOf import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.ApsMode +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientRestart +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.smsCommunicator.Sms +import app.aaps.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.interfaces.sync.XDripBroadcast +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.SafeParse +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.events.EventNewNotification @@ -29,45 +65,9 @@ import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAny import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.interfaces.ApsMode -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.XDripBroadcast -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.smsCommunicator.Sms -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.events.EventSmsCommunicatorUpdateGui import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientRestart -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ProfileUtil -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 kotlinx.coroutines.Dispatchers diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index afab5ab0ab..abb35e8984 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -10,6 +10,9 @@ import android.text.Editable import android.text.TextWatcher import android.view.View import android.view.WindowManager +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.smsCommunicator.SmsCommunicator import com.google.common.primitives.Ints.min import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity @@ -18,13 +21,10 @@ import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.plugins.R import info.nightscout.plugins.databinding.SmscommunicatorActivityOtpBinding import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult -import info.nightscout.shared.interfaces.ResourceHelper import net.glxn.qrgen.android.QRCode import javax.inject.Inject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/events/EventSmsCommunicatorUpdateGui.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/events/EventSmsCommunicatorUpdateGui.kt index 962584cfdc..71f36a2de0 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/events/EventSmsCommunicatorUpdateGui.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/events/EventSmsCommunicatorUpdateGui.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.general.smsCommunicator.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui internal class EventSmsCommunicatorUpdateGui : EventUpdateGui() diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/otp/OneTimePassword.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/otp/OneTimePassword.kt index e8274f5ce1..05fc82f5f6 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/otp/OneTimePassword.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/smsCommunicator/otp/OneTimePassword.kt @@ -2,13 +2,13 @@ package info.nightscout.plugins.general.smsCommunicator.otp import android.util.Base64 import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import com.eatthepath.otp.HmacOneTimePasswordGenerator import com.google.common.io.BaseEncoding -import info.nightscout.interfaces.Constants import info.nightscout.plugins.R -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import java.net.URLEncoder import javax.crypto.KeyGenerator import javax.crypto.SecretKey diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt index 5f3d97122b..090cf74c8a 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt @@ -4,17 +4,17 @@ import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventThemeSwitch +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventThemeSwitch -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 javax.inject.Inject import javax.inject.Singleton @@ -28,11 +28,11 @@ class ThemeSwitcherPlugin @Inject constructor( private val rxBus: RxBus, ) : PluginBase( PluginDescription() - .mainType(PluginType.GENERAL) - .neverVisible(true) - .alwaysEnabled(true) - .showInList(false) - .pluginName(R.string.theme_switcher), + .mainType(PluginType.GENERAL) + .neverVisible(true) + .alwaysEnabled(true) + .showInList(false) + .pluginName(R.string.theme_switcher), aapsLogger, rh, injector ) { diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearFragment.kt index 354d3026e2..19af240286 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearFragment.kt @@ -5,26 +5,26 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.maintenance.ImportExportPrefs +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventMobileToWear +import app.aaps.interfaces.rx.events.EventWearUpdateGui +import app.aaps.interfaces.rx.weardata.CwfData +import app.aaps.interfaces.rx.weardata.CwfMetadataKey +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.rx.weardata.ResFileMap +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.maintenance.ImportExportPrefs import info.nightscout.plugins.R import info.nightscout.plugins.databinding.WearFragmentBinding import info.nightscout.plugins.general.wear.activities.CwfInfosActivity -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventMobileToWear -import info.nightscout.rx.events.EventWearUpdateGui -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.weardata.CwfData -import info.nightscout.rx.weardata.ResFileMap -import info.nightscout.rx.weardata.CwfMetadataKey -import info.nightscout.rx.weardata.EventData -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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -37,7 +37,7 @@ class WearFragment : DaggerFragment() { @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var dateUtil: DateUtil @Inject lateinit var importExportPrefs: ImportExportPrefs - @Inject lateinit var sp:SP + @Inject lateinit var sp: SP @Inject lateinit var rh: ResourceHelper @Inject lateinit var aapsLogger: AAPSLogger @@ -48,8 +48,10 @@ class WearFragment : DaggerFragment() { // onDestroyView. private val binding get() = _binding!! - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { _binding = WearFragmentBinding.inflate(inflater, container, false) return binding.root } @@ -112,7 +114,7 @@ class WearFragment : DaggerFragment() { binding.customName.text = rh.gs(R.string.wear_custom_watchface, it.metadata[CwfMetadataKey.CWF_NAME]) binding.coverChart.setImageDrawable(it.resDatas[ResFileMap.CUSTOM_WATCHFACE.fileName]?.toDrawable(resources)) binding.infosCustom.visibility = View.VISIBLE - } ?:apply { + } ?: apply { binding.customName.text = rh.gs(R.string.wear_custom_watchface, "") binding.coverChart.setImageDrawable(null) binding.infosCustom.visibility = View.GONE diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearPlugin.kt index 95d5358e72..3bcb24fd9f 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/WearPlugin.kt @@ -1,30 +1,30 @@ package info.nightscout.plugins.general.wear import android.content.Context +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAutosensCalculationFinished +import app.aaps.interfaces.rx.events.EventDismissBolusProgressIfRunning +import app.aaps.interfaces.rx.events.EventLoopUpdateGui +import app.aaps.interfaces.rx.events.EventMobileDataToWear +import app.aaps.interfaces.rx.events.EventMobileToWear +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventWearUpdateGui +import app.aaps.interfaces.rx.weardata.CwfData +import app.aaps.interfaces.rx.weardata.CwfMetadataKey +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.plugins.general.wear.wearintegration.DataHandlerMobile import info.nightscout.plugins.general.wear.wearintegration.DataLayerListenerServiceMobileHelper -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAutosensCalculationFinished -import info.nightscout.rx.events.EventDismissBolusProgressIfRunning -import info.nightscout.rx.events.EventLoopUpdateGui -import info.nightscout.rx.events.EventMobileDataToWear -import info.nightscout.rx.events.EventMobileToWear -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventWearUpdateGui -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.weardata.CwfData -import info.nightscout.rx.weardata.CwfMetadataKey -import info.nightscout.rx.weardata.EventData -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/activities/CwfInfosActivity.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/activities/CwfInfosActivity.kt index 8b60d77a12..282111719c 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/activities/CwfInfosActivity.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/activities/CwfInfosActivity.kt @@ -6,29 +6,29 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventWearUpdateGui +import app.aaps.interfaces.rx.weardata.CUSTOM_VERSION +import app.aaps.interfaces.rx.weardata.CwfMetadataKey +import app.aaps.interfaces.rx.weardata.CwfMetadataMap +import app.aaps.interfaces.rx.weardata.JsonKeyValues +import app.aaps.interfaces.rx.weardata.JsonKeys +import app.aaps.interfaces.rx.weardata.ResFileMap +import app.aaps.interfaces.rx.weardata.ViewKeys +import app.aaps.interfaces.rx.weardata.ZipWatchfaceFormat +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.versionChecker.VersionCheckerUtils import info.nightscout.plugins.R import info.nightscout.plugins.databinding.CwfInfosActivityBinding import info.nightscout.plugins.databinding.CwfInfosActivityPrefItemBinding import info.nightscout.plugins.databinding.CwfInfosActivityViewItemBinding import info.nightscout.plugins.general.wear.WearPlugin -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventWearUpdateGui -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.rx.weardata.CUSTOM_VERSION -import info.nightscout.rx.weardata.ResFileMap -import info.nightscout.rx.weardata.CwfMetadataKey -import info.nightscout.rx.weardata.CwfMetadataMap -import info.nightscout.rx.weardata.JsonKeyValues -import info.nightscout.rx.weardata.JsonKeys -import info.nightscout.rx.weardata.ViewKeys -import info.nightscout.rx.weardata.ZipWatchfaceFormat -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject @@ -93,7 +93,7 @@ class CwfInfosActivity : TranslatedDaggerAppCompatActivity() { metadata[CwfMetadataKey.CWF_AUTHOR_VERSION]?.let { authorVersion -> title = "${metadata[CwfMetadataKey.CWF_NAME]} ($authorVersion)" } - val fileName = metadata[CwfMetadataKey.CWF_FILENAME]?.let { "$it${ZipWatchfaceFormat.CWF_EXTENTION}"} ?:"" + val fileName = metadata[CwfMetadataKey.CWF_FILENAME]?.let { "$it${ZipWatchfaceFormat.CWF_EXTENTION}" } ?: "" binding.filelistName.text = rh.gs(CwfMetadataKey.CWF_FILENAME.label, fileName) binding.author.text = rh.gs(CwfMetadataKey.CWF_AUTHOR.label, metadata[CwfMetadataKey.CWF_AUTHOR] ?: "") binding.createdAt.text = rh.gs(CwfMetadataKey.CWF_CREATED_AT.label, metadata[CwfMetadataKey.CWF_CREATED_AT] ?: "") diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataHandlerMobile.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataHandlerMobile.kt index 5c96274d28..3e9dbf0a0f 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataHandlerMobile.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataHandlerMobile.kt @@ -2,6 +2,43 @@ package info.nightscout.plugins.general.wear.wearintegration import android.app.NotificationManager import android.content.Context +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.maintenance.ImportExportPrefs +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventMobileToWear +import app.aaps.interfaces.rx.events.EventWearUpdateGui +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.utils.TrendCalculator import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.extensions.convertedToAbsolute @@ -30,44 +67,7 @@ import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.database.impl.transactions.InsertOrUpdateHeartRateTransaction -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.maintenance.ImportExportPrefs -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.interfaces.utils.TrendCalculator import info.nightscout.plugins.R -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventMobileToWear -import info.nightscout.rx.events.EventWearUpdateGui -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.rx.weardata.EventData -import info.nightscout.shared.interfaces.ProfileUtil -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.text.DateFormat @@ -750,8 +750,8 @@ class DataHandlerMobile @Inject constructor( bolusPercentage = sp.getInt(info.nightscout.core.utils.R.string.key_boluswizard_percentage, 100), maxCarbs = sp.getInt(info.nightscout.core.utils.R.string.key_treatmentssafety_maxcarbs, 48), maxBolus = sp.getDouble(info.nightscout.core.utils.R.string.key_treatmentssafety_maxbolus, 3.0), - insulinButtonIncrement1 = sp.getDouble(info.nightscout.interfaces.R.string.key_insulin_button_increment_1, Constants.INSULIN_PLUS1_DEFAULT), - insulinButtonIncrement2 = sp.getDouble(info.nightscout.interfaces.R.string.key_insulin_button_increment_2, Constants.INSULIN_PLUS2_DEFAULT), + insulinButtonIncrement1 = sp.getDouble(app.aaps.interfaces.R.string.key_insulin_button_increment_1, Constants.INSULIN_PLUS1_DEFAULT), + insulinButtonIncrement2 = sp.getDouble(app.aaps.interfaces.R.string.key_insulin_button_increment_2, Constants.INSULIN_PLUS2_DEFAULT), carbsButtonIncrement1 = sp.getInt(info.nightscout.core.utils.R.string.key_carbs_button_increment_1, Constants.CARBS_FAV1_DEFAULT), carbsButtonIncrement2 = sp.getInt(info.nightscout.core.utils.R.string.key_carbs_button_increment_2, Constants.CARBS_FAV2_DEFAULT) ) diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt index b868b87f72..9247355009 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt @@ -3,6 +3,21 @@ package info.nightscout.plugins.general.wear.wearintegration import android.os.Binder import android.os.Handler import android.os.HandlerThread +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventMobileDataToWear +import app.aaps.interfaces.rx.events.EventMobileToWear +import app.aaps.interfaces.rx.events.EventWearUpdateGui +import app.aaps.interfaces.rx.weardata.EventData +import app.aaps.interfaces.sharedPreferences.SP import com.google.android.gms.tasks.Tasks import com.google.android.gms.wearable.CapabilityClient import com.google.android.gms.wearable.CapabilityInfo @@ -17,23 +32,8 @@ import com.google.android.gms.wearable.WearableListenerService import dagger.android.AndroidInjection import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.plugins.R import info.nightscout.plugins.general.wear.WearPlugin -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventMobileDataToWear -import info.nightscout.rx.events.EventMobileToWear -import info.nightscout.rx.events.EventWearUpdateGui -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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.coroutines.CancellationException @@ -77,8 +77,9 @@ class DataLayerListenerServiceMobile : WearableListenerService() { private val disposable = CompositeDisposable() - private val rxPath get() = getString(info.nightscout.interfaces.R.string.path_rx_bridge) - private val rxDataPath get() = getString(info.nightscout.interfaces.R.string.path_rx_data_bridge) + private val rxPath get() = getString(app.aaps.interfaces.R.string.path_rx_bridge) + private val rxDataPath get() = getString(app.aaps.interfaces.R.string.path_rx_data_bridge) + @ExperimentalSerializationApi override fun onCreate() { AndroidInjection.inject(this) @@ -128,17 +129,19 @@ class DataLayerListenerServiceMobile : WearableListenerService() { } super.onDataChanged(dataEvents) } + @ExperimentalSerializationApi override fun onMessageReceived(messageEvent: MessageEvent) { super.onMessageReceived(messageEvent) if (wearPlugin.isEnabled()) { when (messageEvent.path) { - rxPath -> { + rxPath -> { aapsLogger.debug(LTag.WEAR, "onMessageReceived rxPath: ${String(messageEvent.data)}") val command = EventData.deserialize(String(messageEvent.data)) rxBus.send(command.also { it.sourceNodeId = messageEvent.sourceNodeId }) } + rxDataPath -> { aapsLogger.debug(LTag.WEAR, "onMessageReceived rxDataPath: ${String(messageEvent.data)}") val command = EventData.deserializeByte(messageEvent.data) diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataLayerListenerServiceMobileHelper.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataLayerListenerServiceMobileHelper.kt index e38c9f05f9..0407c98945 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataLayerListenerServiceMobileHelper.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/wear/wearintegration/DataLayerListenerServiceMobileHelper.kt @@ -5,7 +5,7 @@ import android.content.Context import android.content.Intent import android.content.ServiceConnection import android.os.IBinder -import info.nightscout.interfaces.NotificationHolder +import app.aaps.interfaces.notifications.NotificationHolder import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index ed678cb298..44e38158cf 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -2,6 +2,37 @@ package info.nightscout.plugins.iob.iobCobCalculator import androidx.collection.LongSparseArray import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.BasalData +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.iob.CobInfo +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.iob.MealData +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.Event +import app.aaps.interfaces.rx.events.EventConfigBuilderChange +import app.aaps.interfaces.rx.events.EventEffectiveProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventNewBG +import app.aaps.interfaces.rx.events.EventNewHistoryData +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.MidnightTime +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.core.extensions.iobCalc @@ -20,39 +51,8 @@ import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.aps.AutosensData -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.BasalData -import info.nightscout.interfaces.iob.CobInfo -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.iob.MealData -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.plugins.R import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataStoreObject -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.Event -import info.nightscout.rx.events.EventConfigBuilderChange -import info.nightscout.rx.events.EventEffectiveProfileSwitchChanged -import info.nightscout.rx.events.EventNewBG -import info.nightscout.rx.events.EventNewHistoryData -import info.nightscout.rx.events.EventPreferenceChange -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.JSONArray diff --git a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataObject.kt b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataObject.kt index 523ebb57eb..4310cb3c13 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataObject.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataObject.kt @@ -1,15 +1,15 @@ package info.nightscout.plugins.iob.iobCobCalculator.data +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.aps.AutosensData -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.profile.ProfileFunction -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.Locale import javax.inject.Inject import kotlin.math.min diff --git a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt index b5472095ff..cefd36860e 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/iob/iobCobCalculator/data/AutosensDataStoreObject.kt @@ -3,14 +3,14 @@ package info.nightscout.plugins.iob.iobCobCalculator.data import androidx.collection.LongSparseArray import androidx.collection.size import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.aps.AutosensData -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import kotlin.math.abs import kotlin.math.roundToLong diff --git a/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index 9c7f1862e0..d73e0a6331 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -8,6 +8,24 @@ import android.view.View import android.view.ViewGroup import android.widget.AdapterView import android.widget.ArrayAdapter +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventLocalProfileChanged +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.HardLimits +import app.aaps.interfaces.utils.SafeParse import com.google.android.material.tabs.TabLayout import dagger.android.support.DaggerFragment import info.nightscout.core.profile.ProfileSealed @@ -15,28 +33,9 @@ import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.plugins.databinding.ProfileFragmentBinding import info.nightscout.plugins.profile.ui.TimeListEdit -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventLocalProfileChanged -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.SafeParse -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ProfileUtil -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 java.math.RoundingMode @@ -212,9 +211,11 @@ class ProfileFragment : DaggerFragment() { roundUp(profileUtil.fromMgdlToUnits(HardLimits.MIN_ISF, GlucoseUnit.MMOL)), roundDown(profileUtil.fromMgdlToUnits(HardLimits.MAX_ISF, GlucoseUnit.MMOL)) ) - TimeListEdit(requireContext(), aapsLogger, dateUtil, requireView(), R.id.isf_holder, "ISF", rh.gs(info.nightscout.core.ui.R.string.isf_long_label), currentProfile.isf, null, isfRange, null, 0.1, - DecimalFormat - ("0.0"), save) + TimeListEdit( + requireContext(), aapsLogger, dateUtil, requireView(), R.id.isf_holder, "ISF", rh.gs(info.nightscout.core.ui.R.string.isf_long_label), currentProfile.isf, null, isfRange, null, 0.1, + DecimalFormat + ("0.0"), save + ) val range1 = doubleArrayOf( roundUp(profileUtil.fromMgdlToUnits(HardLimits.VERY_HARD_LIMIT_MIN_BG[0], GlucoseUnit.MMOL)), roundDown(profileUtil.fromMgdlToUnits(HardLimits.VERY_HARD_LIMIT_MIN_BG[1], GlucoseUnit.MMOL)) diff --git a/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index cb799090f5..e7979a18a3 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -2,6 +2,31 @@ package info.nightscout.plugins.profile import androidx.fragment.app.FragmentActivity import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileSource +import app.aaps.interfaces.profile.ProfileStore +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventLocalProfileChanged +import app.aaps.interfaces.rx.events.EventProfileStoreChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.HardLimits import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.blockFromJsonArray import info.nightscout.core.extensions.pureProfileFromJson @@ -9,32 +34,7 @@ import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profile.ProfileSource -import info.nightscout.interfaces.profile.ProfileStore -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventLocalProfileChanged -import info.nightscout.rx.events.EventProfileStoreChanged -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -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 org.json.JSONObject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/profile/ui/TimeListEdit.kt b/plugins/main/src/main/java/info/nightscout/plugins/profile/ui/TimeListEdit.kt index 98286ca51e..9ae43e2168 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/profile/ui/TimeListEdit.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/profile/ui/TimeListEdit.kt @@ -12,11 +12,11 @@ import android.widget.ImageView import android.widget.LinearLayout import android.widget.TextView import androidx.core.widget.TextViewCompat +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.SafeParse.stringToDouble import info.nightscout.core.ui.elements.NumberPicker import info.nightscout.core.ui.elements.SpinnerHelper -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.SafeParse.stringToDouble -import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinButtonsOn.kt b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinButtonsOn.kt index 2da897baa7..5d3c3c764d 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinButtonsOn.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinButtonsOn.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.skins -import info.nightscout.interfaces.Config +import app.aaps.interfaces.configuration.Config import info.nightscout.plugins.R import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinClassic.kt b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinClassic.kt index 66c5e9277a..7548eec22d 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinClassic.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinClassic.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.skins -import info.nightscout.interfaces.Config +import app.aaps.interfaces.configuration.Config import info.nightscout.plugins.R import info.nightscout.plugins.databinding.OverviewFragmentBinding import javax.inject.Inject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLargeDisplay.kt b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLargeDisplay.kt index 69497bf3dd..3655f81ed6 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLargeDisplay.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLargeDisplay.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.skins -import info.nightscout.interfaces.Config +import app.aaps.interfaces.configuration.Config import info.nightscout.plugins.R import info.nightscout.plugins.databinding.OverviewFragmentBinding import javax.inject.Inject diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLowRes.kt b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLowRes.kt index f09f389af6..166dd590cf 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLowRes.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinLowRes.kt @@ -2,7 +2,7 @@ package info.nightscout.plugins.skins import android.view.View.GONE import android.view.ViewGroup -import info.nightscout.interfaces.Config +import app.aaps.interfaces.configuration.Config import info.nightscout.plugins.R import info.nightscout.plugins.databinding.ActionsFragmentBinding import info.nightscout.plugins.databinding.OverviewFragmentBinding diff --git a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt index 7e98f51af3..990e39834e 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/skins/SkinProvider.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.skins +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.plugins.R import info.nightscout.plugins.di.SkinsModule -import info.nightscout.shared.sharedPreferences.SP import java.util.Collections import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/BolusExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/BolusExtensionKtTest.kt index 966355ced8..56a4cdd5c4 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/BolusExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/BolusExtensionKtTest.kt @@ -1,13 +1,13 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.Bolus import info.nightscout.insulin.InsulinLyumjevPlugin -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.shared.utils.T import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/ExtendedBolusExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/ExtendedBolusExtensionKtTest.kt index e22f866f15..984865010c 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/ExtendedBolusExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/ExtendedBolusExtensionKtTest.kt @@ -1,16 +1,16 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.SMBDefaults +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.insulin.InsulinLyumjevPlugin -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.SMBDefaults -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.shared.utils.T import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/GlucoseValueExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/GlucoseValueExtensionKtTest.kt index 8d108b4738..54f35542e9 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/GlucoseValueExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/GlucoseValueExtensionKtTest.kt @@ -1,11 +1,11 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.InMemoryGlucoseValue import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.core.main.R import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.iob.InMemoryGlucoseValue import org.junit.jupiter.api.Test class GlucoseValueExtensionKtTest : TestBaseWithProfile() { diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryBasalExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryBasalExtensionKtTest.kt index 1182a0ff67..d40e3304e3 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryBasalExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryBasalExtensionKtTest.kt @@ -1,15 +1,15 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.SMBDefaults +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.TemporaryBasal import info.nightscout.insulin.InsulinLyumjevPlugin -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.SMBDefaults -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.shared.utils.T import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryTargetExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryTargetExtensionKtTest.kt index d063c2edfe..e6d8f4275e 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryTargetExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/TemporaryTargetExtensionKtTest.kt @@ -1,9 +1,9 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.db.GlucoseUnit import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.interfaces.GlucoseUnit import org.junit.jupiter.api.Test class TemporaryTargetExtensionKtTest : TestBaseWithProfile() { diff --git a/plugins/main/src/test/java/info/nightscout/core/extensions/TherapyEventExtensionKtTest.kt b/plugins/main/src/test/java/info/nightscout/core/extensions/TherapyEventExtensionKtTest.kt index 7111dee1a5..5206096f49 100644 --- a/plugins/main/src/test/java/info/nightscout/core/extensions/TherapyEventExtensionKtTest.kt +++ b/plugins/main/src/test/java/info/nightscout/core/extensions/TherapyEventExtensionKtTest.kt @@ -1,10 +1,10 @@ package info.nightscout.core.extensions +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.shared.utils.T import org.junit.jupiter.api.Test import org.mockito.Mockito diff --git a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt index f1334c4a0b..43cfe74432 100644 --- a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt +++ b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt @@ -1,18 +1,18 @@ package info.nightscout.plugins.general.smsCommunicator +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.smsCommunicator.Sms +import app.aaps.interfaces.smsCommunicator.SmsCommunicator +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.smsCommunicator.Sms -import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt index 67f3aa8af7..eaf1f48d3a 100644 --- a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt +++ b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt @@ -1,6 +1,24 @@ package info.nightscout.plugins.general.smsCommunicator import android.telephony.SmsManager +import app.aaps.interfaces.aps.ApsMode +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.iob.CobInfo +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileSource +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.smsCommunicator.Sms +import app.aaps.interfaces.sync.XDripBroadcast +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -13,27 +31,9 @@ import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineE import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.database.impl.transactions.Transaction import info.nightscout.implementation.iob.GlucoseStatusProviderImpl -import info.nightscout.interfaces.ApsMode -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.XDripBroadcast -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.CobInfo -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileSource -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.smsCommunicator.Sms import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import io.reactivex.rxjava3.core.Single import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsTest.kt b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsTest.kt index faf4b817a8..08ce5be1f8 100644 --- a/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsTest.kt +++ b/plugins/main/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsTest.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.general.smsCommunicator import android.telephony.SmsMessage +import app.aaps.interfaces.smsCommunicator.Sms import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.smsCommunicator.Sms import org.junit.jupiter.api.Test import org.mockito.Mockito import org.mockito.Mockito.`when` diff --git a/plugins/main/src/test/java/info/nightscout/plugins/iob/AutosensDataStoreTest.kt b/plugins/main/src/test/java/info/nightscout/plugins/iob/AutosensDataStoreTest.kt index 9e42e4f8d6..29000ae6b1 100644 --- a/plugins/main/src/test/java/info/nightscout/plugins/iob/AutosensDataStoreTest.kt +++ b/plugins/main/src/test/java/info/nightscout/plugins/iob/AutosensDataStoreTest.kt @@ -2,20 +2,20 @@ package info.nightscout.plugins.iob import android.content.Context import androidx.collection.LongSparseArray +import app.aaps.interfaces.aps.AutosensData +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import app.aaps.shared.impl.utils.DateUtilImpl import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.aps.AutosensData -import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataObject import info.nightscout.plugins.iob.iobCobCalculator.data.AutosensDataStoreObject -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.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/AbstractSensitivityPlugin.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/AbstractSensitivityPlugin.kt index cd40707410..5dcd2b2221 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/AbstractSensitivityPlugin.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/AbstractSensitivityPlugin.kt @@ -1,17 +1,17 @@ package info.nightscout.sensitivity +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.Sensitivity +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.SafeParse import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.Sensitivity -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.utils.Round -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import kotlin.math.max import kotlin.math.min @@ -25,17 +25,23 @@ abstract class AbstractSensitivityPlugin( abstract override fun detectSensitivity(ads: AutosensDataStore, fromTime: Long, toTime: Long): AutosensResult - fun fillResult(ratio: Double, carbsAbsorbed: Double, pastSensitivity: String, - ratioLimit: String, sensResult: String, deviationsArraySize: Int): AutosensResult { - return fillResult(ratio, carbsAbsorbed, pastSensitivity, ratioLimit, sensResult, - deviationsArraySize, - SafeParse.stringToDouble(sp.getString(info.nightscout.core.utils.R.string.key_openapsama_autosens_min, "0.7")), - SafeParse.stringToDouble(sp.getString(info.nightscout.core.utils.R.string.key_openapsama_autosens_max, "1.2"))) + fun fillResult( + ratio: Double, carbsAbsorbed: Double, pastSensitivity: String, + ratioLimit: String, sensResult: String, deviationsArraySize: Int + ): AutosensResult { + return fillResult( + ratio, carbsAbsorbed, pastSensitivity, ratioLimit, sensResult, + deviationsArraySize, + SafeParse.stringToDouble(sp.getString(info.nightscout.core.utils.R.string.key_openapsama_autosens_min, "0.7")), + SafeParse.stringToDouble(sp.getString(info.nightscout.core.utils.R.string.key_openapsama_autosens_max, "1.2")) + ) } - fun fillResult(ratioParam: Double, carbsAbsorbed: Double, pastSensitivity: String, - ratioLimitParam: String, sensResult: String, deviationsArraySize: Int, - ratioMin: Double, ratioMax: Double): AutosensResult { + fun fillResult( + ratioParam: Double, carbsAbsorbed: Double, pastSensitivity: String, + ratioLimitParam: String, sensResult: String, deviationsArraySize: Int, + ratioMin: Double, ratioMax: Double + ): AutosensResult { var ratio = ratioParam var ratioLimit = ratioLimitParam val rawRatio = ratio @@ -45,8 +51,10 @@ abstract class AbstractSensitivityPlugin( //If not-excluded data <= MIN_HOURS -> don't do Autosens //If not-excluded data >= MIN_HOURS_FULL_AUTOSENS -> full Autosens //Between MIN_HOURS and MIN_HOURS_FULL_AUTOSENS: gradually increase autosens - val autosensContrib = (min(max(Sensitivity.MIN_HOURS, deviationsArraySize / 12.0), - Sensitivity.MIN_HOURS_FULL_AUTOSENS) - Sensitivity.MIN_HOURS) / (Sensitivity.MIN_HOURS_FULL_AUTOSENS - Sensitivity.MIN_HOURS) + val autosensContrib = (min( + max(Sensitivity.MIN_HOURS, deviationsArraySize / 12.0), + Sensitivity.MIN_HOURS_FULL_AUTOSENS + ) - Sensitivity.MIN_HOURS) / (Sensitivity.MIN_HOURS_FULL_AUTOSENS - Sensitivity.MIN_HOURS) ratio = autosensContrib * (ratio - 1) + 1 if (autosensContrib != 1.0) { ratioLimit += "(" + deviationsArraySize + " of " + Sensitivity.MIN_HOURS_FULL_AUTOSENS * 12 + " values) " diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt index d1bd068caf..fcf2d2a01d 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityAAPSPlugin.kt @@ -1,25 +1,25 @@ package info.nightscout.sensitivity import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.Sensitivity.SensitivityType +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.core.utils.MidnightUtils import info.nightscout.core.utils.Percentile import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.Sensitivity.SensitivityType -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import info.nightscout.sensitivity.extensions.isPSEvent5minBack import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import java.util.Arrays diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt index 239ad6bc0b..86917c83cf 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityOref1Plugin.kt @@ -1,28 +1,28 @@ package info.nightscout.sensitivity import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.SMBDefaults +import app.aaps.interfaces.aps.Sensitivity.SensitivityType +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.core.utils.MidnightUtils import info.nightscout.core.utils.Percentile import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.SMBDefaults -import info.nightscout.interfaces.aps.Sensitivity.SensitivityType -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import info.nightscout.sensitivity.extensions.isPSEvent5minBack import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import java.util.Arrays diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt index 5920852275..c4f99a0747 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -2,24 +2,24 @@ package info.nightscout.sensitivity import androidx.collection.LongSparseArray import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.Sensitivity.SensitivityType +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.core.utils.MidnightUtils import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.Sensitivity.SensitivityType -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import info.nightscout.sensitivity.extensions.isPSEvent5minBack import info.nightscout.sensitivity.extensions.isTherapyEventEvent5minBack -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt index dc3a566333..31fce3e182 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/ProfileSwitchExtensions.kt @@ -1,7 +1,7 @@ package info.nightscout.sensitivity.extensions +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.ProfileSwitch -import info.nightscout.shared.utils.T fun List.isPSEvent5minBack(time: Long): Boolean { for (event in this) { diff --git a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt index 0788398e6c..a6ccd5488a 100644 --- a/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt +++ b/plugins/sensitivity/src/main/java/info/nightscout/sensitivity/extensions/TherapyEventExtensions.kt @@ -1,7 +1,7 @@ package info.nightscout.sensitivity.extensions +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.TherapyEvent -import info.nightscout.shared.utils.T fun List.isTherapyEventEvent5minBack(time: Long): Boolean { for (event in this) { diff --git a/plugins/sensitivity/src/test/java/info/nightscout/sensitivity/AbstractSensitivityPluginTest.kt b/plugins/sensitivity/src/test/java/info/nightscout/sensitivity/AbstractSensitivityPluginTest.kt index 1ea0214d93..61acf51b51 100644 --- a/plugins/sensitivity/src/test/java/info/nightscout/sensitivity/AbstractSensitivityPluginTest.kt +++ b/plugins/sensitivity/src/test/java/info/nightscout/sensitivity/AbstractSensitivityPluginTest.kt @@ -1,16 +1,16 @@ package info.nightscout.sensitivity +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.AutosensResult +import app.aaps.interfaces.aps.Sensitivity +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.AutosensResult -import info.nightscout.interfaces.aps.Sensitivity -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt b/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt index ba85f3a022..ee83e3ab6d 100644 --- a/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt +++ b/plugins/smoothing/src/main/java/info/nightscout/smoothing/AvgSmoothingPlugin.kt @@ -1,17 +1,17 @@ package info.nightscout.smoothing import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.smoothing.Smoothing +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.smoothing.Smoothing -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt b/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt index cc6e364059..1b3eb50536 100644 --- a/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt +++ b/plugins/smoothing/src/main/java/info/nightscout/smoothing/ExponentialSmoothingPlugin.kt @@ -1,15 +1,15 @@ package info.nightscout.smoothing import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.smoothing.Smoothing import dagger.android.HasAndroidInjector import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.smoothing.Smoothing -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton import kotlin.math.max diff --git a/plugins/smoothing/src/main/java/info/nightscout/smoothing/NoSmoothingPlugin.kt b/plugins/smoothing/src/main/java/info/nightscout/smoothing/NoSmoothingPlugin.kt index 1bc4bd92e9..6eeb548afa 100644 --- a/plugins/smoothing/src/main/java/info/nightscout/smoothing/NoSmoothingPlugin.kt +++ b/plugins/smoothing/src/main/java/info/nightscout/smoothing/NoSmoothingPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.smoothing import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.smoothing.Smoothing import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.smoothing.Smoothing -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt index 38c78c287d..6a8812477d 100644 --- a/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/AidexPlugin.kt @@ -3,6 +3,16 @@ package info.nightscout.source import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.receivers.Intents +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.source.BgSource import dagger.android.HasAndroidInjector import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker @@ -10,16 +20,6 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.receivers.Intents -import info.nightscout.interfaces.source.BgSource -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt b/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt index fc33d17ffa..c819bc4419 100644 --- a/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt +++ b/plugins/source/src/main/java/info/nightscout/source/BGSourceFragment.kt @@ -13,6 +13,21 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.extensions.toVisibilityKeepSpace +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNewBG +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.core.extensions.directionToIcon import info.nightscout.core.ui.dialogs.OKDialog @@ -24,21 +39,6 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNewBG -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.extensions.toVisibilityKeepSpace -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.source.databinding.SourceFragmentBinding import info.nightscout.source.databinding.SourceItemBinding import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt index 15982b06ce..33ddf88a04 100644 --- a/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/DexcomPlugin.kt @@ -6,6 +6,20 @@ import android.content.pm.PackageManager import androidx.core.content.ContextCompat import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.source.DexcomBoyda +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import app.aaps.shared.impl.extensions.safeGetInstalledPackages import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.fromConstant @@ -20,20 +34,6 @@ import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -import info.nightscout.interfaces.source.DexcomBoyda -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -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.source.activities.RequestDexcomPermissionActivity import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt b/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt index c77c133892..6854b9344a 100644 --- a/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/EversensePlugin.kt @@ -3,6 +3,14 @@ package info.nightscout.source import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker @@ -12,14 +20,6 @@ import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.Dispatchers import java.util.Arrays import javax.inject.Inject diff --git a/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt index 1942c82d0c..b9dfc92e89 100644 --- a/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/GlimpPlugin.kt @@ -4,19 +4,19 @@ import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.source.BgSource import dagger.android.HasAndroidInjector import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt index 3bf28db760..d5edc64225 100644 --- a/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/GlunovoPlugin.kt @@ -4,6 +4,18 @@ import android.content.Context import android.net.Uri import android.os.Handler import android.os.HandlerThread +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.GlucoseValue @@ -13,18 +25,6 @@ import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -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 diff --git a/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt index 8d08c9ad1b..3e81bd444a 100644 --- a/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/IntelligoPlugin.kt @@ -6,6 +6,18 @@ import android.net.Uri import android.os.Handler import android.os.HandlerThread import android.util.Log +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import app.aaps.shared.impl.extensions.safeGetInstalledPackages import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy @@ -16,18 +28,6 @@ import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -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 diff --git a/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt index f8e5521a0d..0ee9018503 100644 --- a/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/MM640gPlugin.kt @@ -3,20 +3,20 @@ package info.nightscout.source import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.Dispatchers import org.json.JSONArray import org.json.JSONException diff --git a/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt b/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt index d6252a6ca8..e72e9a59b9 100644 --- a/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/NSClientSourcePlugin.kt @@ -1,15 +1,15 @@ package info.nightscout.source +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.source.NSClientSource import dagger.android.HasAndroidInjector import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt index 24fe14f324..266c9563c3 100644 --- a/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/PoctechPlugin.kt @@ -3,6 +3,15 @@ package info.nightscout.source import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.source.BgSource import dagger.android.HasAndroidInjector import info.nightscout.core.utils.JsonHelper.safeGetString import info.nightscout.core.utils.worker.LoggingWorker @@ -10,15 +19,6 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import kotlinx.coroutines.Dispatchers import org.json.JSONArray import org.json.JSONException diff --git a/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt index 0beff92a8e..685392a4dd 100644 --- a/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/RandomBgPlugin.kt @@ -3,22 +3,22 @@ package info.nightscout.source import android.os.Handler import android.os.HandlerThread import android.os.SystemClock +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.pump.VirtualPump +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.utils.isRunningTest import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.pump.VirtualPump -import info.nightscout.interfaces.source.BgSource -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.security.SecureRandom diff --git a/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt b/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt index 7075ed516c..c2f36765ee 100644 --- a/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/TomatoPlugin.kt @@ -3,20 +3,20 @@ package info.nightscout.source import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.BgSource import dagger.android.HasAndroidInjector import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.source.BgSource -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 kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt b/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt index 39bcc209bf..3d8636cc24 100644 --- a/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt +++ b/plugins/source/src/main/java/info/nightscout/source/XdripSourcePlugin.kt @@ -3,6 +3,15 @@ package info.nightscout.source import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.receivers.Intents +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.source.BgSource +import app.aaps.interfaces.source.XDripSource import dagger.android.HasAndroidInjector import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker @@ -10,15 +19,6 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.receivers.Intents -import info.nightscout.interfaces.source.BgSource -import info.nightscout.interfaces.source.XDripSource -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import kotlinx.coroutines.Dispatchers import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/source/src/main/java/info/nightscout/source/di/SourceModule.kt b/plugins/source/src/main/java/info/nightscout/source/di/SourceModule.kt index 74cc1dc105..f6c166b1dc 100644 --- a/plugins/source/src/main/java/info/nightscout/source/di/SourceModule.kt +++ b/plugins/source/src/main/java/info/nightscout/source/di/SourceModule.kt @@ -1,11 +1,11 @@ package info.nightscout.source.di +import app.aaps.interfaces.source.DexcomBoyda +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.source.XDripSource import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.interfaces.source.DexcomBoyda -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.interfaces.source.XDripSource import info.nightscout.source.AidexPlugin import info.nightscout.source.BGSourceFragment import info.nightscout.source.DexcomPlugin diff --git a/plugins/source/src/test/java/info/nightscout/source/GlimpPluginTest.kt b/plugins/source/src/test/java/info/nightscout/source/GlimpPluginTest.kt index 25603c0beb..a8bb6134a4 100644 --- a/plugins/source/src/test/java/info/nightscout/source/GlimpPluginTest.kt +++ b/plugins/source/src/test/java/info/nightscout/source/GlimpPluginTest.kt @@ -1,9 +1,9 @@ package info.nightscout.source +import app.aaps.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/source/src/test/java/info/nightscout/source/MM640GPluginTest.kt b/plugins/source/src/test/java/info/nightscout/source/MM640GPluginTest.kt index 8bffc38f72..d9c5bd67d3 100644 --- a/plugins/source/src/test/java/info/nightscout/source/MM640GPluginTest.kt +++ b/plugins/source/src/test/java/info/nightscout/source/MM640GPluginTest.kt @@ -1,9 +1,9 @@ package info.nightscout.source +import app.aaps.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/source/src/test/java/info/nightscout/source/NSClientPluginTest.kt b/plugins/source/src/test/java/info/nightscout/source/NSClientPluginTest.kt index 90c098d1dd..5254cd41dc 100644 --- a/plugins/source/src/test/java/info/nightscout/source/NSClientPluginTest.kt +++ b/plugins/source/src/test/java/info/nightscout/source/NSClientPluginTest.kt @@ -1,10 +1,10 @@ package info.nightscout.source +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/source/src/test/java/info/nightscout/source/XdripSourcePluginTest.kt b/plugins/source/src/test/java/info/nightscout/source/XdripSourcePluginTest.kt index d7894915cc..bac1ada22a 100644 --- a/plugins/source/src/test/java/info/nightscout/source/XdripSourcePluginTest.kt +++ b/plugins/source/src/test/java/info/nightscout/source/XdripSourcePluginTest.kt @@ -1,9 +1,9 @@ package info.nightscout.source +import app.aaps.interfaces.resources.ResourceHelper import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector -import info.nightscout.shared.interfaces.ResourceHelper import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt index d74e63f5fe..b43cdfc35c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPlugin.kt @@ -4,37 +4,37 @@ import android.content.Context import android.content.Intent import android.content.pm.ResolveInfo import android.os.Bundle +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.receivers.Intents +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.Event +import app.aaps.interfaces.rx.events.EventAutosensCalculationFinished +import app.aaps.interfaces.rx.events.EventLoopUpdateGui +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import app.aaps.shared.impl.extensions.safeQueryBroadcastReceivers import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.durationInMinutes import info.nightscout.core.extensions.toStringFull import info.nightscout.core.iob.round import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.receivers.Intents -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.sync.R -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.Event -import info.nightscout.rx.events.EventAutosensCalculationFinished -import info.nightscout.rx.events.EventLoopUpdateGui -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.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt index 8d775773bb..7a3700a5ff 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/di/SyncModule.kt @@ -2,16 +2,16 @@ package info.nightscout.plugins.sync.di import android.content.Context import androidx.work.WorkManager +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.sync.DataSyncSelectorXdrip +import app.aaps.interfaces.sync.XDripBroadcast import dagger.Binds import dagger.Module import dagger.Provides import dagger.Reusable import dagger.android.ContributesAndroidInjector -import info.nightscout.interfaces.XDripBroadcast -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.sync.DataSyncSelectorXdrip import info.nightscout.plugins.sync.nsShared.NSClientFragment import info.nightscout.plugins.sync.nsShared.StoreDataForDbImpl import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatusImpl @@ -73,6 +73,7 @@ abstract class SyncModule { @Provides fun providesWorkManager(context: Context) = WorkManager.getInstance(context) } + @Module interface Binding { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt index f6ffa45c67..bd05f854e4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSAlarm.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsShared +import app.aaps.interfaces.nsclient.NSAlarm import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.nsclient.NSAlarm import org.json.JSONObject class NSAlarmObject(private var data: JSONObject) : NSAlarm { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index b55683efdc..2168e064e1 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -16,31 +16,31 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginFragment +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.rx.events.EventNSClientRestart +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.support.DaggerFragment import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginFragment import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.databinding.NsClientFragmentBinding import info.nightscout.plugins.sync.databinding.NsClientLogItemBinding import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiData import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.events.EventNSClientRestart -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.core.Completable import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt index e0a4e713f4..d1a138071b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NSSgv.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsShared +import app.aaps.interfaces.nsclient.NSSgv import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.nsclient.NSSgv import org.json.JSONObject /** diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt index 482a2e9461..4afdaf31dc 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/NsIncomingDataProcessor.kt @@ -1,18 +1,26 @@ package info.nightscout.plugins.sync.nsShared import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileSource +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.Food import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.profile.ProfileSource -import info.nightscout.interfaces.source.NSClientSource import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsclient.extensions.fromJson import info.nightscout.plugins.sync.nsclientV3.extensions.toBolus @@ -27,11 +35,6 @@ import info.nightscout.plugins.sync.nsclientV3.extensions.toTemporaryBasal import info.nightscout.plugins.sync.nsclientV3.extensions.toTemporaryTarget import info.nightscout.plugins.sync.nsclientV3.extensions.toTherapyEvent import info.nightscout.plugins.sync.nsclientV3.extensions.toTransactionGlucoseValue -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import info.nightscout.sdk.localmodel.entry.NSSgvV3 import info.nightscout.sdk.localmodel.food.NSFood import info.nightscout.sdk.localmodel.treatment.NSBolus @@ -45,9 +48,6 @@ import info.nightscout.sdk.localmodel.treatment.NSTemporaryBasal import info.nightscout.sdk.localmodel.treatment.NSTemporaryTarget import info.nightscout.sdk.localmodel.treatment.NSTherapyEvent import info.nightscout.sdk.localmodel.treatment.NSTreatment -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 diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt index 80ce4c938c..ba2487970d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDbImpl.kt @@ -1,6 +1,20 @@ package info.nightscout.plugins.sync.nsShared import android.os.SystemClock +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.pump.VirtualPump +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.Carbs @@ -54,22 +68,7 @@ import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryBasalTransa import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryTargetTransaction import info.nightscout.database.impl.transactions.UpdateNsIdTherapyEventTransaction import info.nightscout.database.transactions.TransactionGlucoseValue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.pump.VirtualPump -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.sync.R -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -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 java.util.concurrent.Executors import java.util.concurrent.ScheduledFuture import java.util.concurrent.TimeUnit diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt index 2262b27775..4ea9eb520d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventConnectivityOptionChanged.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.sync.nsShared.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventConnectivityOptionChanged(val blockingReason: String) : Event() \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt index 88c7c1d571..acfa18d776 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.nsShared.events import android.content.Context -import info.nightscout.interfaces.sync.NsClient -import info.nightscout.rx.events.EventStatus +import app.aaps.interfaces.rx.events.EventStatus class EventNSClientStatus(var text: String) : EventStatus() { + override fun getStatus(context: Context): String = text } \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt index 1b2f2ed858..2930811ae3 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiData.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.sync.nsShared.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventNSClientUpdateGuiData : EventUpdateGui() \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt index e936de214d..9ff60f912b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiQueue.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.sync.nsShared.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventNSClientUpdateGuiQueue : EventUpdateGui() \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt index b319c3bae2..cf5a38721a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGuiStatus.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.sync.nsShared.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventNSClientUpdateGuiStatus : EventUpdateGui() \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt index e663197bc5..a9f4a56dae 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorV1.kt @@ -1,21 +1,21 @@ package info.nightscout.plugins.sync.nsclient +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.sync.DataSyncSelector +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.JsonHelper import info.nightscout.core.utils.waitMillis import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.interfaces.sync.DataSyncSelector import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -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 kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt index 93a354ff42..473d827c38 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt @@ -8,21 +8,33 @@ import android.os.IBinder import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreference +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.nsclient.NSAlarm +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventSWSyncStatus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.sync.DataSyncSelector +import app.aaps.interfaces.sync.NsClient +import app.aaps.interfaces.sync.Sync +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.toJson import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.nsclient.NSAlarm -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.sync.DataSyncSelector -import info.nightscout.interfaces.sync.NsClient -import info.nightscout.interfaces.sync.Sync -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsShared.NSClientFragment import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus @@ -31,18 +43,6 @@ import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import info.nightscout.plugins.sync.nsclient.data.AlarmAck import info.nightscout.plugins.sync.nsclient.extensions.toJson 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 -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventSWSyncStatus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt index 8910ac2c3b..74427ece40 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegate.kt @@ -1,17 +1,17 @@ package info.nightscout.plugins.sync.nsclient import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventChargingState +import app.aaps.interfaces.rx.events.EventNetworkChange +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.receivers.ReceiverStatusStore import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventChargingState -import info.nightscout.rx.events.EventNetworkChange -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt index 7163a77321..65f861d66c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt @@ -1,15 +1,15 @@ package info.nightscout.plugins.sync.nsclient.acks import androidx.work.OneTimeWorkRequest +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.Event +import app.aaps.interfaces.rx.events.EventNSClientRestart +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.plugins.sync.nsclient.services.NSClientService import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.Event -import info.nightscout.rx.events.EventNSClientRestart -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil import io.socket.client.Ack import org.json.JSONArray import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt index d734e95a6f..b7405093a2 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclient.acks -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.Event import io.socket.client.Ack import org.json.JSONObject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt index 5abd391fa9..da57390bc2 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.sync.nsclient.acks import androidx.work.OneTimeWorkRequest +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.Event +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.plugins.sync.nsclient.services.NSClientService import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.Event -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil import io.socket.client.Ack import org.json.JSONException import org.json.JSONObject @@ -17,7 +17,7 @@ import org.json.JSONObject * Created by mike on 21.02.2016. */ class NSUpdateAck( - val action : String, + val action: String, var _id: String, private val aapsLogger: AAPSLogger, private val rxBus: RxBus, diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt index 7b9b13a95a..c8327bf075 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.sync.nsclient.data import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData import info.nightscout.sdk.interfaces.RunningConfiguration import info.nightscout.sdk.localmodel.devicestatus.NSDeviceStatus -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt index 466f8fb381..d0e6235703 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatusImpl.kt @@ -4,23 +4,23 @@ package info.nightscout.plugins.sync.nsclient.data import android.content.Context import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.sync.R -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -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 import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt index 5786ff11b7..0343e7ebcf 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusDataImpl.kt @@ -1,19 +1,19 @@ package info.nightscout.plugins.sync.nsclient.data import android.text.Spanned +import app.aaps.interfaces.aps.APSResult +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.JsonHelper -import info.nightscout.interfaces.aps.APSResult -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.sync.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 javax.inject.Inject import javax.inject.Singleton @@ -173,5 +173,14 @@ class ProcessedDeviceStatusDataImpl @Inject constructor( } return HtmlHelper.fromHtml(string.toString()) } + + private fun ProcessedDeviceStatusData.Levels.toColor(): String = + when (level) { + ProcessedDeviceStatusData.Levels.INFO.level -> "white" + ProcessedDeviceStatusData.Levels.WARN.level -> "yellow" + ProcessedDeviceStatusData.Levels.URGENT.level -> "red" + else -> "white" + } + } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt index b0162160a7..0b2087ccad 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusCalculatorResultExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.utils.DateUtil import com.google.gson.Gson import com.google.gson.JsonSyntaxException import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.BolusCalculatorResult -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun BolusCalculatorResult.toJson(isAdd: Boolean, dateUtil: DateUtil, profileUtil: ProfileUtil): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt index 8096660dd6..e126093426 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun Bolus.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt index f9646f2d64..59ef690079 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun Carbs.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index d95a4ce172..bd4bb93d71 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.utils.DateUtil import info.nightscout.database.entities.DeviceStatus -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun DeviceStatus.toJson(dateUtil: DateUtil): JSONObject = @@ -17,7 +17,7 @@ fun DeviceStatus.toJson(dateUtil: DateUtil): JSONObject = }) if (uploaderBattery != 0) it.put("uploaderBattery", uploaderBattery) if (isCharging != null) it.put("isCharging", isCharging) - configuration?.let { configuration -> it.put("configuration", JSONObject(configuration)) } + configuration?.let { configuration -> it.put("configuration", JSONObject(configuration)) } } /* diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index 30e85dd4a5..4e22df861d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun EffectiveProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt index 50dca0e290..6282cd4599 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.toTemporaryBasal import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.profile.Profile -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONObject fun ExtendedBolus.toJson(isAdd: Boolean, profile: Profile?, dateUtil: DateUtil): JSONObject? = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt index 716754fc56..b8ee50eb80 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONObject fun OfflineEvent.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt index a9b52ba326..b60ffd8a86 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt @@ -1,5 +1,9 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.fromConstant import info.nightscout.core.extensions.getCustomizedName import info.nightscout.core.extensions.pureProfileFromJson @@ -8,10 +12,6 @@ import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.ProfileSwitch import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONObject fun ProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil, decimalFormatter: DecimalFormatter): JSONObject = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt index 87039e66c1..73106d676e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.TemporaryBasal.Type.Companion.fromString import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.profile.Profile -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONObject fun TemporaryBasal.toJson(isAdd: Boolean, profile: Profile?, dateUtil: DateUtil): JSONObject? = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt index 5295853f95..132affe6b3 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.TemporaryTarget -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONObject fun TemporaryTarget.Companion.fromJson(jsonObject: JSONObject, profileUtil: ProfileUtil): TemporaryTarget? { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt index a75c474b27..4f274aa6d2 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt @@ -1,12 +1,11 @@ package info.nightscout.plugins.sync.nsclient.extensions +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.utils.JsonHelper import info.nightscout.database.entities.TherapyEvent -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.plugins.sync.nsclient.data.NSMbg -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import org.json.JSONObject fun TherapyEvent.GlucoseUnit.toMainUnit(): GlucoseUnit = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt index 3b745d08a8..c6bed4adb3 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt @@ -10,6 +10,20 @@ import android.os.IBinder import android.os.PowerManager import android.os.SystemClock import androidx.work.OneTimeWorkRequest +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.nsclient.NSSettingsStatus +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.* +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T.Companion.mins import com.google.common.base.Charsets import com.google.common.hash.Hashing import com.google.gson.GsonBuilder @@ -22,11 +36,6 @@ import info.nightscout.core.utils.JsonHelper.safeGetStringAllowNull import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.nsclient.NSSettingsStatus -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsShared.NSAlarmObject import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor @@ -42,16 +51,7 @@ import info.nightscout.plugins.sync.nsclient.data.AlarmAck import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.* -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import info.nightscout.sdk.localmodel.devicestatus.NSDeviceStatus -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 diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt index 72e4cf4a43..99a488290e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt @@ -4,31 +4,31 @@ import android.content.Context import android.os.SystemClock import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.sync.DataSyncSelector +import app.aaps.interfaces.sync.DataSyncSelector.PairBolus +import app.aaps.interfaces.sync.DataSyncSelector.PairBolusCalculatorResult +import app.aaps.interfaces.sync.DataSyncSelector.PairCarbs +import app.aaps.interfaces.sync.DataSyncSelector.PairEffectiveProfileSwitch +import app.aaps.interfaces.sync.DataSyncSelector.PairExtendedBolus +import app.aaps.interfaces.sync.DataSyncSelector.PairFood +import app.aaps.interfaces.sync.DataSyncSelector.PairGlucoseValue +import app.aaps.interfaces.sync.DataSyncSelector.PairOfflineEvent +import app.aaps.interfaces.sync.DataSyncSelector.PairProfileStore +import app.aaps.interfaces.sync.DataSyncSelector.PairProfileSwitch +import app.aaps.interfaces.sync.DataSyncSelector.PairTemporaryBasal +import app.aaps.interfaces.sync.DataSyncSelector.PairTemporaryTarget +import app.aaps.interfaces.sync.DataSyncSelector.PairTherapyEvent import info.nightscout.core.utils.notifyAll import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.sync.DataSyncSelector -import info.nightscout.interfaces.sync.DataSyncSelector.PairBolus -import info.nightscout.interfaces.sync.DataSyncSelector.PairBolusCalculatorResult -import info.nightscout.interfaces.sync.DataSyncSelector.PairCarbs -import info.nightscout.interfaces.sync.DataSyncSelector.PairEffectiveProfileSwitch -import info.nightscout.interfaces.sync.DataSyncSelector.PairExtendedBolus -import info.nightscout.interfaces.sync.DataSyncSelector.PairFood -import info.nightscout.interfaces.sync.DataSyncSelector.PairGlucoseValue -import info.nightscout.interfaces.sync.DataSyncSelector.PairOfflineEvent -import info.nightscout.interfaces.sync.DataSyncSelector.PairProfileStore -import info.nightscout.interfaces.sync.DataSyncSelector.PairProfileSwitch -import info.nightscout.interfaces.sync.DataSyncSelector.PairTemporaryBasal -import info.nightscout.interfaces.sync.DataSyncSelector.PairTemporaryTarget -import info.nightscout.interfaces.sync.DataSyncSelector.PairTherapyEvent import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsclient.acks.NSAddAck -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.shared.sharedPreferences.SP import kotlinx.coroutines.Dispatchers import javax.inject.Inject @@ -56,7 +56,7 @@ class NSClientAddAckWorker( } when (ack.originalObject) { - is PairTemporaryTarget -> { + is PairTemporaryTarget -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -65,7 +65,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked TemporaryTarget " + pair.value.interfaceIDs.nightscoutId)) } - is PairGlucoseValue -> { + is PairGlucoseValue -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -74,7 +74,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked GlucoseValue " + pair.value.interfaceIDs.nightscoutId)) } - is PairFood -> { + is PairFood -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -84,7 +84,7 @@ class NSClientAddAckWorker( // Send new if waiting } - is PairTherapyEvent -> { + is PairTherapyEvent -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -93,7 +93,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked TherapyEvent " + pair.value.interfaceIDs.nightscoutId)) } - is PairBolus -> { + is PairBolus -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -102,7 +102,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked Bolus " + pair.value.interfaceIDs.nightscoutId)) } - is PairCarbs -> { + is PairCarbs -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -111,7 +111,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked Carbs " + pair.value.interfaceIDs.nightscoutId)) } - is PairBolusCalculatorResult -> { + is PairBolusCalculatorResult -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id storeDataForDb.nsIdBolusCalculatorResults.add(pair.value) @@ -119,7 +119,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked BolusCalculatorResult " + pair.value.interfaceIDs.nightscoutId)) } - is PairTemporaryBasal -> { + is PairTemporaryBasal -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -128,7 +128,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked TemporaryBasal " + pair.value.interfaceIDs.nightscoutId)) } - is PairExtendedBolus -> { + is PairExtendedBolus -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -137,7 +137,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked ExtendedBolus " + pair.value.interfaceIDs.nightscoutId)) } - is PairProfileSwitch -> { + is PairProfileSwitch -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -146,7 +146,7 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked ProfileSwitch " + pair.value.interfaceIDs.nightscoutId)) } - is PairEffectiveProfileSwitch -> { + is PairEffectiveProfileSwitch -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true @@ -164,13 +164,13 @@ class NSClientAddAckWorker( rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked DeviceStatus " + pair.value.interfaceIDs.nightscoutId)) } - is PairProfileStore -> { + is PairProfileStore -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBADD", "Acked ProfileStore " + ack.id)) } - is PairOfflineEvent -> { + is PairOfflineEvent -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id pair.confirmed = true diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt index 0f08a9256d..b1b593d60f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt @@ -3,6 +3,15 @@ package info.nightscout.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.pump.VirtualPump +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.JsonHelper import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker @@ -17,20 +26,11 @@ import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.VirtualPump import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsclient.extensions.extendedBolusFromJson import info.nightscout.plugins.sync.nsclient.extensions.fromJson import info.nightscout.plugins.sync.nsclient.extensions.isEffectiveProfileSwitch import info.nightscout.plugins.sync.nsclient.extensions.temporaryBasalFromJson -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt index 9306ec7343..752726e881 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt @@ -3,13 +3,13 @@ package info.nightscout.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.nsclient.StoreDataForDb import info.nightscout.plugins.sync.nsclient.data.NSMbg import info.nightscout.plugins.sync.nsclient.extensions.therapyEventFromNsMbg -import info.nightscout.shared.sharedPreferences.SP import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt index 202478da61..7dc64785af 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt @@ -3,26 +3,26 @@ package info.nightscout.plugins.sync.nsclient.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sync.DataSyncSelector.PairBolus +import app.aaps.interfaces.sync.DataSyncSelector.PairBolusCalculatorResult +import app.aaps.interfaces.sync.DataSyncSelector.PairCarbs +import app.aaps.interfaces.sync.DataSyncSelector.PairEffectiveProfileSwitch +import app.aaps.interfaces.sync.DataSyncSelector.PairExtendedBolus +import app.aaps.interfaces.sync.DataSyncSelector.PairFood +import app.aaps.interfaces.sync.DataSyncSelector.PairGlucoseValue +import app.aaps.interfaces.sync.DataSyncSelector.PairOfflineEvent +import app.aaps.interfaces.sync.DataSyncSelector.PairProfileSwitch +import app.aaps.interfaces.sync.DataSyncSelector.PairTemporaryBasal +import app.aaps.interfaces.sync.DataSyncSelector.PairTemporaryTarget +import app.aaps.interfaces.sync.DataSyncSelector.PairTherapyEvent import info.nightscout.core.utils.notifyAll import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.sync.DataSyncSelector.PairBolus -import info.nightscout.interfaces.sync.DataSyncSelector.PairBolusCalculatorResult -import info.nightscout.interfaces.sync.DataSyncSelector.PairCarbs -import info.nightscout.interfaces.sync.DataSyncSelector.PairEffectiveProfileSwitch -import info.nightscout.interfaces.sync.DataSyncSelector.PairExtendedBolus -import info.nightscout.interfaces.sync.DataSyncSelector.PairFood -import info.nightscout.interfaces.sync.DataSyncSelector.PairGlucoseValue -import info.nightscout.interfaces.sync.DataSyncSelector.PairOfflineEvent -import info.nightscout.interfaces.sync.DataSyncSelector.PairProfileSwitch -import info.nightscout.interfaces.sync.DataSyncSelector.PairTemporaryBasal -import info.nightscout.interfaces.sync.DataSyncSelector.PairTemporaryTarget -import info.nightscout.interfaces.sync.DataSyncSelector.PairTherapyEvent import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog import kotlinx.coroutines.Dispatchers import javax.inject.Inject @@ -44,84 +44,84 @@ class NSClientUpdateRemoveAckWorker( // new room way when (ack.originalObject) { - is PairTemporaryTarget -> { + is PairTemporaryTarget -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked TemporaryTarget" + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairGlucoseValue -> { + is PairGlucoseValue -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked GlucoseValue " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairFood -> { + is PairFood -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked Food " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairTherapyEvent -> { + is PairTherapyEvent -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked TherapyEvent " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairBolus -> { + is PairBolus -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked Bolus " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairCarbs -> { + is PairCarbs -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked Carbs " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairBolusCalculatorResult -> { + is PairBolusCalculatorResult -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked BolusCalculatorResult " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairTemporaryBasal -> { + is PairTemporaryBasal -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked TemporaryBasal " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairExtendedBolus -> { + is PairExtendedBolus -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked ExtendedBolus " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairProfileSwitch -> { + is PairProfileSwitch -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked ProfileSwitch " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairEffectiveProfileSwitch -> { + is PairEffectiveProfileSwitch -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked EffectiveProfileSwitch " + ack._id)) ret = Result.success(workDataOf("ProcessedData" to pair.toString())) } - is PairOfflineEvent -> { + is PairOfflineEvent -> { val pair = ack.originalObject pair.confirmed = true rxBus.send(EventNSClientNewLog("◄ DBUPDATE", "Acked OfflineEvent" + ack._id)) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt index fdbc96ad92..b527cd7a1b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/DataSyncSelectorV3.kt @@ -1,22 +1,22 @@ package info.nightscout.plugins.sync.nsclientV3 import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.sync.DataSyncSelector +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.JsonHelper import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.interfaces.sync.DataSyncSelector import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiQueue import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus -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 import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 9841be8ab7..e7ffb92a1d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -12,6 +12,41 @@ import androidx.work.OneTimeWorkRequest import androidx.work.WorkInfo import androidx.work.WorkManager import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.nsclient.NSAlarm +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventDeviceStatusChange +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.rx.events.EventNewHistoryData +import app.aaps.interfaces.rx.events.EventOfflineChange +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventProfileStoreChanged +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventSWSyncStatus +import app.aaps.interfaces.rx.events.EventTempTargetChange +import app.aaps.interfaces.rx.events.EventTherapyEventChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.sync.DataSyncSelector +import app.aaps.interfaces.sync.NsClient +import app.aaps.interfaces.sync.Sync +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import com.google.gson.Gson import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector @@ -19,21 +54,6 @@ import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.ValueWrapper import info.nightscout.database.entities.interfaces.TraceableDBEntry import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.nsclient.NSAlarm -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.interfaces.sync.DataSyncSelector -import info.nightscout.interfaces.sync.NsClient -import info.nightscout.interfaces.sync.Sync -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsShared.NSAlarmObject import info.nightscout.plugins.sync.nsShared.NSClientFragment @@ -64,22 +84,6 @@ import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorke import info.nightscout.plugins.sync.nsclientV3.workers.LoadProfileStoreWorker import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker import info.nightscout.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventDeviceStatusChange -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.events.EventNewHistoryData -import info.nightscout.rx.events.EventOfflineChange -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventProfileStoreChanged -import info.nightscout.rx.events.EventProfileSwitchChanged -import info.nightscout.rx.events.EventSWSyncStatus -import info.nightscout.rx.events.EventTempTargetChange -import info.nightscout.rx.events.EventTherapyEventChange -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import info.nightscout.sdk.NSAndroidClientImpl import info.nightscout.sdk.interfaces.NSAndroidClient import info.nightscout.sdk.mapper.toNSDeviceStatus @@ -87,10 +91,6 @@ import info.nightscout.sdk.mapper.toNSFood import info.nightscout.sdk.mapper.toNSSgvV3 import info.nightscout.sdk.mapper.toNSTreatment import info.nightscout.sdk.remotemodel.LastModified -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 io.socket.client.Ack @@ -158,12 +158,12 @@ class NSClientV3Plugin @Inject constructor( when { sp.getBoolean(R.string.key_ns_paused, false) -> rh.gs(info.nightscout.core.ui.R.string.paused) isAllowed.not() -> blockingReason - sp.getBoolean(info.nightscout.core.utils.R.string.key_ns_use_ws, true) && wsConnected -> "WS: " + rh.gs(info.nightscout.interfaces.R.string.connected) + sp.getBoolean(info.nightscout.core.utils.R.string.key_ns_use_ws, true) && wsConnected -> "WS: " + rh.gs(app.aaps.interfaces.R.string.connected) sp.getBoolean(info.nightscout.core.utils.R.string.key_ns_use_ws, true) && !wsConnected -> "WS: " + rh.gs(R.string.not_connected) lastOperationError != null -> rh.gs(info.nightscout.core.ui.R.string.error) nsAndroidClient?.lastStatus == null -> rh.gs(R.string.not_connected) workIsRunning() -> rh.gs(R.string.working) - nsAndroidClient?.lastStatus?.apiPermissions?.isFull() == true -> rh.gs(info.nightscout.interfaces.R.string.connected) + nsAndroidClient?.lastStatus?.apiPermissions?.isFull() == true -> rh.gs(app.aaps.interfaces.R.string.connected) nsAndroidClient?.lastStatus?.apiPermissions?.isRead() == true -> rh.gs(R.string.read_only) else -> rh.gs(info.nightscout.core.ui.R.string.unknown) } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt index 1c624f8d54..8789da2b9e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.utils.T import com.google.gson.Gson import com.google.gson.JsonSyntaxException import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.sdk.localmodel.entry.NsUnits import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSBolusWizard -import info.nightscout.shared.utils.T fun NSBolusWizard.toBolusCalculatorResult(): BolusCalculatorResult? = try { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt index c2ef32daf6..cbd1868e24 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSBolus -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSBolus.toBolus(): Bolus = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt index 607918a222..62759db6ea 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSCarbs -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSCarbs.toCarbs(): Carbs = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt index 70fd1c6dbb..264a77619e 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -1,5 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed import info.nightscout.database.entities.EffectiveProfileSwitch @@ -7,8 +9,6 @@ import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.plugins.sync.nsclient.extensions.fromConstant import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSEffectiveProfileSwitch -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSEffectiveProfileSwitch.toEffectiveProfileSwitch(dateUtil: DateUtil): EffectiveProfileSwitch? { @@ -35,7 +35,7 @@ fun NSEffectiveProfileSwitch.toEffectiveProfileSwitch(dateUtil: DateUtil): Effec ) } -fun EffectiveProfileSwitch.toNSEffectiveProfileSwitch(dateUtil: DateUtil) : NSEffectiveProfileSwitch = +fun EffectiveProfileSwitch.toNSEffectiveProfileSwitch(dateUtil: DateUtil): NSEffectiveProfileSwitch = NSEffectiveProfileSwitch( eventType = EventType.NOTE, isValid = isValid, diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt index d0c2c40464..f42039ad37 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.toTemporaryBasal import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.profile.Profile import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSExtendedBolus import info.nightscout.sdk.localmodel.treatment.NSTreatment -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSExtendedBolus.toExtendedBolus(): ExtendedBolus = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt index 70db058412..cef8140726 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/GlucoseValueExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.transactions.TransactionGlucoseValue import info.nightscout.sdk.localmodel.entry.Direction import info.nightscout.sdk.localmodel.entry.NSSgvV3 import info.nightscout.sdk.localmodel.entry.NsUnits -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSSgvV3.toTransactionGlucoseValue(): TransactionGlucoseValue { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt index 41ec8a0cd6..c1573666c2 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSOfflineEvent -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSOfflineEvent.toOfflineEvent(): OfflineEvent = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt index 2da094012b..6bded18053 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -1,17 +1,17 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.fromConstant import info.nightscout.core.extensions.getCustomizedName import info.nightscout.core.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed import info.nightscout.database.entities.ProfileSwitch import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSProfileSwitch.toProfileSwitch(activePlugin: ActivePlugin, dateUtil: DateUtil): ProfileSwitch? { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt index f7784eda93..5864c5b40a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.profile.Profile import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSTemporaryBasal -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSTemporaryBasal.toTemporaryBasal(): TemporaryBasal = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt index a9d42882da..811c1722e3 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.entry.NsUnits import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSTemporaryTarget -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSTemporaryTarget.toTemporaryTarget(): TemporaryTarget = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt index ba48b282e5..64adb1073f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.entry.NsUnits import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSTherapyEvent -import info.nightscout.shared.utils.T import java.security.InvalidParameterException fun NSTherapyEvent.toTherapyEvent(): TherapyEvent = diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt index d897e7344e..4c26f7501d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorker.kt @@ -3,12 +3,12 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog import info.nightscout.core.utils.worker.LoggingWorker -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.sync.nsclientV3.DataSyncSelectorV3 import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt index 1d2770df9e..6e1004f3ed 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt @@ -3,19 +3,19 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.sync.NsClient +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.worker.LoggingWorker -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.logging.LTag import info.nightscout.sdk.interfaces.NSAndroidClient import info.nightscout.sdk.localmodel.entry.NSSgvV3 -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.Dispatchers import javax.inject.Inject import kotlin.math.max diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt index 0deb717e48..f2203783a5 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt @@ -3,14 +3,14 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt index bb9adcb75a..18f36d695d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadFoodsWorker.kt @@ -3,15 +3,15 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.worker.LoggingWorker -import info.nightscout.interfaces.nsclient.StoreDataForDb import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.logging.LTag import info.nightscout.sdk.localmodel.food.NSFood -import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt index addcf27ce6..123c3a1daf 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt @@ -3,11 +3,11 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.logging.LTag import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt index 130930b083..08870b0c01 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadProfileStoreWorker.kt @@ -3,17 +3,17 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sync.NsClient +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.JsonHelper import info.nightscout.core.utils.receivers.DataWorkerStorage import info.nightscout.core.utils.worker.LoggingWorker -import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.logging.LTag import info.nightscout.sdk.interfaces.NSAndroidClient -import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.Dispatchers import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt index d0d73f0b52..386c48c55d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt @@ -3,12 +3,12 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog import info.nightscout.core.utils.worker.LoggingWorker import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGuiStatus import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.logging.LTag import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt index ee62135d29..ec1b60fe9a 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -3,17 +3,17 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.WorkerParameters import androidx.work.workDataOf +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.sync.NsClient +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.utils.worker.LoggingWorker -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.logging.LTag import info.nightscout.sdk.interfaces.NSAndroidClient import info.nightscout.sdk.localmodel.treatment.NSTreatment -import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.Dispatchers import javax.inject.Inject import kotlin.math.max diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt index 411b971bad..816e9cbc55 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansUploaderPlugin.kt @@ -18,25 +18,25 @@ import androidx.work.NetworkType import androidx.work.OneTimeWorkRequestBuilder import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.sync.Sync import dagger.android.HasAndroidInjector +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import info.nightscout.database.impl.AppRepository +import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.openhumans.delegates.OHAppIDDelegate import info.nightscout.plugins.sync.openhumans.delegates.OHCounterDelegate import info.nightscout.plugins.sync.openhumans.delegates.OHStateDelegate import info.nightscout.plugins.sync.openhumans.ui.OHFragment import info.nightscout.plugins.sync.openhumans.ui.OHLoginActivity -import info.nightscout.database.entities.data.Block -import info.nightscout.database.entities.interfaces.TraceableDBEntry -import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.sync.Sync -import info.nightscout.plugins.sync.R -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPreferenceChange -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 import kotlinx.coroutines.Dispatchers diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt index f99cac294b..45d5151642 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/OpenHumansWorker.kt @@ -3,10 +3,9 @@ package info.nightscout.plugins.sync.openhumans import android.content.Context import androidx.work.CoroutineWorker import androidx.work.WorkerParameters +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag - import javax.inject.Inject class OpenHumansWorker( diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt index 8dcb7c0347..33593f74ef 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHAppIDDelegate.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.openhumans.delegates -import info.nightscout.shared.sharedPreferences.SP -import java.util.* +import app.aaps.interfaces.sharedPreferences.SP +import java.util.UUID import javax.inject.Inject import javax.inject.Singleton import kotlin.reflect.KProperty @@ -10,6 +10,7 @@ import kotlin.reflect.KProperty internal class OHAppIDDelegate @Inject internal constructor( private val sp: SP ) { + private var value: UUID? = null operator fun getValue(thisRef: Any?, property: KProperty<*>): UUID { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt index 6d1e15755a..ac8cfd5cd1 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHCounterDelegate.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.sync.openhumans.delegates -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton import kotlin.reflect.KProperty @@ -9,6 +9,7 @@ import kotlin.reflect.KProperty internal class OHCounterDelegate @Inject internal constructor( private val sp: SP ) { + private var value = sp.getLong("openhumans_counter", 1) operator fun getValue(thisRef: Any?, property: KProperty<*>): Long = value diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt index 08749ea288..7a29a6410b 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/openhumans/delegates/OHStateDelegate.kt @@ -2,8 +2,8 @@ package info.nightscout.plugins.sync.openhumans.delegates import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.plugins.sync.openhumans.OpenHumansState -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton import kotlin.reflect.KProperty diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt index 2a32b3b643..d2541def99 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt @@ -11,6 +11,10 @@ import android.widget.ScrollView import androidx.core.view.MenuCompat import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.support.DaggerFragment import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.plugins.sync.R @@ -19,10 +23,6 @@ import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import info.nightscout.plugins.sync.tidepool.events.EventTidepoolDoUpload import info.nightscout.plugins.sync.tidepool.events.EventTidepoolResetData import info.nightscout.plugins.sync.tidepool.events.EventTidepoolUpdateGUI -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt index 3422c259dc..db0b8710fd 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt @@ -4,16 +4,27 @@ import android.content.Context import android.text.Spanned import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventNSClientNewLog +import app.aaps.interfaces.rx.events.EventNewBG +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventSWSyncStatus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.sync.Sync +import app.aaps.interfaces.sync.Tidepool +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.sync.Sync -import info.nightscout.interfaces.sync.Tidepool -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsShared.events.EventConnectivityOptionChanged import info.nightscout.plugins.sync.nsclient.ReceiverDelegate @@ -24,17 +35,6 @@ import info.nightscout.plugins.sync.tidepool.events.EventTidepoolResetData import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus import info.nightscout.plugins.sync.tidepool.events.EventTidepoolUpdateGUI import info.nightscout.plugins.sync.tidepool.utils.RateLimit -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventNSClientNewLog -import info.nightscout.rx.events.EventNewBG -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventSWSyncStatus -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 javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt index 2eec303461..21212e56a1 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.tidepool.comm -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import okhttp3.Interceptor import okhttp3.Response diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt index b39c955fb8..1a1ad93b68 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.tidepool.comm +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import retrofit2.Call import retrofit2.Callback import retrofit2.Response diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt index 22066019d1..1ab50e5d67 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt @@ -3,8 +3,15 @@ package info.nightscout.plugins.sync.tidepool.comm import android.content.Context import android.os.PowerManager import android.os.SystemClock +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.core.ui.dialogs.OKDialog -import info.nightscout.interfaces.Config import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsclient.ReceiverDelegate import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus @@ -13,13 +20,6 @@ import info.nightscout.plugins.sync.tidepool.messages.AuthRequestMessage import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage import info.nightscout.plugins.sync.tidepool.messages.OpenDatasetRequestMessage import info.nightscout.plugins.sync.tidepool.messages.UploadReplyMessage -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 okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody @@ -220,7 +220,7 @@ class TidepoolUploader @Inject constructor( session.iterations++ val chunk = uploadChunk.getNext(session) when { - chunk == null -> { + chunk == null -> { aapsLogger.error("Upload chunk is null, cannot proceed") releaseWakeLock() } @@ -232,7 +232,7 @@ class TidepoolUploader @Inject constructor( uploadNext() } - else -> { + else -> { val body = chunk.toRequestBody("application/json".toMediaTypeOrNull()) rxBus.send(EventTidepoolStatus(("Uploading"))) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt index bffe53e9b8..abc41d40c3 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt @@ -1,10 +1,17 @@ package info.nightscout.plugins.sync.tidepool.comm +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.tidepool.elements.BasalElement import info.nightscout.plugins.sync.tidepool.elements.BaseElement @@ -15,13 +22,6 @@ import info.nightscout.plugins.sync.tidepool.elements.SensorGlucoseElement import info.nightscout.plugins.sync.tidepool.elements.WizardElement import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus import info.nightscout.plugins.sync.tidepool.utils.GsonInstance -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import java.util.LinkedList import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt index 3b9b593a7c..6c342fbded 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt @@ -1,14 +1,13 @@ package info.nightscout.plugins.sync.tidepool.elements +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.utils.DateUtil import com.google.gson.annotations.Expose import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.interfaces.profile.Profile -import info.nightscout.shared.utils.DateUtil import java.util.UUID -class BasalElement(tbr: TemporaryBasal, profile: Profile, dateUtil: DateUtil) - : BaseElement(tbr.timestamp, UUID.nameUUIDFromBytes(("AAPS-basal" + tbr.timestamp).toByteArray()).toString(), dateUtil) { +class BasalElement(tbr: TemporaryBasal, profile: Profile, dateUtil: DateUtil) : BaseElement(tbr.timestamp, UUID.nameUUIDFromBytes(("AAPS-basal" + tbr.timestamp).toByteArray()).toString(), dateUtil) { internal var timestamp: Long = 0 // not exposed diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt index c5bdc1057e..0a160e74a4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt @@ -1,17 +1,22 @@ package info.nightscout.plugins.sync.tidepool.elements +import app.aaps.interfaces.utils.DateUtil import com.google.gson.annotations.Expose -import info.nightscout.shared.utils.DateUtil open class BaseElement(timestamp: Long, uuid: String, dateUtil: DateUtil) { + @Expose var deviceTime: String = "" + @Expose var time: String = "" + @Expose var timezoneOffset: Int = 0 + @Expose var type: String? = null + @Expose var origin: Origin? = null @@ -22,6 +27,8 @@ open class BaseElement(timestamp: Long, uuid: String, dateUtil: DateUtil) { origin = Origin(uuid) } - inner class Origin internal constructor(@field:Expose - internal var id: String) + inner class Origin internal constructor( + @field:Expose + internal var id: String + ) } \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index a6564fd628..c9284a976d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.tidepool.elements +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.utils.DateUtil import com.google.gson.annotations.Expose import info.nightscout.database.entities.TherapyEvent import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.utils.DateUtil import java.util.LinkedList import java.util.UUID diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt index f25ff9868d..42fb965339 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt @@ -1,12 +1,11 @@ package info.nightscout.plugins.sync.tidepool.elements +import app.aaps.interfaces.utils.DateUtil import com.google.gson.annotations.Expose import info.nightscout.database.entities.Bolus -import info.nightscout.shared.utils.DateUtil import java.util.UUID -class BolusElement(bolus: Bolus, dateUtil: DateUtil) - : BaseElement(bolus.timestamp, UUID.nameUUIDFromBytes(("AAPS-bolus" + bolus.timestamp).toByteArray()).toString(), dateUtil) { +class BolusElement(bolus: Bolus, dateUtil: DateUtil) : BaseElement(bolus.timestamp, UUID.nameUUIDFromBytes(("AAPS-bolus" + bolus.timestamp).toByteArray()).toString(), dateUtil) { @Expose var subType = "normal" @Expose var normal: Double = 0.0 diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt index 2dd3083c4f..60ed812531 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.tidepool.elements +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.utils.DateUtil import com.google.gson.annotations.Expose import info.nightscout.core.profile.ProfileSealed import info.nightscout.database.entities.EffectiveProfileSwitch -import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.utils.DateUtil import java.util.UUID class ProfileElement(ps: EffectiveProfileSwitch, serialNumber: String, dateUtil: DateUtil, profileUtil: ProfileUtil) : @@ -23,16 +23,22 @@ class ProfileElement(ps: EffectiveProfileSwitch, serialNumber: String, dateUtil: @Expose internal var bgTargets: TargetProfile = TargetProfile() + @Expose internal var carbRatios: IcProfile = IcProfile() + @Expose internal var insulinSensitivities: IsfProfile = IsfProfile() + @Expose internal var deviceId: String? = TidepoolUploader.PUMP_TYPE + ":" + serialNumber + @Expose internal var deviceSerialNumber: String = serialNumber + @Expose internal var clockDriftOffset: Long = 0 + @Expose internal var conversionOffset: Long = 0 @@ -62,50 +68,50 @@ class ProfileElement(ps: EffectiveProfileSwitch, serialNumber: String, dateUtil: } inner class BasalProfile internal constructor( - @field:Expose - internal var Normal: ArrayList = ArrayList() // must be the same var name as activeSchedule + @field:Expose + internal var Normal: ArrayList = ArrayList() // must be the same var name as activeSchedule ) inner class BasalRate internal constructor( - @field:Expose - internal var start: Int, - @field:Expose - internal var rate: Double + @field:Expose + internal var start: Int, + @field:Expose + internal var rate: Double ) inner class Units internal constructor( - @field:Expose - internal var carb: String = "grams", - @field:Expose - internal var bg: String = "mg/dL" + @field:Expose + internal var carb: String = "grams", + @field:Expose + internal var bg: String = "mg/dL" ) inner class TargetProfile internal constructor( - @field:Expose - internal var Normal: ArrayList = ArrayList() // must be the same var name as activeSchedule + @field:Expose + internal var Normal: ArrayList = ArrayList() // must be the same var name as activeSchedule ) inner class Target internal constructor( - @field:Expose - internal var start: Int, - @field:Expose - internal var target: Int + @field:Expose + internal var start: Int, + @field:Expose + internal var target: Int ) inner class IcProfile internal constructor( - @field:Expose - internal var Normal: ArrayList = ArrayList() // must be the same var name as activeSchedule + @field:Expose + internal var Normal: ArrayList = ArrayList() // must be the same var name as activeSchedule ) inner class IsfProfile internal constructor( - @field:Expose - internal var Normal: ArrayList = ArrayList() // must be the same var name as activeSchedule + @field:Expose + internal var Normal: ArrayList = ArrayList() // must be the same var name as activeSchedule ) inner class Ratio internal constructor( - @field:Expose - internal var start: Int, - @field:Expose - internal var amount: Int + @field:Expose + internal var start: Int, + @field:Expose + internal var amount: Int ) } diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt index c7cea855d7..576e313205 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.sync.tidepool.elements +import app.aaps.interfaces.utils.DateUtil import com.google.gson.annotations.Expose import info.nightscout.database.entities.GlucoseValue -import info.nightscout.shared.utils.DateUtil import java.util.LinkedList import java.util.UUID -class SensorGlucoseElement(bgReading: GlucoseValue, private val dateUtil: DateUtil) - : BaseElement(bgReading.timestamp, UUID.nameUUIDFromBytes(("AAPS-cgm" + bgReading.timestamp).toByteArray()).toString(), dateUtil) { +class SensorGlucoseElement(bgReading: GlucoseValue, private val dateUtil: DateUtil) : + BaseElement(bgReading.timestamp, UUID.nameUUIDFromBytes(("AAPS-cgm" + bgReading.timestamp).toByteArray()).toString(), dateUtil) { @Expose internal var units: String = "mg/dL" diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt index 603e443add..cb262f8671 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt @@ -1,13 +1,12 @@ package info.nightscout.plugins.sync.tidepool.elements +import app.aaps.interfaces.utils.DateUtil import com.google.gson.annotations.Expose import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.Carbs -import info.nightscout.shared.utils.DateUtil import java.util.UUID -class WizardElement(carbs: Carbs, dateUtil: DateUtil) - : BaseElement(carbs.timestamp, UUID.nameUUIDFromBytes(("AAPS-wizard" + carbs.timestamp).toByteArray()).toString(), dateUtil) { +class WizardElement(carbs: Carbs, dateUtil: DateUtil) : BaseElement(carbs.timestamp, UUID.nameUUIDFromBytes(("AAPS-wizard" + carbs.timestamp).toByteArray()).toString(), dateUtil) { @Expose var units = "mg/dL" @Expose var carbInput: Double = 0.toDouble() diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt index 3d16c71169..18055246e6 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.sync.tidepool.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventTidepoolDoUpload : Event() \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt index 0c0762a1b1..1f6294b8b8 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.sync.tidepool.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventTidepoolResetData : Event() \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt index 9b064661b4..a4e4ffc427 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.sync.tidepool.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event import java.text.SimpleDateFormat import java.util.Locale diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt index 341e5a0cf9..8820790bbe 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.sync.tidepool.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventTidepoolUpdateGUI : Event() diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt index f195d7bf71..300765f53d 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.tidepool.messages +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.plugins.sync.R -import info.nightscout.shared.sharedPreferences.SP import okhttp3.Credentials object AuthRequestMessage : BaseMessage() { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt index e1fcc48543..bd477bc94f 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.tidepool.messages +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import com.google.gson.annotations.Expose -import info.nightscout.interfaces.Config import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import java.util.TimeZone class OpenDatasetRequestMessage(config: Config, dateUtil: DateUtil) : BaseMessage() { diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt index 1367ceed31..7c5e7105e4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.sync.tidepool.utils -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt index 57e13016a7..65e73e7ff8 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/DataSyncSelectorXdripImpl.kt @@ -1,19 +1,19 @@ package info.nightscout.plugins.sync.xdrip +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.sync.DataSyncSelector +import app.aaps.interfaces.sync.DataSyncSelectorXdrip +import app.aaps.interfaces.sync.XDripBroadcast +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.Lazy import info.nightscout.core.utils.JsonHelper import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.XDripBroadcast -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.sync.DataSyncSelector -import info.nightscout.interfaces.sync.DataSyncSelectorXdrip import info.nightscout.plugins.sync.R -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 info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt index ca3f64e0ca..1fffc38229 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripFragment.kt @@ -12,20 +12,20 @@ import android.view.ViewGroup import androidx.core.view.MenuCompat import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginFragment +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.support.DaggerFragment import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginFragment import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.databinding.XdripFragmentBinding import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI -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 import javax.inject.Inject diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt index a1af713aa4..893d02bbf4 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/XdripPlugin.kt @@ -10,6 +10,35 @@ import androidx.work.ExistingWorkPolicy import androidx.work.OneTimeWorkRequest import androidx.work.WorkInfo import androidx.work.WorkManager +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.PluginBase +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.receivers.Intents +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventAppInitialized +import app.aaps.interfaces.rx.events.EventAutosensCalculationFinished +import app.aaps.interfaces.rx.events.EventNewBG +import app.aaps.interfaces.rx.events.EventNewHistoryData +import app.aaps.interfaces.rx.events.EventXdripNewLog +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.sync.DataSyncSelector +import app.aaps.interfaces.sync.Sync +import app.aaps.interfaces.sync.XDripBroadcast +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import app.aaps.shared.impl.extensions.safeQueryBroadcastReceivers import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.toStringShort @@ -18,40 +47,11 @@ import info.nightscout.core.iob.round import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.HtmlHelper import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.XDripBroadcast -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.PluginBase -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.receivers.Intents -import info.nightscout.interfaces.sync.DataSyncSelector -import info.nightscout.interfaces.sync.Sync -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.sync.R import info.nightscout.plugins.sync.nsclient.extensions.toJson import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI import info.nightscout.plugins.sync.xdrip.extensions.toXdripJson import info.nightscout.plugins.sync.xdrip.workers.XdripDataSyncWorker -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventAppInitialized -import info.nightscout.rx.events.EventAutosensCalculationFinished -import info.nightscout.rx.events.EventNewBG -import info.nightscout.rx.events.EventNewHistoryData -import info.nightscout.rx.events.EventXdripNewLog -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.coroutines.CoroutineScope diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt index bf6af43e8c..a8ce1b3cf2 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/events/EventXdripUpdateGUI.kt @@ -1,5 +1,5 @@ package info.nightscout.plugins.sync.xdrip.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventXdripUpdateGUI : EventUpdateGui() \ No newline at end of file diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt index 02bd4afcec..2df07dc18c 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/xdrip/workers/XdripDataSyncWorker.kt @@ -3,12 +3,12 @@ package info.nightscout.plugins.sync.xdrip.workers import android.content.Context import androidx.work.WorkerParameters import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventXdripNewLog import info.nightscout.core.utils.worker.LoggingWorker -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.plugins.sync.xdrip.DataSyncSelectorXdripImpl import info.nightscout.plugins.sync.xdrip.events.EventXdripUpdateGUI -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventXdripNewLog import kotlinx.coroutines.Dispatchers import javax.inject.Inject diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt index 45397902a6..a0c47eadfe 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/dataBroadcaster/DataBroadcastPluginTest.kt @@ -1,5 +1,18 @@ package info.nightscout.plugins.sync.dataBroadcaster +import app.aaps.interfaces.aps.AutosensDataStore +import app.aaps.interfaces.aps.Loop +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.CobInfo +import app.aaps.interfaces.iob.GlucoseStatus +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.InMemoryGlucoseValue +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import app.aaps.shared.tests.BundleMock import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat @@ -7,19 +20,6 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.aps.AutosensDataStore -import info.nightscout.interfaces.aps.Loop -import info.nightscout.interfaces.iob.CobInfo -import info.nightscout.interfaces.iob.GlucoseStatus -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.InMemoryGlucoseValue -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.rx.events.EventOverviewBolusProgress import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegateTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegateTest.kt index bb80421e03..9166b54efc 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegateTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclient/ReceiverDelegateTest.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.sync.nsclient +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.events.EventChargingState +import app.aaps.interfaces.rx.events.EventNetworkChange +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.receivers.ReceiverStatusStore import info.nightscout.plugins.sync.R -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 org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3PluginTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3PluginTest.kt index efac9ef115..fb51a78d5d 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3PluginTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3PluginTest.kt @@ -1,5 +1,13 @@ package info.nightscout.plugins.sync.nsclientV3 +import app.aaps.interfaces.insulin.Insulin +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.VirtualPump +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.sync.DataSyncSelector +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -21,14 +29,6 @@ import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.insulin.Insulin -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.VirtualPump -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.interfaces.sync.DataSyncSelector -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor import info.nightscout.plugins.sync.nsShared.StoreDataForDbImpl import info.nightscout.plugins.sync.nsclient.ReceiverDelegate diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt index f73dc176b5..d8d1beab38 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/DeviceStatusExtensionKtTest.kt @@ -1,18 +1,18 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.DeviceStatus -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.profile.Instantiator import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusDataImpl import info.nightscout.sdk.interfaces.RunningConfiguration import info.nightscout.sdk.mapper.convertToRemoteAndBack -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt index de17af6cff..6bd3e63461 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtensionKtTest.kt @@ -1,11 +1,11 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.insulin.Insulin import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.sync.nsclient.extensions.fromConstant import info.nightscout.sdk.localmodel.treatment.NSEffectiveProfileSwitch import info.nightscout.sdk.mapper.convertToRemoteAndBack diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt index f7b4083ace..8503cb8d17 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtensionKtTest.kt @@ -1,12 +1,12 @@ package info.nightscout.plugins.sync.nsclientV3.extensions +import app.aaps.interfaces.insulin.Insulin import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat import info.nightscout.core.extensions.fromConstant import info.nightscout.database.entities.ProfileSwitch import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.insulin.Insulin import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch import info.nightscout.sdk.mapper.convertToRemoteAndBack import org.junit.jupiter.api.BeforeEach diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorkerTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorkerTest.kt index bc30ccc49b..ebc400fe11 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorkerTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/DataSyncWorkerTest.kt @@ -3,13 +3,13 @@ package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.ListenableWorker.Result.Success import androidx.work.testing.TestListenableWorkerBuilder +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.sync.NsClient import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsclientV3.DataSyncSelectorV3 import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt index 19d2f2c34c..6f90a07e56 100644 --- a/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt +++ b/plugins/sync/src/test/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorkerTest.kt @@ -6,6 +6,15 @@ import androidx.work.OneTimeWorkRequest import androidx.work.WorkContinuation import androidx.work.WorkManager import androidx.work.testing.TestListenableWorkerBuilder +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.nsclient.StoreDataForDb +import app.aaps.interfaces.receivers.ReceiverStatusStore +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.source.NSClientSource +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import app.aaps.shared.tests.TestBase import com.google.common.truth.Truth.assertThat import dagger.android.AndroidInjector @@ -16,12 +25,6 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.utils.DecimalFormatterImpl -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.nsclient.StoreDataForDb -import info.nightscout.interfaces.receivers.ReceiverStatusStore -import info.nightscout.interfaces.source.NSClientSource -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.plugins.sync.nsShared.NsIncomingDataProcessor import info.nightscout.plugins.sync.nsclient.ReceiverDelegate import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler @@ -30,9 +33,6 @@ import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.plugins.sync.nsclientV3.extensions.toNSSvgV3 import info.nightscout.sdk.interfaces.NSAndroidClient import info.nightscout.sdk.remotemodel.LastModified -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ComboFragment.kt b/pump/combo/src/main/java/info/nightscout/pump/combo/ComboFragment.kt index 012713ed01..de706cf66e 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ComboFragment.kt +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ComboFragment.kt @@ -7,20 +7,20 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.pump.combo.data.ComboErrorUtil import info.nightscout.pump.combo.data.ComboErrorUtil.DisplayType import info.nightscout.pump.combo.databinding.CombopumpFragmentBinding import info.nightscout.pump.combo.events.EventComboPumpUpdateGUI import info.nightscout.pump.combo.ruffyscripter.PumpState -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventQueueChanged -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 diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ComboPlugin.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ComboPlugin.java index 60076f31cd..45254d3e20 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ComboPlugin.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ComboPlugin.java @@ -19,25 +19,36 @@ import java.util.List; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.constraints.Constraint; +import app.aaps.interfaces.constraints.PluginConstraints; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.plugin.PluginDescription; +import app.aaps.interfaces.plugin.PluginType; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.profile.ProfileFunction; +import app.aaps.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.pump.Pump; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpPluginBase; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.defs.ManufacturerType; +import app.aaps.interfaces.pump.defs.PumpDescription; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventDismissNotification; +import app.aaps.interfaces.rx.events.EventInitializationChanged; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.rx.events.EventRefreshOverview; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.T; import dagger.android.HasAndroidInjector; import info.nightscout.core.utils.fabric.InstanceId; -import info.nightscout.interfaces.constraints.Constraint; -import info.nightscout.interfaces.constraints.PluginConstraints; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.plugin.PluginDescription; -import info.nightscout.interfaces.plugin.PluginType; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.profile.ProfileFunction; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.interfaces.pump.Pump; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpPluginBase; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.defs.ManufacturerType; -import info.nightscout.interfaces.pump.defs.PumpDescription; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.ui.UiInteraction; import info.nightscout.pump.combo.events.EventComboPumpUpdateGUI; import info.nightscout.pump.combo.ruffyscripter.BasalProfile; import info.nightscout.pump.combo.ruffyscripter.BolusProgressReporter; @@ -51,17 +62,6 @@ import info.nightscout.pump.combo.ruffyscripter.history.Bolus; import info.nightscout.pump.combo.ruffyscripter.history.PumpHistory; import info.nightscout.pump.combo.ruffyscripter.history.PumpHistoryRequest; import info.nightscout.pump.combo.ruffyscripter.history.Tdd; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventDismissNotification; -import info.nightscout.rx.events.EventInitializationChanged; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.rx.events.EventRefreshOverview; -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; /** * Driver for the Roche Accu-Chek Combo pump, using the ruffy app for BT communication. diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/data/ComboErrorUtil.kt b/pump/combo/src/main/java/info/nightscout/pump/combo/data/ComboErrorUtil.kt index abc640f3ac..069cf9baf6 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/data/ComboErrorUtil.kt +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/data/ComboErrorUtil.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.combo.data +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.pump.combo.R -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/events/EventComboPumpUpdateGUI.kt b/pump/combo/src/main/java/info/nightscout/pump/combo/events/EventComboPumpUpdateGUI.kt index b349d40979..1b0c8c5a6a 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/events/EventComboPumpUpdateGUI.kt +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/events/EventComboPumpUpdateGUI.kt @@ -1,5 +1,5 @@ package info.nightscout.pump.combo.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventComboPumpUpdateGUI : EventUpdateGui() \ No newline at end of file diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/RuffyScripter.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/RuffyScripter.java index 0d1a04317f..9f70cf23be 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/RuffyScripter.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/RuffyScripter.java @@ -28,6 +28,8 @@ import java.util.Objects; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.pump.combo.data.ComboErrorUtil; import info.nightscout.pump.combo.ruffyscripter.commands.BolusCommand; import info.nightscout.pump.combo.ruffyscripter.commands.CancelTbrCommand; @@ -41,8 +43,6 @@ import info.nightscout.pump.combo.ruffyscripter.commands.ReadQuickInfoCommand; import info.nightscout.pump.combo.ruffyscripter.commands.SetBasalProfileCommand; import info.nightscout.pump.combo.ruffyscripter.commands.SetTbrCommand; import info.nightscout.pump.combo.ruffyscripter.history.PumpHistoryRequest; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; /** * Provides scripting 'runtime' and operations. consider moving operations into a separate diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/BolusCommand.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/BolusCommand.java index e383d175c7..df610b7b71 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/BolusCommand.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/BolusCommand.java @@ -11,15 +11,15 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.pump.combo.ruffyscripter.BolusProgressReporter; import info.nightscout.pump.combo.ruffyscripter.PumpWarningCodes; import info.nightscout.pump.combo.ruffyscripter.RuffyScripter; import info.nightscout.pump.combo.ruffyscripter.WarningOrErrorCode; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; public class BolusCommand extends BaseCommand { - + private final AAPSLogger aapsLogger; protected final double bolus; diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/CancelTbrCommand.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/CancelTbrCommand.java index 2a5627fa28..1f553ece1b 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/CancelTbrCommand.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/CancelTbrCommand.java @@ -4,10 +4,10 @@ import androidx.annotation.NonNull; import org.monkey.d.ruffy.ruffy.driver.display.MenuType; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.pump.combo.ruffyscripter.PumpState; import info.nightscout.pump.combo.ruffyscripter.PumpWarningCodes; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; public class CancelTbrCommand extends BaseCommand { private final AAPSLogger aapsLogger; @@ -15,7 +15,7 @@ public class CancelTbrCommand extends BaseCommand { public CancelTbrCommand(AAPSLogger aapsLogger) { this.aapsLogger = aapsLogger; } - + @Override public Integer getReconnectWarningId() { return PumpWarningCodes.TBR_CANCELLED; diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadBasalProfileCommand.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadBasalProfileCommand.java index 3c72fe0991..3b861d9bec 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadBasalProfileCommand.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadBasalProfileCommand.java @@ -9,14 +9,14 @@ import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime; import java.util.Arrays; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.pump.combo.ruffyscripter.BasalProfile; import info.nightscout.pump.combo.ruffyscripter.PumpState; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; public class ReadBasalProfileCommand extends BaseCommand { private final AAPSLogger aapsLogger; - + public ReadBasalProfileCommand(AAPSLogger aapsLogger) { this.aapsLogger = aapsLogger; } diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadHistoryCommand.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadHistoryCommand.java index 4653371076..018d99cf40 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadHistoryCommand.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadHistoryCommand.java @@ -10,14 +10,14 @@ import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime; import java.util.Calendar; import java.util.Date; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.pump.combo.ruffyscripter.history.Bolus; import info.nightscout.pump.combo.ruffyscripter.history.PumpAlert; import info.nightscout.pump.combo.ruffyscripter.history.PumpHistory; import info.nightscout.pump.combo.ruffyscripter.history.PumpHistoryRequest; import info.nightscout.pump.combo.ruffyscripter.history.Tbr; import info.nightscout.pump.combo.ruffyscripter.history.Tdd; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; public class ReadHistoryCommand extends BaseCommand { private final AAPSLogger aapsLogger; diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadQuickInfoCommand.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadQuickInfoCommand.java index ad16eef5db..c63d3fc2a7 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadQuickInfoCommand.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/ReadQuickInfoCommand.java @@ -9,10 +9,10 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.pump.combo.ruffyscripter.history.Bolus; import info.nightscout.pump.combo.ruffyscripter.history.PumpHistory; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; public class ReadQuickInfoCommand extends BaseCommand { private final AAPSLogger aapsLogger; diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/SetBasalProfileCommand.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/SetBasalProfileCommand.java index bf65ff4215..3be005ce0a 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/SetBasalProfileCommand.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/SetBasalProfileCommand.java @@ -12,10 +12,10 @@ import org.monkey.d.ruffy.ruffy.driver.display.menu.MenuTime; import java.util.ArrayList; import java.util.List; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.pump.combo.ruffyscripter.BasalProfile; import info.nightscout.pump.combo.ruffyscripter.PumpState; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; public class SetBasalProfileCommand extends BaseCommand { private final AAPSLogger aapsLogger; diff --git a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/SetTbrCommand.java b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/SetTbrCommand.java index ab585848de..78ff2d8d1a 100644 --- a/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/SetTbrCommand.java +++ b/pump/combo/src/main/java/info/nightscout/pump/combo/ruffyscripter/commands/SetTbrCommand.java @@ -12,11 +12,11 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.pump.combo.ruffyscripter.PumpState; import info.nightscout.pump.combo.ruffyscripter.PumpWarningCodes; import info.nightscout.pump.combo.ruffyscripter.WarningOrErrorCode; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; public class SetTbrCommand extends BaseCommand { private final AAPSLogger aapsLogger; diff --git a/pump/combo/src/test/java/info/nightscout/pump/combo/ComboPluginTest.kt b/pump/combo/src/test/java/info/nightscout/pump/combo/ComboPluginTest.kt index ef7c69b91d..323d8ae633 100644 --- a/pump/combo/src/test/java/info/nightscout/pump/combo/ComboPluginTest.kt +++ b/pump/combo/src/test/java/info/nightscout/pump/combo/ComboPluginTest.kt @@ -1,21 +1,21 @@ package info.nightscout.pump.combo import android.content.Context +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.combo.ruffyscripter.RuffyScripter import info.nightscout.pump.combo.ruffyscripter.history.Bolus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/AAPSComboCtlLogger.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/AAPSComboCtlLogger.kt index defb8bb653..2df6f89f75 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/AAPSComboCtlLogger.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/AAPSComboCtlLogger.kt @@ -1,18 +1,19 @@ package info.nightscout.pump.combov2 import android.util.Log +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.comboctl.base.LogLevel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import info.nightscout.comboctl.base.LoggerBackend as ComboCtlLoggerBackend internal class AAPSComboCtlLogger(private val aapsLogger: AAPSLogger) : ComboCtlLoggerBackend { + override fun log(tag: String, level: LogLevel, throwable: Throwable?, message: String?) { - val ltag = with (tag) { + val ltag = with(tag) { when { startsWith("Bluetooth") || startsWith("AndroidBluetooth") -> LTag.PUMPBTCOMM - endsWith("IO") -> LTag.PUMPCOMM - else -> LTag.PUMP + endsWith("IO") -> LTag.PUMPCOMM + else -> LTag.PUMP } } diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/AAPSPumpStateStore.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/AAPSPumpStateStore.kt index 9c4a1e08d6..e753fc599c 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/AAPSPumpStateStore.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/AAPSPumpStateStore.kt @@ -1,5 +1,6 @@ package info.nightscout.pump.combov2 +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.comboctl.base.BluetoothAddress import info.nightscout.comboctl.base.CurrentTbrState import info.nightscout.comboctl.base.InvariantPumpData @@ -10,7 +11,6 @@ import info.nightscout.comboctl.base.Tbr import info.nightscout.comboctl.base.toBluetoothAddress import info.nightscout.comboctl.base.toCipher import info.nightscout.comboctl.base.toNonce -import info.nightscout.shared.sharedPreferences.SP import kotlinx.datetime.Instant import kotlinx.datetime.UtcOffset import kotlin.reflect.KClassifier @@ -50,6 +50,7 @@ class AAPSPumpStateStore( private val aapsMainSP: SP, private val internalSP: InternalSP ) : PumpStateStore { + private var btAddress: String by SPDelegateString(internalSP, PreferenceKeys.BT_ADDRESS_KEY.str, "") @@ -145,16 +146,17 @@ class AAPSPumpStateStore( override fun getCurrentTbrState(pumpAddress: BluetoothAddress) = if (tbrTimestamp >= 0) - CurrentTbrState.TbrStarted(Tbr( - timestamp = Instant.fromEpochSeconds(tbrTimestamp), - percentage = tbrPercentage, - durationInMinutes = tbrDuration, - type = Tbr.Type.fromStringId(tbrType) ?: throw PumpStateStoreAccessException(pumpAddress, "Invalid type \"$tbrType\"") - )) + CurrentTbrState.TbrStarted( + Tbr( + timestamp = Instant.fromEpochSeconds(tbrTimestamp), + percentage = tbrPercentage, + durationInMinutes = tbrDuration, + type = Tbr.Type.fromStringId(tbrType) ?: throw PumpStateStoreAccessException(pumpAddress, "Invalid type \"$tbrType\"") + ) + ) else CurrentTbrState.NoTbrOngoing - override fun setCurrentTbrState(pumpAddress: BluetoothAddress, currentTbrState: CurrentTbrState) { when (currentTbrState) { is CurrentTbrState.TbrStarted -> { @@ -163,7 +165,8 @@ class AAPSPumpStateStore( tbrDuration = currentTbrState.tbr.durationInMinutes tbrType = currentTbrState.tbr.type.stringId } - else -> { + + else -> { tbrTimestamp = -1 tbrPercentage = -1 tbrDuration = -1 @@ -176,14 +179,16 @@ class AAPSPumpStateStore( // pump operations. These are the TBR values, the UTC offset, and the nonce. Users are recommended to // call this after AAPS disconnects the pump. fun copyVariantValuesToAAPSMainSP(commit: Boolean) = - copyValuesBetweenSPs(commit, from = internalSP, to = aapsMainSP, arrayOf( - PreferenceKeys.NONCE_KEY, - PreferenceKeys.TBR_TIMESTAMP_KEY, - PreferenceKeys.TBR_PERCENTAGE_KEY, - PreferenceKeys.TBR_DURATION_KEY, - PreferenceKeys.TBR_TYPE_KEY, - PreferenceKeys.UTC_OFFSET_KEY - )) + copyValuesBetweenSPs( + commit, from = internalSP, to = aapsMainSP, arrayOf( + PreferenceKeys.NONCE_KEY, + PreferenceKeys.TBR_TIMESTAMP_KEY, + PreferenceKeys.TBR_PERCENTAGE_KEY, + PreferenceKeys.TBR_DURATION_KEY, + PreferenceKeys.TBR_TYPE_KEY, + PreferenceKeys.UTC_OFFSET_KEY + ) + ) // Copies all pump state values from the AAPS main SP to the internal SP. This is supposed to be // called if the internal SP is empty. That way, a pump state can be imported from AAPS settings files. @@ -205,8 +210,8 @@ class AAPSPumpStateStore( if (!from.contains(key.str)) continue when (key.type) { - Int::class -> putInt(key.str, from.getInt(key.str, 0)) - Long::class -> putLong(key.str, from.getLong(key.str, 0L)) + Int::class -> putInt(key.str, from.getInt(key.str, 0)) + Long::class -> putLong(key.str, from.getLong(key.str, 0L)) String::class -> putString(key.str, from.getString(key.str, "")) } } diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Fragment.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Fragment.kt index 4ae87a043c..3879e38fb0 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Fragment.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Fragment.kt @@ -9,13 +9,13 @@ import androidx.databinding.DataBindingUtil import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.support.DaggerFragment import info.nightscout.comboctl.base.NullDisplayFrame import info.nightscout.comboctl.parser.BatteryState import info.nightscout.comboctl.parser.ReservoirState -import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.pump.combov2.databinding.Combov2FragmentBinding -import info.nightscout.shared.interfaces.ResourceHelper import kotlinx.coroutines.delay import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -27,6 +27,7 @@ import info.nightscout.comboctl.base.Tbr as ComboCtlTbr import info.nightscout.comboctl.main.Pump as ComboCtlPump class ComboV2Fragment : DaggerFragment() { + @Inject lateinit var combov2Plugin: ComboV2Plugin @Inject lateinit var rh: ResourceHelper @Inject lateinit var commandQueue: CommandQueue @@ -36,7 +37,8 @@ class ComboV2Fragment : DaggerFragment() { savedInstanceState: Bundle? ): View { val binding: Combov2FragmentBinding = DataBindingUtil.inflate( - inflater, R.layout.combov2_fragment, container, false) + inflater, R.layout.combov2_fragment, container, false + ) val view = binding.root binding.combov2RefreshButton.setOnClickListener { @@ -71,24 +73,31 @@ class ComboV2Fragment : DaggerFragment() { ComboV2Plugin.DriverState.Error -> rh.gs(info.nightscout.core.ui.R.string.error) is ComboV2Plugin.DriverState.ExecutingCommand -> when (val desc = connectionState.description) { - is ComboCtlPump.GettingBasalProfileCommandDesc -> + is ComboCtlPump.GettingBasalProfileCommandDesc -> rh.gs(R.string.combov2_getting_basal_profile_cmddesc) - is ComboCtlPump.SettingBasalProfileCommandDesc -> + + is ComboCtlPump.SettingBasalProfileCommandDesc -> rh.gs(R.string.combov2_setting_basal_profile_cmddesc) - is ComboCtlPump.SettingTbrCommandDesc -> + + is ComboCtlPump.SettingTbrCommandDesc -> if (desc.percentage != 100) rh.gs(R.string.combov2_setting_tbr_cmddesc, desc.percentage, desc.durationInMinutes) else rh.gs(R.string.combov2_cancelling_tbr) - is ComboCtlPump.DeliveringBolusCommandDesc -> + + is ComboCtlPump.DeliveringBolusCommandDesc -> rh.gs(R.string.combov2_delivering_bolus_cmddesc, desc.immediateBolusAmount.cctlBolusToIU()) - is ComboCtlPump.FetchingTDDHistoryCommandDesc -> + + is ComboCtlPump.FetchingTDDHistoryCommandDesc -> rh.gs(R.string.combov2_fetching_tdd_history_cmddesc) + is ComboCtlPump.UpdatingPumpDateTimeCommandDesc -> rh.gs(R.string.combov2_updating_pump_datetime_cmddesc) - is ComboCtlPump.UpdatingPumpStatusCommandDesc -> + + is ComboCtlPump.UpdatingPumpStatusCommandDesc -> rh.gs(R.string.combov2_updating_pump_status_cmddesc) - else -> rh.gs(R.string.combov2_executing_command) + + else -> rh.gs(R.string.combov2_executing_command) } } binding.combov2DriverState.text = text @@ -100,8 +109,9 @@ class ComboV2Fragment : DaggerFragment() { // 3. When an error happened (to manually clear the pumpErrorObserved flag and unlock the loop after dealing with the error) ComboV2Plugin.DriverState.Disconnected, ComboV2Plugin.DriverState.Suspended, - ComboV2Plugin.DriverState.Error-> true - else -> false + ComboV2Plugin.DriverState.Error -> true + + else -> false } binding.combov2DriverState.setTextColor( @@ -136,15 +146,18 @@ class ComboV2Fragment : DaggerFragment() { combov2Plugin.batteryStateUIFlow .onEach { batteryState -> when (batteryState) { - null -> binding.combov2Battery.text = "" - BatteryState.NO_BATTERY -> { + null -> binding.combov2Battery.text = "" + + BatteryState.NO_BATTERY -> { binding.combov2Battery.text = rh.gs(R.string.combov2_battery_empty_indicator) binding.combov2Battery.setTextColor(Color.RED) } - BatteryState.LOW_BATTERY -> { + + BatteryState.LOW_BATTERY -> { binding.combov2Battery.text = rh.gs(R.string.combov2_battery_low_indicator) binding.combov2Battery.setTextColor(Color.YELLOW) } + BatteryState.FULL_BATTERY -> { binding.combov2Battery.text = rh.gs(R.string.combov2_battery_full_indicator) binding.combov2Battery.setTextColor(Color.WHITE) @@ -162,10 +175,10 @@ class ComboV2Fragment : DaggerFragment() { binding.combov2Reservoir.setTextColor( when (reservoirLevel?.state) { - null -> Color.WHITE + null -> Color.WHITE ReservoirState.EMPTY -> Color.RED - ReservoirState.LOW -> Color.YELLOW - ReservoirState.FULL -> Color.WHITE + ReservoirState.LOW -> Color.YELLOW + ReservoirState.FULL -> Color.WHITE } ) } @@ -231,20 +244,20 @@ class ComboV2Fragment : DaggerFragment() { // we display a different message, one that // warns the user that a long time passed when (val secondsPassed = lastConnectionTimestamp?.let { (currentTimestamp - it) / 1000 }) { - null -> + null -> binding.combov2LastConnection.text = "" - in 0..60 -> { + in 0..60 -> { binding.combov2LastConnection.text = rh.gs(R.string.combov2_less_than_one_minute_ago) binding.combov2LastConnection.setTextColor(Color.WHITE) } in 60..(30 * 60) -> { - binding.combov2LastConnection.text = rh.gs(info.nightscout.interfaces.R.string.minago, secondsPassed / 60) + binding.combov2LastConnection.text = rh.gs(app.aaps.interfaces.R.string.minago, secondsPassed / 60) binding.combov2LastConnection.setTextColor(Color.WHITE) } - else -> { + else -> { binding.combov2LastConnection.text = rh.gs(R.string.combov2_no_connection_for_n_mins, secondsPassed / 60) binding.combov2LastConnection.setTextColor(Color.RED) } @@ -266,8 +279,8 @@ class ComboV2Fragment : DaggerFragment() { in 0..59 -> rh.gs(R.string.combov2_less_than_one_minute_ago) - else -> - rh.gs(info.nightscout.interfaces.R.string.minago, secondsPassed / 60) + else -> + rh.gs(app.aaps.interfaces.R.string.minago, secondsPassed / 60) } binding.combov2LastBolus.text = diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt index 7025448262..85d15e15a8 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt @@ -8,6 +8,39 @@ import androidx.lifecycle.repeatOnLifecycle import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpPluginBase +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventInitializationChanged +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress.Treatment +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.TimeChangeType import dagger.android.HasAndroidInjector import info.nightscout.comboctl.android.AndroidBluetoothInterface import info.nightscout.comboctl.base.BasicProgressStage @@ -28,40 +61,7 @@ import info.nightscout.comboctl.parser.ReservoirState import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpPluginBase -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.pump.combov2.activities.ComboV2PairingActivity -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventInitializationChanged -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventOverviewBolusProgress.Treatment -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventRefreshOverview -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 kotlinx.coroutines.CancellationException import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Deferred diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/Delegates.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/Delegates.kt index fb7732f5e4..8c8cecd98d 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/Delegates.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/Delegates.kt @@ -1,6 +1,6 @@ package info.nightscout.pump.combov2 -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.sharedPreferences.SP import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty @@ -24,6 +24,7 @@ class SPDelegateBoolean( private val defaultValue: Boolean = false, private val commit: Boolean = false ) : ReadWriteProperty { + override fun getValue(thisRef: Any, property: KProperty<*>) = sp.getBoolean(key, defaultValue) @@ -37,6 +38,7 @@ class SPDelegateDouble( private val defaultValue: Double = 0.0, private val commit: Boolean = false ) : ReadWriteProperty { + override fun getValue(thisRef: Any, property: KProperty<*>) = sp.getDouble(key, defaultValue) @@ -50,6 +52,7 @@ class SPDelegateLong( private val defaultValue: Long = 0, private val commit: Boolean = false ) : ReadWriteProperty { + override fun getValue(thisRef: Any, property: KProperty<*>) = sp.getLong(key, defaultValue) @@ -63,6 +66,7 @@ class SPDelegateInt( private val defaultValue: Int = 0, private val commit: Boolean = false ) : ReadWriteProperty { + override fun getValue(thisRef: Any, property: KProperty<*>) = sp.getInt(key, defaultValue) @@ -76,6 +80,7 @@ class SPDelegateString( private val defaultValue: String = "", private val commit: Boolean = false ) : ReadWriteProperty { + override fun getValue(thisRef: Any, property: KProperty<*>) = sp.getString(key, defaultValue) diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/InternalSP.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/InternalSP.kt index 7c37a362ea..5522cbca72 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/InternalSP.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/InternalSP.kt @@ -4,8 +4,8 @@ import android.annotation.SuppressLint import android.content.Context import android.content.SharedPreferences import androidx.annotation.StringRes -import info.nightscout.shared.SafeParse -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.SafeParse // This is a copy of the AAPS SPImplementation. We keep this to be able // to set up a custom internal SP store for the Combo pump state. @@ -13,6 +13,7 @@ class InternalSP( private val sharedPreferences: SharedPreferences, private val context: Context ) : SP { + @SuppressLint("ApplySharedPref") override fun edit(commit: Boolean, block: SP.Editor.() -> Unit) { val spEdit = sharedPreferences.edit() @@ -25,6 +26,7 @@ class InternalSP( override fun remove(@StringRes resourceID: Int) { spEdit.remove(context.getString(resourceID)) } + override fun remove(key: String) { spEdit.remove(key) } @@ -32,30 +34,39 @@ class InternalSP( override fun putBoolean(key: String, value: Boolean) { spEdit.putBoolean(key, value) } + override fun putBoolean(@StringRes resourceID: Int, value: Boolean) { spEdit.putBoolean(context.getString(resourceID), value) } + override fun putDouble(key: String, value: Double) { spEdit.putString(key, value.toString()) } + override fun putDouble(@StringRes resourceID: Int, value: Double) { spEdit.putString(context.getString(resourceID), value.toString()) } + override fun putLong(key: String, value: Long) { spEdit.putLong(key, value) } + override fun putLong(@StringRes resourceID: Int, value: Long) { spEdit.putLong(context.getString(resourceID), value) } + override fun putInt(key: String, value: Int) { spEdit.putInt(key, value) } + override fun putInt(@StringRes resourceID: Int, value: Int) { spEdit.putInt(context.getString(resourceID), value) } + override fun putString(key: String, value: String) { spEdit.putString(key, value) } + override fun putString(@StringRes resourceID: Int, value: String) { spEdit.putString(context.getString(resourceID), value) } diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/Utility.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/Utility.kt index 407a8ecf06..0887f0aea5 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/Utility.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/Utility.kt @@ -2,16 +2,16 @@ package info.nightscout.pump.combov2 import android.content.Context import android.os.Build +import app.aaps.interfaces.androidPermissions.AndroidPermission +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.comboctl.android.AndroidBluetoothPermissionException import info.nightscout.comboctl.base.ComboException import info.nightscout.comboctl.main.BasalProfile import info.nightscout.comboctl.main.NUM_COMBO_BASAL_PROFILE_FACTORS -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.profile.Profile as AAPSProfile -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import kotlinx.coroutines.delay +import app.aaps.interfaces.profile.Profile as AAPSProfile // Utility extension functions for clearer conversion between // ComboCtl units and AAPS units. ComboCtl uses integer-encoded diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/activities/ComboV2PairingActivity.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/activities/ComboV2PairingActivity.kt index d895426c63..bcc23aeb71 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/activities/ComboV2PairingActivity.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/activities/ComboV2PairingActivity.kt @@ -17,6 +17,9 @@ import androidx.databinding.DataBindingUtil import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope import androidx.lifecycle.repeatOnLifecycle +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.comboctl.base.BasicProgressStage import info.nightscout.comboctl.base.PAIRING_PIN_SIZE import info.nightscout.comboctl.base.PairingPIN @@ -26,9 +29,6 @@ import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.pump.combov2.ComboV2Plugin import info.nightscout.pump.combov2.R import info.nightscout.pump.combov2.databinding.Combov2PairingActivityBinding -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import kotlinx.coroutines.CompletableJob import kotlinx.coroutines.Job import kotlinx.coroutines.flow.launchIn @@ -43,6 +43,7 @@ private class BluetoothPermissionChecks( private val permissions: List, private val aapsLogger: AAPSLogger ) { + private val activityResultLauncher: ActivityResultLauncher> private var waitForCompletion: CompletableJob? = null @@ -100,7 +101,8 @@ class ComboV2PairingActivity : TranslatedDaggerAppCompatActivity() { aapsLogger.info(LTag.PUMP, "User rejected discovery request; cancelling pairing") combov2Plugin.cancelPairing() } - else -> Unit + + else -> Unit } } combov2Plugin.customDiscoveryActivityStartCallback = { intent -> @@ -111,7 +113,8 @@ class ComboV2PairingActivity : TranslatedDaggerAppCompatActivity() { } val binding: Combov2PairingActivityBinding = DataBindingUtil.setContentView( - this, R.layout.combov2_pairing_activity) + this, R.layout.combov2_pairing_activity + ) title = rh.gs(R.string.combov2_pair_with_pump_title) supportActionBar?.setDisplayHomeAsUpEnabled(true) @@ -180,7 +183,7 @@ class ComboV2PairingActivity : TranslatedDaggerAppCompatActivity() { } } - else -> { + else -> { binding.combov2PairingSectionCannotPairDriverNotInitialized.visibility = View.GONE setupUi(binding) uiInitialized = true @@ -304,6 +307,7 @@ class ComboV2PairingActivity : TranslatedDaggerAppCompatActivity() { // code above turned this into "123 4". 4, 8 -> it + 1 + else -> it } @@ -316,6 +320,7 @@ class ComboV2PairingActivity : TranslatedDaggerAppCompatActivity() { // this into "123". 4, 8 -> it - 1 + else -> it } @@ -375,39 +380,40 @@ class ComboV2PairingActivity : TranslatedDaggerAppCompatActivity() { BasicProgressStage.Idle, BasicProgressStage.Finished, is BasicProgressStage.Aborted -> View.GONE - else -> View.VISIBLE + + else -> View.VISIBLE } if (stage is BasicProgressStage.Aborted) { binding.combov2PairingAbortedReasonText.text = when (stage) { is BasicProgressStage.Cancelled -> rh.gs(R.string.combov2_pairing_cancelled) - is BasicProgressStage.Timeout -> rh.gs(R.string.combov2_pairing_combo_scan_timeout_reached) - is BasicProgressStage.Error -> rh.gs(R.string.combov2_pairing_failed_due_to_error, stage.cause.toString()) - else -> rh.gs(R.string.combov2_pairing_aborted_unknown_reasons) + is BasicProgressStage.Timeout -> rh.gs(R.string.combov2_pairing_combo_scan_timeout_reached) + is BasicProgressStage.Error -> rh.gs(R.string.combov2_pairing_failed_due_to_error, stage.cause.toString()) + else -> rh.gs(R.string.combov2_pairing_aborted_unknown_reasons) } } binding.combov2CurrentPairingStepDesc.text = when (stage) { - BasicProgressStage.ScanningForPumpStage -> + BasicProgressStage.ScanningForPumpStage -> rh.gs(R.string.combov2_scanning_for_pump) - is BasicProgressStage.EstablishingBtConnection -> { + is BasicProgressStage.EstablishingBtConnection -> { rh.gs( R.string.combov2_establishing_bt_connection, stage.currentAttemptNr ) } - BasicProgressStage.PerformingConnectionHandshake -> + BasicProgressStage.PerformingConnectionHandshake -> rh.gs(R.string.combov2_pairing_performing_handshake) - BasicProgressStage.ComboPairingKeyAndPinRequested -> + BasicProgressStage.ComboPairingKeyAndPinRequested -> rh.gs(R.string.combov2_pairing_pump_requests_pin) - BasicProgressStage.ComboPairingFinishing -> + BasicProgressStage.ComboPairingFinishing -> rh.gs(R.string.combov2_pairing_finishing) - else -> "" + else -> "" } if (stage == BasicProgressStage.ComboPairingKeyAndPinRequested) { diff --git a/pump/dana/src/main/java/info/nightscout/pump/dana/DanaFragment.kt b/pump/dana/src/main/java/info/nightscout/pump/dana/DanaFragment.kt index 87e5817b37..c278009fc2 100644 --- a/pump/dana/src/main/java/info/nightscout/pump/dana/DanaFragment.kt +++ b/pump/dana/src/main/java/info/nightscout/pump/dana/DanaFragment.kt @@ -9,37 +9,37 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.core.content.ContextCompat +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Dana +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.WarnColors +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventExtendedBolusChange +import app.aaps.interfaces.rx.events.EventInitializationChanged +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.userEntry.UserEntryMapper.Action +import app.aaps.interfaces.userEntry.UserEntryMapper.Sources +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Dana -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.WarnColors -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.userEntry.UserEntryMapper.Action -import info.nightscout.interfaces.userEntry.UserEntryMapper.Sources import info.nightscout.pump.dana.activities.DanaHistoryActivity import info.nightscout.pump.dana.activities.DanaUserOptionsActivity import info.nightscout.pump.dana.databinding.DanarFragmentBinding import info.nightscout.pump.dana.events.EventDanaRNewStatus -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventExtendedBolusChange -import info.nightscout.rx.events.EventInitializationChanged -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.rx.events.EventTempBasalChange -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.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 @@ -207,7 +207,7 @@ class DanaFragment : DaggerFragment() { if (pump.lastConnection != 0L) { val agoMilliseconds = System.currentTimeMillis() - pump.lastConnection val agoMin = (agoMilliseconds.toDouble() / 60.0 / 1000.0).toInt() - binding.lastConnection.text = dateUtil.timeString(pump.lastConnection) + " (" + rh.gs(info.nightscout.interfaces.R.string.minago, agoMin) + ")" + binding.lastConnection.text = dateUtil.timeString(pump.lastConnection) + " (" + rh.gs(app.aaps.interfaces.R.string.minago, agoMin) + ")" warnColors.setColor(binding.lastConnection, agoMin.toDouble(), 16.0, 31.0) } if (pump.lastBolusTime != 0L) { @@ -215,7 +215,11 @@ class DanaFragment : DaggerFragment() { val agoHours = agoMilliseconds.toDouble() / 60.0 / 60.0 / 1000.0 if (agoHours < 6) // max 6h back - binding.lastBolus.text = dateUtil.timeString(pump.lastBolusTime) + " " + dateUtil.sinceString(pump.lastBolusTime, rh) + " " + rh.gs(info.nightscout.core.ui.R.string.format_insulin_units, pump.lastBolusAmount) + binding.lastBolus.text = + dateUtil.timeString(pump.lastBolusTime) + " " + dateUtil.sinceString(pump.lastBolusTime, rh) + " " + rh.gs( + info.nightscout.core.ui.R.string.format_insulin_units, + pump.lastBolusAmount + ) else binding.lastBolus.text = "" } diff --git a/pump/dana/src/main/java/info/nightscout/pump/dana/DanaPump.kt b/pump/dana/src/main/java/info/nightscout/pump/dana/DanaPump.kt index 43d5608f8c..fa802d9c68 100644 --- a/pump/dana/src/main/java/info/nightscout/pump/dana/DanaPump.kt +++ b/pump/dana/src/main/java/info/nightscout/pump/dana/DanaPump.kt @@ -1,19 +1,19 @@ package info.nightscout.pump.dana -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileStore -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.rx.events.EventOverviewBolusProgress -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 info.nightscout.shared.utils.T +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileStore +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import org.joda.time.DateTime import org.joda.time.DateTimeZone import org.json.JSONArray @@ -411,16 +411,18 @@ class DanaPump @Inject constructor( fun modelFriendlyName(): String = when (hwModel) { - 0x01 -> "DanaR Korean" + 0x01 -> "DanaR Korean" 0x03 -> when (protocol) { 0x00 -> "DanaR old" 0x02 -> "DanaR v2" else -> "DanaR" // 0x01 and 0x03 known } + 0x05 -> if (protocol < 10) "DanaRS" else "DanaRS v3" + 0x06 -> "DanaRS Korean" 0x07 -> "Dana-i (BLE4.2)" 0x09, 0x0A -> "Dana-i (BLE5)" @@ -436,6 +438,7 @@ class DanaPump @Inject constructor( 0x02 -> PumpType.DANA_RV2 else -> PumpType.DANA_R // 0x01 and 0x03 known } + 0x05 -> PumpType.DANA_RS 0x06 -> PumpType.DANA_RS_KOREAN 0x07 -> PumpType.DANA_I diff --git a/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaHistoryActivity.kt b/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaHistoryActivity.kt index c279e44935..0e704a2abe 100644 --- a/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaHistoryActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaHistoryActivity.kt @@ -8,30 +8,30 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDanaRSyncStatus +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.pump.dana.R import info.nightscout.pump.dana.comm.RecordTypes import info.nightscout.pump.dana.database.DanaHistoryRecord import info.nightscout.pump.dana.database.DanaHistoryRecordDao import info.nightscout.pump.dana.databinding.DanarHistoryActivityBinding import info.nightscout.pump.dana.databinding.DanarHistoryItemBinding -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDanaRSyncStatus -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -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 diff --git a/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaUserOptionsActivity.kt b/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaUserOptionsActivity.kt index 28320f54da..655b7bca18 100644 --- a/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaUserOptionsActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/pump/dana/activities/DanaUserOptionsActivity.kt @@ -2,24 +2,23 @@ package info.nightscout.pump.dana.activities import android.content.Context import android.os.Bundle +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventInitializationChanged +import app.aaps.interfaces.ui.UiInteraction import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.R import info.nightscout.pump.dana.databinding.DanarUserOptionsActivityBinding -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventInitializationChanged -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/pump/dana/src/main/java/info/nightscout/pump/dana/events/EventDanaRNewStatus.kt b/pump/dana/src/main/java/info/nightscout/pump/dana/events/EventDanaRNewStatus.kt index 8299ddc351..3a9689b7e4 100644 --- a/pump/dana/src/main/java/info/nightscout/pump/dana/events/EventDanaRNewStatus.kt +++ b/pump/dana/src/main/java/info/nightscout/pump/dana/events/EventDanaRNewStatus.kt @@ -1,5 +1,5 @@ package info.nightscout.pump.dana.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventDanaRNewStatus : Event() diff --git a/pump/dana/src/test/java/info/nightscout/pump/dana/DanaPumpTest.kt b/pump/dana/src/test/java/info/nightscout/pump/dana/DanaPumpTest.kt index b11ddca0a6..62d9b70b40 100644 --- a/pump/dana/src/test/java/info/nightscout/pump/dana/DanaPumpTest.kt +++ b/pump/dana/src/test/java/info/nightscout/pump/dana/DanaPumpTest.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.dana +import app.aaps.interfaces.objects.Instantiator import app.aaps.shared.tests.TestBaseWithProfile import com.google.common.truth.Truth.assertThat -import info.nightscout.interfaces.profile.Instantiator import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index 9ea58cb177..39c25c07c0 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -6,36 +6,36 @@ import android.content.Intent import android.content.ServiceConnection import android.os.IBinder import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.PumpSync.TemporaryBasalType +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.Round import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danaRKorean.services.DanaRKoreanExecutionService import info.nightscout.androidaps.danar.AbstractDanaRPlugin import info.nightscout.androidaps.danar.R import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.PumpSync.TemporaryBasalType -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.Round import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.database.DanaHistoryDatabase -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventPreferenceChange -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 io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgCheckValue_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgCheckValue_k.kt index 106a18e897..aa67c902a8 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgCheckValue_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgCheckValue_k.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.danaRKorean.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag class MsgCheckValue_k( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusBasic_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusBasic_k.kt index 0d903a169e..36ba59cca6 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusBasic_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusBasic_k.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.danaRKorean.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.LTag class MsgInitConnStatusBasic_k( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusBolus_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusBolus_k.kt index 7b8c5de175..bffc1e07d3 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusBolus_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusBolus_k.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.danaRKorean.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.LTag class MsgInitConnStatusBolus_k( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusTime_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusTime_k.kt index ba947187c7..bf03682f01 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusTime_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusTime_k.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.danaRKorean.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.rx.events.EventRebuildTabs import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.rx.events.EventRebuildTabs -import info.nightscout.rx.logging.LTag class MsgInitConnStatusTime_k( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgSettingBasalProfileAll_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgSettingBasalProfileAll_k.kt index fe92b5103d..e7c3760bd4 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgSettingBasalProfileAll_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgSettingBasalProfileAll_k.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danaRKorean.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.rx.logging.LTag import java.util.Locale /** @@ -56,8 +56,9 @@ class MsgSettingBasalProfileAll_k( for (index in 0..47) { aapsLogger.debug( LTag.PUMPCOMM, "Basal profile " + profile + ": " + String.format(Locale.ENGLISH, "%02d", index / 2) + - ":" + String.format(Locale.ENGLISH, "%02d", index % 2 * 30) + " : " + - danaPump.pumpProfiles!![profile][index]) + ":" + String.format(Locale.ENGLISH, "%02d", index % 2 * 30) + " : " + + danaPump.pumpProfiles!![profile][index] + ) } } } diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgSettingBasal_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgSettingBasal_k.kt index 02a8b7afc8..6a683eacb6 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgSettingBasal_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgSettingBasal_k.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danaRKorean.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.rx.logging.LTag import java.util.Locale class MsgSettingBasal_k( diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgStatusBasic_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgStatusBasic_k.kt index d58c76b17b..878f966360 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgStatusBasic_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgStatusBasic_k.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danaRKorean.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.rx.logging.LTag - class MsgStatusBasic_k( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgStatus_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgStatus_k.kt index 3a5b7fe043..bacb2d3114 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgStatus_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgStatus_k.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danaRKorean.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.rx.logging.LTag - class MsgStatus_k( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java index 062262cf4e..814ce8411e 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java @@ -8,6 +8,28 @@ import java.io.IOException; import javax.inject.Inject; +import app.aaps.interfaces.configuration.Constants; +import app.aaps.interfaces.constraints.ConstraintsChecker; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.profile.ProfileFunction; +import app.aaps.interfaces.pump.BolusProgressData; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.queue.Command; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventInitializationChanged; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged; +import app.aaps.interfaces.rx.events.EventPumpStatusChanged; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.T; import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.danaRKorean.comm.MessageHashTableRKorean; import info.nightscout.androidaps.danaRKorean.comm.MsgCheckValue_k; @@ -33,30 +55,8 @@ import info.nightscout.androidaps.danar.comm.MsgSettingShippingInfo; import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService; -import info.nightscout.interfaces.Constants; -import info.nightscout.interfaces.constraints.ConstraintsChecker; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.profile.ProfileFunction; -import info.nightscout.interfaces.pump.BolusProgressData; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.queue.Command; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.ui.UiInteraction; import info.nightscout.pump.dana.DanaPump; import info.nightscout.pump.dana.events.EventDanaRNewStatus; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventInitializationChanged; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.rx.events.EventProfileSwitchChanged; -import info.nightscout.rx.events.EventPumpStatusChanged; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.shared.utils.T; public class DanaRKoreanExecutionService extends AbstractDanaRExecutionService { @Inject AAPSLogger aapsLogger; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index 52a9dc6a47..fe0410abeb 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -12,37 +12,37 @@ import javax.inject.Inject; import javax.inject.Singleton; import app.aaps.annotations.OpenForTesting; +import app.aaps.interfaces.constraints.ConstraintsChecker; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.plugin.ActivePlugin; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.pump.DetailedBolusInfoStorage; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.TemporaryBasalStorage; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventAppExit; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.DecimalFormatter; +import app.aaps.interfaces.utils.Round; +import app.aaps.interfaces.utils.T; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.danaRv2.services.DanaRv2ExecutionService; import info.nightscout.androidaps.danar.AbstractDanaRPlugin; import info.nightscout.androidaps.danar.R; import info.nightscout.core.constraints.ConstraintObject; import info.nightscout.core.utils.fabric.FabricPrivacy; -import info.nightscout.interfaces.constraints.ConstraintsChecker; -import info.nightscout.interfaces.plugin.ActivePlugin; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.TemporaryBasalStorage; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.ui.UiInteraction; -import info.nightscout.interfaces.utils.DecimalFormatter; -import info.nightscout.interfaces.utils.Round; import info.nightscout.pump.dana.DanaPump; import info.nightscout.pump.dana.database.DanaHistoryDatabase; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventAppExit; -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; @Singleton @OpenForTesting diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgCheckValue_v2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgCheckValue_v2.kt index 2105f3a118..9381fa31a4 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgCheckValue_v2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgCheckValue_v2.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.danaRv2.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.rx.events.EventRebuildTabs import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginType import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.events.EventRebuildTabs -import info.nightscout.rx.logging.LTag class MsgCheckValue_v2( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt index 3beea951b4..b8a1f0b108 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt @@ -1,15 +1,16 @@ package info.nightscout.androidaps.danaRv2.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.T +import info.nightscout.pump.dana.R import java.util.GregorianCalendar -class MsgHistoryEventsV2 constructor( +class MsgHistoryEventsV2( injector: HasAndroidInjector, var from: Long = 0 ) : MessageBase(injector) { @@ -278,6 +279,6 @@ class MsgHistoryEventsV2 constructor( } } if (datetime > danaPump.lastEventTimeLoaded) danaPump.lastEventTimeLoaded = datetime - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.processinghistory) + ": " + status)) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.processinghistory) + ": " + status)) } } \ No newline at end of file diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgSetAPSTempBasalStart_v2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgSetAPSTempBasalStart_v2.kt index 34fdda4d31..4e3f80aa05 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgSetAPSTempBasalStart_v2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgSetAPSTempBasalStart_v2.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danaRv2.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.rx.logging.LTag - @Suppress("UNUSED_PARAMETER") class MsgSetAPSTempBasalStart_v2( diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgSetHistoryEntry_v2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgSetHistoryEntry_v2.kt index 11ca0f16fc..2b99390b25 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgSetHistoryEntry_v2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgSetHistoryEntry_v2.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danaRv2.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.rx.logging.LTag import java.util.Date import java.util.GregorianCalendar diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgStatusAPS_v2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgStatusAPS_v2.kt index 368f5a835a..1f049bf318 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgStatusAPS_v2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgStatusAPS_v2.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danaRv2.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.rx.logging.LTag - class MsgStatusAPS_v2( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java index 9c30704f35..21a744146a 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java @@ -9,6 +9,31 @@ import java.io.IOException; import javax.inject.Inject; +import app.aaps.interfaces.configuration.Constants; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.plugin.ActivePlugin; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.profile.ProfileFunction; +import app.aaps.interfaces.pump.BolusProgressData; +import app.aaps.interfaces.pump.Pump; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.queue.Callback; +import app.aaps.interfaces.queue.Command; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventInitializationChanged; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged; +import app.aaps.interfaces.rx.events.EventPumpStatusChanged; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.T; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.danaRv2.DanaRv2Plugin; @@ -45,33 +70,8 @@ import info.nightscout.androidaps.danar.comm.MsgStatusBasic; import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService; -import info.nightscout.interfaces.Constants; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.plugin.ActivePlugin; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.profile.ProfileFunction; -import info.nightscout.interfaces.pump.BolusProgressData; -import info.nightscout.interfaces.pump.Pump; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.queue.Callback; -import info.nightscout.interfaces.queue.Command; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.ui.UiInteraction; import info.nightscout.pump.dana.DanaPump; import info.nightscout.pump.dana.events.EventDanaRNewStatus; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventInitializationChanged; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.rx.events.EventProfileSwitchChanged; -import info.nightscout.rx.events.EventPumpStatusChanged; -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; public class DanaRv2ExecutionService extends AbstractDanaRExecutionService { @Inject HasAndroidInjector injector; @@ -405,7 +405,7 @@ public class DanaRv2ExecutionService extends AbstractDanaRExecutionService { rxBus.send(new EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.gettingbolusstatus))); mSerialIOThread.sendMessage(new MsgStatus(injector)); bolusingEvent.setPercent(100); - rxBus.send(new EventPumpStatusChanged(rh.gs(info.nightscout.interfaces.R.string.disconnecting))); + rxBus.send(new EventPumpStatusChanged(rh.gs(app.aaps.interfaces.R.string.disconnecting))); } }); return !start.getFailed(); diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index a5fd72ca69..18390be172 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -5,43 +5,43 @@ import androidx.annotation.NonNull; import org.json.JSONException; import org.json.JSONObject; +import app.aaps.interfaces.constraints.Constraint; +import app.aaps.interfaces.constraints.ConstraintsChecker; +import app.aaps.interfaces.constraints.PluginConstraints; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.plugin.ActivePlugin; +import app.aaps.interfaces.plugin.OwnDatabasePlugin; +import app.aaps.interfaces.plugin.PluginDescription; +import app.aaps.interfaces.plugin.PluginType; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.pump.Dana; +import app.aaps.interfaces.pump.Pump; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpPluginBase; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.defs.ManufacturerType; +import app.aaps.interfaces.pump.defs.PumpDescription; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventConfigBuilderChange; +import app.aaps.interfaces.rx.events.EventDismissNotification; +import app.aaps.interfaces.rx.events.EventPreferenceChange; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.DecimalFormatter; +import app.aaps.interfaces.utils.Round; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService; import info.nightscout.core.constraints.ConstraintObject; -import info.nightscout.interfaces.constraints.Constraint; -import info.nightscout.interfaces.constraints.ConstraintsChecker; -import info.nightscout.interfaces.constraints.PluginConstraints; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.plugin.ActivePlugin; -import info.nightscout.interfaces.plugin.OwnDatabasePlugin; -import info.nightscout.interfaces.plugin.PluginDescription; -import info.nightscout.interfaces.plugin.PluginType; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.pump.Dana; -import info.nightscout.interfaces.pump.Pump; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpPluginBase; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.defs.ManufacturerType; -import info.nightscout.interfaces.pump.defs.PumpDescription; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.ui.UiInteraction; -import info.nightscout.interfaces.utils.DecimalFormatter; -import info.nightscout.interfaces.utils.Round; import info.nightscout.pump.dana.DanaFragment; import info.nightscout.pump.dana.DanaPump; import info.nightscout.pump.dana.comm.RecordTypes; import info.nightscout.pump.dana.database.DanaHistoryDatabase; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventConfigBuilderChange; -import info.nightscout.rx.events.EventDismissNotification; -import info.nightscout.rx.events.EventPreferenceChange; -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 io.reactivex.rxjava3.disposables.CompositeDisposable; /** diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index 08c7f3ef72..4a27f95c01 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -12,33 +12,33 @@ import javax.inject.Inject; import javax.inject.Singleton; import app.aaps.annotations.OpenForTesting; +import app.aaps.interfaces.constraints.ConstraintsChecker; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.plugin.ActivePlugin; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventAppExit; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.rx.events.EventPreferenceChange; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.DecimalFormatter; +import app.aaps.interfaces.utils.Round; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.danar.services.DanaRExecutionService; import info.nightscout.core.constraints.ConstraintObject; import info.nightscout.core.utils.fabric.FabricPrivacy; -import info.nightscout.interfaces.constraints.ConstraintsChecker; -import info.nightscout.interfaces.plugin.ActivePlugin; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.ui.UiInteraction; -import info.nightscout.interfaces.utils.DecimalFormatter; -import info.nightscout.interfaces.utils.Round; import info.nightscout.pump.dana.DanaPump; import info.nightscout.pump.dana.database.DanaHistoryDatabase; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventAppExit; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.rx.events.EventPreferenceChange; -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; @Singleton @OpenForTesting diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/SerialIOThread.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/SerialIOThread.java index aad54d6163..39c83749e9 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/SerialIOThread.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/SerialIOThread.java @@ -9,12 +9,12 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.danar.comm.MessageBase; import info.nightscout.androidaps.danar.comm.MessageHashTableBase; import info.nightscout.androidaps.utils.CRC; import info.nightscout.pump.dana.DanaPump; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; /** * Created by mike on 17.07.2016. diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt index 785bc1c840..fe2b85537f 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt @@ -1,26 +1,26 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.comm.MessageOriginalNames.getName import info.nightscout.androidaps.utils.CRC.getCrc16 -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.database.DanaHistoryRecordDao -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.utils.DateUtil import org.joda.time.DateTime import org.joda.time.IllegalInstantException import java.nio.charset.StandardCharsets diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusProgress.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusProgress.kt index 160d39efbf..d9ea26a5d1 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusProgress.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusProgress.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.HasAndroidInjector -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.logging.LTag import kotlin.math.min class MsgBolusProgress( diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt index 9bbf49311a..8d3ed373e5 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.rx.logging.LTag class MsgBolusStart( injector: HasAndroidInjector, diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt index fd91ea5cec..58603e9a71 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.rx.logging.LTag class MsgBolusStartWithSpeed( injector: HasAndroidInjector, diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStop.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStop.kt index 1944c41420..07d240af58 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStop.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStop.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.HasAndroidInjector -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.logging.LTag class MsgBolusStop( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgCheckValue.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgCheckValue.kt index ccad02b8a9..ad62d80e75 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgCheckValue.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgCheckValue.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag - class MsgCheckValue( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgError.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgError.kt index 956f603085..ddf687378d 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgError.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgError.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.HasAndroidInjector -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.logging.LTag class MsgError( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAlarm.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAlarm.kt index 80489a8134..67fedba3d6 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAlarm.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAlarm.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryAlarm( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAll.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAll.kt index d13acf81f0..88b8f480bc 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAll.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAll.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.events.EventDanaRSyncStatus +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.pump.dana.comm.RecordTypes import info.nightscout.pump.dana.database.DanaHistoryRecord -import info.nightscout.rx.events.EventDanaRSyncStatus -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.T @Suppress("SpellCheckingInspection") open class MsgHistoryAll( diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAllDone.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAllDone.kt index 55529da66c..fdf73f8934 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAllDone.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAllDone.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryAllDone( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryBasalHour.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryBasalHour.kt index a8f0da1a20..fc0e88db23 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryBasalHour.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryBasalHour.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryBasalHour( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryBolus.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryBolus.kt index 3ba91a0a75..8f09052607 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryBolus.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryBolus.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryBolus( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryCarbo.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryCarbo.kt index 8613738b23..bd7b023c31 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryCarbo.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryCarbo.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryCarbo( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryDailyInsulin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryDailyInsulin.kt index 5f866146eb..0c870ec52a 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryDailyInsulin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryDailyInsulin.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryDailyInsulin( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryDone.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryDone.kt index 1945c0a8c5..f0c7fb4b70 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryDone.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryDone.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryDone( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryError.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryError.kt index 90a953adbd..aa30883fa3 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryError.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryError.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryError( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryGlucose.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryGlucose.kt index af08085807..228a5fb47b 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryGlucose.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryGlucose.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryGlucose( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryNew.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryNew.kt index 559665fe11..cd52628a32 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryNew.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryNew.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryNew( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryNewDone.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryNewDone.kt index 116b3e04f8..591698a3d6 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryNewDone.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryNewDone.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryNewDone( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryRefill.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryRefill.kt index d5c597c9ce..8a192d07a2 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryRefill.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryRefill.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistoryRefill( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistorySuspend.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistorySuspend.kt index f81704d36e..f7ce57e0a1 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistorySuspend.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistorySuspend.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgHistorySuspend( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusBasic.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusBasic.kt index c80c16cb69..e947f8b735 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusBasic.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusBasic.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag - class MsgInitConnStatusBasic( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusBolus.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusBolus.kt index c6c47f398d..afc3b757e5 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusBolus.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusBolus.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.LTag class MsgInitConnStatusBolus( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusOption.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusOption.kt index e557665183..43e9ec554c 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusOption.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusOption.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.LTag class MsgInitConnStatusOption( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusTime.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusTime.kt index 5125e7841f..75540ab191 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusTime.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusTime.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.rx.events.EventRebuildTabs import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.rx.events.EventRebuildTabs -import info.nightscout.rx.logging.LTag class MsgInitConnStatusTime( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgPCCommStart.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgPCCommStart.kt index c7a629c7d6..fbfdd1b956 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgPCCommStart.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgPCCommStart.kt @@ -1,10 +1,9 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - -class MsgPCCommStart constructor( +class MsgPCCommStart( injector: HasAndroidInjector ) : MessageBase(injector) { diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgPCCommStop.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgPCCommStop.kt index 40b08fc27b..09fcf6eff7 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgPCCommStop.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgPCCommStop.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgPCCommStop( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetActivateBasalProfile.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetActivateBasalProfile.kt index 399c5f2ffd..0a4a4ce2e7 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetActivateBasalProfile.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetActivateBasalProfile.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSetActivateBasalProfile( injector: HasAndroidInjector, diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetBasalProfile.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetBasalProfile.kt index c7630ec2d9..ea4aa7030e 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetBasalProfile.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetBasalProfile.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.logging.LTag class MsgSetBasalProfile( injector: HasAndroidInjector, diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetCarbsEntry.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetCarbsEntry.kt index 90e5334ab8..f96e85b908 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetCarbsEntry.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetCarbsEntry.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.dana.comm.RecordTypes -import info.nightscout.rx.logging.LTag import java.util.Calendar class MsgSetCarbsEntry( diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt index e91d4a1d8b..dd84ab27b1 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.rx.logging.LTag class MsgSetExtendedBolusStart( injector: HasAndroidInjector, diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStop.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStop.kt index 8423bc45c9..3a8df7de93 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStop.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStop.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSetExtendedBolusStop( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetSingleBasalProfile.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetSingleBasalProfile.kt index 01d4c9653a..8aa3bffe50 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetSingleBasalProfile.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetSingleBasalProfile.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.logging.LTag class MsgSetSingleBasalProfile( injector: HasAndroidInjector, diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTempBasalStart.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTempBasalStart.kt index 50499526ad..c8fb774334 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTempBasalStart.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTempBasalStart.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSetTempBasalStart( injector: HasAndroidInjector, diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTempBasalStop.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTempBasalStop.kt index 6e2951518d..12bb623a0f 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTempBasalStop.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTempBasalStop.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSetTempBasalStop( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTime.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTime.kt index bd98b2d6ae..2a9ffba49e 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTime.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetTime.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSetTime( injector: HasAndroidInjector, diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetUserOptions.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetUserOptions.kt index afde1356eb..3e9f1c2df2 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetUserOptions.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetUserOptions.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSetUserOptions( injector: HasAndroidInjector @@ -14,7 +13,7 @@ class MsgSetUserOptions( // No options set -> Exiting aapsLogger.debug(LTag.PUMPCOMM, "NO USER OPTIONS LOADED EXITING!") } else { - danaPump.userOptionsFromPump!![0] = if( danaPump.timeDisplayType24) 0.toByte() else 1.toByte() + danaPump.userOptionsFromPump!![0] = if (danaPump.timeDisplayType24) 0.toByte() else 1.toByte() danaPump.userOptionsFromPump!![1] = if (danaPump.buttonScrollOnOff) 1.toByte() else 0.toByte() danaPump.userOptionsFromPump!![2] = danaPump.beepAndAlarm.toByte() danaPump.userOptionsFromPump!![3] = danaPump.lcdOnTimeSec.toByte() diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingActiveProfile.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingActiveProfile.kt index ad3215983b..85e3ff7691 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingActiveProfile.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingActiveProfile.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSettingActiveProfile( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingBasal.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingBasal.kt index 2d3b90ab53..71b79d4b0a 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingBasal.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingBasal.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag import java.util.Locale class MsgSettingBasal( diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingBasalProfileAll.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingBasalProfileAll.kt index 36b610420e..c3e4e2621a 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingBasalProfileAll.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingBasalProfileAll.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag import java.util.Locale /** @@ -49,8 +49,9 @@ class MsgSettingBasalProfileAll( for (index in 0..23) { //this is absurd danaRPump.pumpProfiles[profile][index] returns nullPointerException aapsLogger.debug( LTag.PUMPCOMM, "Basal profile " + profile + ": " + String.format(Locale.ENGLISH, "%02d", index / 2) + - ":" + String.format(Locale.ENGLISH, "%02d", index % 2 * 30) + " : " + - danaPump.pumpProfiles!![profile][index]) + ":" + String.format(Locale.ENGLISH, "%02d", index % 2 * 30) + " : " + + danaPump.pumpProfiles!![profile][index] + ) } } } diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingGlucose.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingGlucose.kt index cf27919ffe..1fefa623be 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingGlucose.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingGlucose.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag - /** * Created by mike on 05.07.2016. diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingMaxValues.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingMaxValues.kt index 749ed9a9e4..785d046900 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingMaxValues.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingMaxValues.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSettingMaxValues( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingMeal.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingMeal.kt index 7ac39f00f5..3ed70320ce 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingMeal.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingMeal.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.LTag class MsgSettingMeal( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingProfileRatios.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingProfileRatios.kt index 0f230f6b4b..fe148bf69a 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingProfileRatios.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingProfileRatios.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag - class MsgSettingProfileRatios( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingProfileRatiosAll.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingProfileRatiosAll.kt index aa962c4916..2c0312476b 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingProfileRatiosAll.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingProfileRatiosAll.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag - class MsgSettingProfileRatiosAll( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingPumpTime.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingPumpTime.kt index 71f5517662..4483503041 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingPumpTime.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingPumpTime.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag import org.joda.time.DateTime import java.util.Date diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingShippingInfo.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingShippingInfo.kt index eaed028223..25e140d6e5 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingShippingInfo.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingShippingInfo.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSettingShippingInfo( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingUserOptions.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingUserOptions.kt index 5d61e76685..9412bb0009 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingUserOptions.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSettingUserOptions.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgSettingUserOptions( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatus.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatus.kt index 55941198a9..25b149e546 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatus.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatus.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgStatus( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBasic.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBasic.kt index 8320a7c03a..a43ef786e5 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBasic.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBasic.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.LTag - class MsgStatusBasic( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBolusExtended.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBolusExtended.kt index ad15de225f..111c47aada 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBolusExtended.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBolusExtended.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.shared.utils.T -import info.nightscout.rx.logging.LTag import kotlin.math.abs import kotlin.math.floor diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusProfile.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusProfile.kt index 9bbf0129e7..a9b7d1a0f4 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusProfile.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusProfile.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag - class MsgStatusProfile( injector: HasAndroidInjector diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusTempBasal.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusTempBasal.kt index 18496f9114..b5a82d03c0 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusTempBasal.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusTempBasal.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.danar.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.shared.utils.T -import info.nightscout.rx.logging.LTag import kotlin.math.abs import kotlin.math.floor diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java index 713396b5bb..7b08cf7cf5 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java @@ -20,6 +20,23 @@ import java.util.UUID; import javax.inject.Inject; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.plugin.ActivePlugin; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventAppExit; +import app.aaps.interfaces.rx.events.EventBTChange; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.rx.events.EventPumpStatusChanged; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.DateUtil; import dagger.android.DaggerService; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.danar.R; @@ -39,25 +56,8 @@ import info.nightscout.androidaps.danar.comm.MsgPCCommStart; import info.nightscout.androidaps.danar.comm.MsgPCCommStop; import info.nightscout.core.ui.toast.ToastUtils; import info.nightscout.core.utils.fabric.FabricPrivacy; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.plugin.ActivePlugin; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.ui.UiInteraction; import info.nightscout.pump.dana.DanaPump; import info.nightscout.pump.dana.comm.RecordTypes; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventAppExit; -import info.nightscout.rx.events.EventBTChange; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.rx.events.EventPumpStatusChanged; -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 io.reactivex.rxjava3.disposables.CompositeDisposable; /** diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java index a217949d9e..9b699e18f9 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java @@ -8,6 +8,21 @@ import java.io.IOException; import javax.inject.Inject; +import app.aaps.interfaces.configuration.Constants; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.profile.ProfileFunction; +import app.aaps.interfaces.pump.BolusProgressData; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.queue.Callback; +import app.aaps.interfaces.queue.Command; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.rx.events.EventInitializationChanged; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged; +import app.aaps.interfaces.rx.events.EventPumpStatusChanged; import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin; import info.nightscout.androidaps.danar.DanaRPlugin; import info.nightscout.androidaps.danar.SerialIOThread; @@ -39,22 +54,7 @@ import info.nightscout.androidaps.danar.comm.MsgStatus; import info.nightscout.androidaps.danar.comm.MsgStatusBasic; import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; -import info.nightscout.interfaces.Constants; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.profile.ProfileFunction; -import info.nightscout.interfaces.pump.BolusProgressData; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.queue.Callback; -import info.nightscout.interfaces.queue.Command; -import info.nightscout.interfaces.queue.CommandQueue; import info.nightscout.pump.dana.events.EventDanaRNewStatus; -import info.nightscout.rx.events.EventInitializationChanged; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.rx.events.EventProfileSwitchChanged; -import info.nightscout.rx.events.EventPumpStatusChanged; -import info.nightscout.rx.logging.LTag; public class DanaRExecutionService extends AbstractDanaRExecutionService { @Inject DanaRPlugin danaRPlugin; diff --git a/pump/danar/src/test/java/info/nightscout/pump/danaR/DanaRPluginTest.kt b/pump/danar/src/test/java/info/nightscout/pump/danaR/DanaRPluginTest.kt index 78d4cd7308..31569a16d5 100644 --- a/pump/danar/src/test/java/info/nightscout/pump/danaR/DanaRPluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/pump/danaR/DanaRPluginTest.kt @@ -1,16 +1,16 @@ package info.nightscout.pump.danaR +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.database.DanaHistoryDatabase import org.junit.jupiter.api.Assertions diff --git a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/DanaRTestBase.kt b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/DanaRTestBase.kt index 12b48c95f5..bbd18637da 100644 --- a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/DanaRTestBase.kt +++ b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/DanaRTestBase.kt @@ -1,5 +1,12 @@ package info.nightscout.pump.danaR.comm +import app.aaps.interfaces.configuration.ConfigBuilder +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector @@ -7,13 +14,6 @@ import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.database.DanaHistoryRecordDao import org.junit.jupiter.api.BeforeEach diff --git a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgBolusProgressTest.kt b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgBolusProgressTest.kt index 499e6a3a9d..a40a98a1eb 100644 --- a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgBolusProgressTest.kt +++ b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgBolusProgressTest.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.danaR.comm +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import info.nightscout.androidaps.danar.comm.MsgBolusProgress -import info.nightscout.rx.events.EventOverviewBolusProgress import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers diff --git a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgBolusStopTest.kt b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgBolusStopTest.kt index 434397e720..19b56949ef 100644 --- a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgBolusStopTest.kt +++ b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgBolusStopTest.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.danaR.comm +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import info.nightscout.androidaps.danar.comm.MsgBolusStop -import info.nightscout.rx.events.EventOverviewBolusProgress import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mockito.`when` diff --git a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgSettingBasalTest.kt b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgSettingBasalTest.kt index b42538b3a4..7fffee38d5 100644 --- a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgSettingBasalTest.kt +++ b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgSettingBasalTest.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.danaR.comm +import app.aaps.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.danar.comm.MsgSettingBasal -import info.nightscout.interfaces.pump.defs.PumpDescription import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mockito.`when` diff --git a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgStatusBolusExtendedTest.kt b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgStatusBolusExtendedTest.kt index d3f869a2f9..6c7b3c81ae 100644 --- a/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgStatusBolusExtendedTest.kt +++ b/pump/danar/src/test/java/info/nightscout/pump/danaR/comm/MsgStatusBolusExtendedTest.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.danaR.comm +import app.aaps.interfaces.utils.T import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended -import info.nightscout.shared.utils.T import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/pump/danar/src/test/java/info/nightscout/pump/danaRKorean/DanaRKoreanPluginTest.kt b/pump/danar/src/test/java/info/nightscout/pump/danaRKorean/DanaRKoreanPluginTest.kt index 9e10128c17..a3a5995322 100644 --- a/pump/danar/src/test/java/info/nightscout/pump/danaRKorean/DanaRKoreanPluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/pump/danaRKorean/DanaRKoreanPluginTest.kt @@ -1,16 +1,16 @@ package info.nightscout.pump.danaRKorean +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.database.DanaHistoryDatabase import org.junit.jupiter.api.Assertions diff --git a/pump/danar/src/test/java/info/nightscout/pump/danaRv2/DanaRv2PluginTest.kt b/pump/danar/src/test/java/info/nightscout/pump/danaRv2/DanaRv2PluginTest.kt index a52b0ce50f..e1012095a2 100644 --- a/pump/danar/src/test/java/info/nightscout/pump/danaRv2/DanaRv2PluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/pump/danaRv2/DanaRv2PluginTest.kt @@ -1,18 +1,18 @@ package info.nightscout.pump.danaRv2 +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.database.DanaHistoryDatabase import org.junit.jupiter.api.Assertions diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/DanaRSPlugin.kt index 04fb4c4012..de08a59fee 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/DanaRSPlugin.kt @@ -7,52 +7,52 @@ import android.content.ServiceConnection import android.os.IBinder import android.text.format.DateFormat import androidx.preference.Preference +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.OwnDatabasePlugin +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.Dana +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpPluginBase +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventConfigBuilderChange +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.OwnDatabasePlugin -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.Dana -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpPluginBase -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.Round import info.nightscout.pump.dana.DanaFragment import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.comm.RecordTypes import info.nightscout.pump.dana.database.DanaHistoryDatabase import info.nightscout.pump.danars.events.EventDanaRSDeviceChange import info.nightscout.pump.danars.services.DanaRSService -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventConfigBuilderChange -import info.nightscout.rx.events.EventDismissNotification -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 diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/BLEScanActivity.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/BLEScanActivity.kt index b3a1a9a1ee..250fab08bc 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/BLEScanActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/BLEScanActivity.kt @@ -20,16 +20,16 @@ import android.view.ViewGroup import android.widget.BaseAdapter import android.widget.TextView import androidx.core.app.ActivityCompat +import app.aaps.interfaces.pump.BlePreCheck +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.extensions.safeEnable -import info.nightscout.interfaces.pump.BlePreCheck import info.nightscout.pump.danars.R import info.nightscout.pump.danars.databinding.DanarsBlescannerActivityBinding import info.nightscout.pump.danars.events.EventDanaRSDeviceChange -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import java.util.regex.Pattern import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/EnterPinActivity.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/EnterPinActivity.kt index d642dc5f58..6a1cccc85d 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/activities/EnterPinActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/activities/EnterPinActivity.kt @@ -2,6 +2,11 @@ package info.nightscout.pump.danars.activities import android.os.Bundle import android.util.Base64 +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy @@ -11,11 +16,6 @@ import info.nightscout.core.validators.EditTextValidator import info.nightscout.pump.danars.DanaRSPlugin import info.nightscout.pump.danars.databinding.DanarsEnterPinActivityBinding import info.nightscout.pump.danars.services.BLEComm -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -54,7 +54,8 @@ class EnterPinActivity : TranslatedDaggerAppCompatActivity() { val result = checkPairingCheckSum( binding.rsV3Pin1.text.toString().hexStringToByteArray(), binding.rsV3Pin2.text.toString().substring(0..5).hexStringToByteArray(), - binding.rsV3Pin2.text.toString().substring(6..7).hexStringToByteArray()) + binding.rsV3Pin2.text.toString().substring(6..7).hexStringToByteArray() + ) if (result) { bleComm.finishV3Pairing() finish() diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacket.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacket.kt index d16bae5546..8fe8e21a7f 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacket.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacket.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.DateUtil import org.joda.time.DateTime import org.joda.time.IllegalInstantException import java.nio.charset.StandardCharsets diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSBasalSetTemporaryBasal.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSBasalSetTemporaryBasal.kt index 4c590edb45..866c863226 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSBasalSetTemporaryBasal.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSBasalSetTemporaryBasal.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketAPSBasalSetTemporaryBasal( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSHistoryEvents.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSHistoryEvents.kt index cbde42fe50..dac1a2be53 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSHistoryEvents.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSHistoryEvents.kt @@ -1,18 +1,19 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPumpStatusChanged -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 info.nightscout.pump.dana.R import org.joda.time.DateTime import org.joda.time.DateTimeZone import javax.inject.Inject @@ -286,7 +287,7 @@ open class DanaRSPacketAPSHistoryEvents( } DanaPump.HistoryEntry.REFILL -> { - if (sp.getBoolean(info.nightscout.pump.dana.R.string.key_rs_loginsulinchange, true)) { + if (sp.getBoolean(R.string.key_rs_loginsulinchange, true)) { val newRecord = pumpSync.insertTherapyEventIfNewWithTimestamp( timestamp = datetime, type = DetailedBolusInfo.EventType.INSULIN_CHANGE, @@ -334,7 +335,7 @@ open class DanaRSPacketAPSHistoryEvents( } DanaPump.HistoryEntry.PRIME_CANNULA -> { - if (sp.getBoolean(info.nightscout.pump.dana.R.string.key_rs_logcanulachange, true)) { + if (sp.getBoolean(R.string.key_rs_logcanulachange, true)) { val newRecord = pumpSync.insertTherapyEventIfNewWithTimestamp( timestamp = datetime, type = DetailedBolusInfo.EventType.CANNULA_CHANGE, @@ -368,7 +369,7 @@ open class DanaRSPacketAPSHistoryEvents( } } if (datetime > danaPump.lastEventTimeLoaded) danaPump.lastEventTimeLoaded = datetime - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.processinghistory) + ": " + status)) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.processinghistory) + ": " + status)) } override val friendlyName: String = "APS_HISTORY_EVENTS" diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSSetEventHistory.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSSetEventHistory.kt index 730eacfb28..471d8ba3ef 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSSetEventHistory.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketAPSSetEventHistory.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import org.joda.time.DateTime import org.joda.time.DateTimeZone import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalGetBasalRate.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalGetBasalRate.kt index d211c865c7..7b6a5717b9 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalGetBasalRate.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalGetBasalRate.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.notifications.Notification import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import java.util.Locale import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalGetProfileNumber.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalGetProfileNumber.kt index d1555b4dca..49df259a80 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalGetProfileNumber.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalGetProfileNumber.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketBasalGetProfileNumber( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetCancelTemporaryBasal.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetCancelTemporaryBasal.kt index 9cce3e4c8f..9fc4983d8f 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetCancelTemporaryBasal.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetCancelTemporaryBasal.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketBasalSetCancelTemporaryBasal( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetProfileBasalRate.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetProfileBasalRate.kt index 1e8a8df842..220df72f13 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetProfileBasalRate.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetProfileBasalRate.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketBasalSetProfileBasalRate( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetProfileNumber.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetProfileNumber.kt index 875dc7ab81..7f37a83f17 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetProfileNumber.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetProfileNumber.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketBasalSetProfileNumber( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetSuspendOff.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetSuspendOff.kt index 2efa50a43d..9d6ccff7bb 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetSuspendOff.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetSuspendOff.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketBasalSetSuspendOff( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetSuspendOn.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetSuspendOn.kt index b3fd3990d1..e8369f7dc0 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetSuspendOn.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetSuspendOn.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketBasalSetSuspendOn( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetTemporaryBasal.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetTemporaryBasal.kt index db8eb50675..271196860e 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetTemporaryBasal.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBasalSetTemporaryBasal.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag open class DanaRSPacketBasalSetTemporaryBasal( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGet24CIRCFArray.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGet24CIRCFArray.kt index e9e2fda10c..bef1fa45ee 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGet24CIRCFArray.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGet24CIRCFArray.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketBolusGet24CIRCFArray( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetBolusOption.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetBolusOption.kt index 19d630fedc..bc6883db2b 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetBolusOption.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetBolusOption.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.notifications.Notification import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class DanaRSPacketBolusGetBolusOption( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetCIRCFArray.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetCIRCFArray.kt index 875e3811bc..10e55b4f7a 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetCIRCFArray.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetCIRCFArray.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketBolusGetCIRCFArray( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetCalculationInformation.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetCalculationInformation.kt index d6115b38d8..043b262b0c 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetCalculationInformation.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetCalculationInformation.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketBolusGetCalculationInformation( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetStepBolusInformation.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetStepBolusInformation.kt index b8abf957b4..3c3015d20e 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetStepBolusInformation.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusGetStepBolusInformation.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import org.joda.time.DateTime import org.joda.time.DateTimeZone import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt index 24fc9f7407..a67d65d9a2 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileUtil import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.Profile import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil import javax.inject.Inject import kotlin.math.round diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetBolusOption.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetBolusOption.kt index 9464012b6b..672ba13dd0 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetBolusOption.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetBolusOption.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketBolusSetBolusOption( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetExtendedBolus.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetExtendedBolus.kt index d6142cc957..b269711184 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetExtendedBolus.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetExtendedBolus.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketBolusSetExtendedBolus( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetExtendedBolusCancel.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetExtendedBolusCancel.kt index 7ed67e7886..b77728b78b 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetExtendedBolusCancel.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetExtendedBolusCancel.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketBolusSetExtendedBolusCancel( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt index dc9874df49..f754e2c2bb 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt @@ -1,11 +1,11 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.ConstraintsChecker import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketBolusSetStepBolusStart( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetStepBolusStop.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetStepBolusStop.kt index 3741b8a160..0f86d02c0c 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetStepBolusStop.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketBolusSetStepBolusStop.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject open class DanaRSPacketBolusSetStepBolusStop( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketEtcKeepConnection.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketEtcKeepConnection.kt index b6b8368fa4..8f1f680239 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketEtcKeepConnection.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketEtcKeepConnection.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketEtcKeepConnection( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketEtcSetHistorySave.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketEtcSetHistorySave.kt index 04e2606dd6..d97283c385 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketEtcSetHistorySave.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketEtcSetHistorySave.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketEtcSetHistorySave( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetPumpCheck.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetPumpCheck.kt index bd3d2f8b61..21251d826f 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetPumpCheck.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetPumpCheck.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.notifications.Notification import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class DanaRSPacketGeneralGetPumpCheck( @@ -46,4 +46,4 @@ class DanaRSPacketGeneralGetPumpCheck( } override val friendlyName: String = "REVIEW__GET_PUMP_CHECK" - } \ No newline at end of file +} \ No newline at end of file diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetShippingInformation.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetShippingInformation.kt index b03c63a894..3ac23ba883 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetShippingInformation.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetShippingInformation.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketGeneralGetShippingInformation( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetShippingVersion.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetShippingVersion.kt index 2c91e07323..7be2fc83a4 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetShippingVersion.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetShippingVersion.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import java.nio.charset.Charset import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetUserTimeChangeFlag.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetUserTimeChangeFlag.kt index d1cb869034..14ac66cea3 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetUserTimeChangeFlag.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralGetUserTimeChangeFlag.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketGeneralGetUserTimeChangeFlag( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralInitialScreenInformation.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralInitialScreenInformation.kt index d847fda098..1bcbb14868 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralInitialScreenInformation.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralInitialScreenInformation.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject @Suppress("MemberVisibilityCanBePrivate") diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralSetHistoryUploadMode.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralSetHistoryUploadMode.kt index 54a552a9d6..8e5451ca12 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralSetHistoryUploadMode.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralSetHistoryUploadMode.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketGeneralSetHistoryUploadMode( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralSetUserTimeChangeFlagClear.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralSetUserTimeChangeFlagClear.kt index 890554ea89..9d7bcd64a5 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralSetUserTimeChangeFlagClear.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketGeneralSetUserTimeChangeFlagClear.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketGeneralSetUserTimeChangeFlagClear( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistory.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistory.kt index c05323ab2f..4911d48715 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistory.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistory.kt @@ -1,15 +1,15 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDanaRSyncStatus +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.PumpSync import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.dana.comm.RecordTypes import info.nightscout.pump.dana.database.DanaHistoryRecord import info.nightscout.pump.dana.database.DanaHistoryRecordDao -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDanaRSyncStatus -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.T import org.joda.time.DateTime import java.util.Calendar import java.util.GregorianCalendar diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryAlarm.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryAlarm.kt index fe4e66787d..d798b1a24d 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryAlarm.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryAlarm.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag -class DanaRSPacketHistoryAlarm constructor( +class DanaRSPacketHistoryAlarm( injector: HasAndroidInjector, from: Long = 0 ) : DanaRSPacketHistory(injector, from) { diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryAllHistory.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryAllHistory.kt index e47cd25edf..7a3f5ff58d 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryAllHistory.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryAllHistory.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketHistoryAllHistory( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBasal.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBasal.kt index d0d7fa62b2..7a30b5ce45 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBasal.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBasal.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag -class DanaRSPacketHistoryBasal constructor( +class DanaRSPacketHistoryBasal( injector: HasAndroidInjector, from: Long = 0 ) : DanaRSPacketHistory(injector, from) { diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBloodGlucose.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBloodGlucose.kt index c6deeea90d..c556a415b1 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBloodGlucose.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBloodGlucose.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag -class DanaRSPacketHistoryBloodGlucose constructor( +class DanaRSPacketHistoryBloodGlucose( injector: HasAndroidInjector, from: Long = 0 ) : DanaRSPacketHistory(injector, from) { diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBolus.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBolus.kt index 9752f9dd06..56eacde2c6 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBolus.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryBolus.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketHistoryBolus( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryCarbohydrate.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryCarbohydrate.kt index bb4904d053..44d93da814 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryCarbohydrate.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryCarbohydrate.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag -class DanaRSPacketHistoryCarbohydrate constructor( +class DanaRSPacketHistoryCarbohydrate( injector: HasAndroidInjector, from: Long = 0 ) : DanaRSPacketHistory(injector, from) { diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryDaily.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryDaily.kt index e3aad31af2..95a9c779b1 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryDaily.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryDaily.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag -class DanaRSPacketHistoryDaily constructor( +class DanaRSPacketHistoryDaily( injector: HasAndroidInjector, from: Long = 0 ) : DanaRSPacketHistory(injector, from) { diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryPrime.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryPrime.kt index 1c393f2c04..697e4957e2 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryPrime.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryPrime.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag -class DanaRSPacketHistoryPrime constructor( +class DanaRSPacketHistoryPrime( injector: HasAndroidInjector, from: Long = 0 ) : DanaRSPacketHistory(injector, from) { diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryRefill.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryRefill.kt index 7b4331220d..033a44b192 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryRefill.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryRefill.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag -class DanaRSPacketHistoryRefill constructor( +class DanaRSPacketHistoryRefill( injector: HasAndroidInjector, from: Long = 0 ) : DanaRSPacketHistory(injector, from) { diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistorySuspend.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistorySuspend.kt index c89cdb3606..f0d12734b3 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistorySuspend.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistorySuspend.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag -class DanaRSPacketHistorySuspend constructor( +class DanaRSPacketHistorySuspend( injector: HasAndroidInjector, from: Long = 0 ) : DanaRSPacketHistory(injector, from) { diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryTemporary.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryTemporary.kt index 8dc7e35c59..385b6d25b1 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryTemporary.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketHistoryTemporary.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketHistoryTemporary( injector: HasAndroidInjector, diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyAlarm.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyAlarm.kt index 811a47bf72..f07dd76c69 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyAlarm.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyAlarm.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpSync import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class DanaRSPacketNotifyAlarm( @@ -31,28 +31,40 @@ class DanaRSPacketNotifyAlarm( when (alarmCode) { 0x01 -> // Battery 0% Alarm errorString = rh.gs(info.nightscout.pump.dana.R.string.batterydischarged) + 0x02 -> // Pump Error errorString = rh.gs(info.nightscout.pump.dana.R.string.pumperror) + " " + alarmCode + 0x03 -> // Occlusion errorString = rh.gs(info.nightscout.pump.dana.R.string.occlusion) + 0x04 -> // LOW BATTERY errorString = rh.gs(info.nightscout.pump.dana.R.string.pumpshutdown) + 0x05 -> // Shutdown errorString = rh.gs(info.nightscout.pump.dana.R.string.lowbattery) + 0x06 -> // Basal Compare errorString = rh.gs(info.nightscout.pump.dana.R.string.basalcompare) + 0x07, 0xFF -> // Blood sugar measurement alert errorString = rh.gs(info.nightscout.pump.dana.R.string.bloodsugarmeasurementalert) + 0x08, 0xFE -> // Remaining insulin level errorString = rh.gs(info.nightscout.pump.dana.R.string.remaininsulinalert) + 0x09 -> // Empty Reservoir errorString = rh.gs(info.nightscout.pump.dana.R.string.emptyreservoir) + 0x0A -> // Check shaft errorString = rh.gs(info.nightscout.pump.dana.R.string.checkshaft) + 0x0B -> // Basal MAX errorString = rh.gs(info.nightscout.pump.dana.R.string.basalmax) + 0x0C -> // Daily MAX errorString = rh.gs(info.nightscout.pump.dana.R.string.dailymax) + 0xFD -> // Blood sugar check miss alarm errorString = rh.gs(info.nightscout.pump.dana.R.string.missedbolus) } diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt index 9dd8406987..ce3fe482eb 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import kotlin.math.min diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt index d9d8aa7f6a..d4c494b8f7 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import kotlin.math.min diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyMissedBolusAlarm.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyMissedBolusAlarm.kt index dea53e645a..3635f76bae 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyMissedBolusAlarm.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyMissedBolusAlarm.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketNotifyMissedBolusAlarm( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetPumpTime.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetPumpTime.kt index ef38b282a9..4687d4388c 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetPumpTime.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetPumpTime.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import org.joda.time.DateTime import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetPumpUTCAndTimeZone.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetPumpUTCAndTimeZone.kt index dd549e0152..6025c23e00 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetPumpUTCAndTimeZone.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetPumpUTCAndTimeZone.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import org.joda.time.DateTime import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetUserOption.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetUserOption.kt index d1be033cbe..10595cf706 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetUserOption.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionGetUserOption.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketOptionGetUserOption( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetPumpTime.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetPumpTime.kt index 94ab1cad0f..38e29c0979 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetPumpTime.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetPumpTime.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag import org.joda.time.DateTime class DanaRSPacketOptionSetPumpTime( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetPumpUTCAndTimeZone.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetPumpUTCAndTimeZone.kt index 4edbc87f80..f6f27c60a2 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetPumpUTCAndTimeZone.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetPumpUTCAndTimeZone.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag import org.joda.time.DateTime import org.joda.time.DateTimeZone diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetUserOption.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetUserOption.kt index bf54a9b32e..a8c6e68635 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetUserOption.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketOptionSetUserOption.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketOptionSetUserOption( @@ -30,7 +30,8 @@ class DanaRSPacketOptionSetUserOption( + "\nlowReservoir:" + danaPump.lowReservoirRate + "\ncannulaVolume:" + danaPump.cannulaVolume + "\nrefillAmount:" + danaPump.refillAmount - + "\ntarget:" + danaPump.target) + + "\ntarget:" + danaPump.target + ) val size = if (danaPump.hwModel >= 7) 15 else 13 val request = ByteArray(size) request[0] = if (danaPump.timeDisplayType24) 0.toByte() else 1.toByte() diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketReviewBolusAvg.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketReviewBolusAvg.kt index 5e51119c74..a35c5d9855 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketReviewBolusAvg.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketReviewBolusAvg.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.rx.logging.LTag class DanaRSPacketReviewBolusAvg( injector: HasAndroidInjector diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketReviewGetPumpDecRatio.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketReviewGetPumpDecRatio.kt index 37faf51a9f..c6a426ccf3 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketReviewGetPumpDecRatio.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/comm/DanaRSPacketReviewGetPumpDecRatio.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.pump.dana.DanaPump -import info.nightscout.rx.logging.LTag import javax.inject.Inject class DanaRSPacketReviewGetPumpDecRatio( diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/dialogs/PairingProgressDialog.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/dialogs/PairingProgressDialog.kt index 51d00909eb..6e1c5c2d6e 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/dialogs/PairingProgressDialog.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/dialogs/PairingProgressDialog.kt @@ -9,14 +9,14 @@ import android.view.View import android.view.ViewGroup import android.view.Window import android.view.WindowManager +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.support.DaggerDialogFragment import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.pump.danars.activities.PairingHelperActivity import info.nightscout.pump.danars.databinding.DanarsPairingProgressDialogBinding import info.nightscout.pump.danars.events.EventDanaRSPairingSuccess -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/events/EventDanaRSDeviceChange.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/events/EventDanaRSDeviceChange.kt index 1474abc6b3..dd8de66e6e 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/events/EventDanaRSDeviceChange.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/events/EventDanaRSDeviceChange.kt @@ -1,5 +1,5 @@ package info.nightscout.pump.danars.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventDanaRSDeviceChange : Event() \ No newline at end of file diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/events/EventDanaRSPairingSuccess.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/events/EventDanaRSPairingSuccess.kt index b0b6cc95c3..538c112828 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/events/EventDanaRSPairingSuccess.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/events/EventDanaRSPairingSuccess.kt @@ -1,5 +1,5 @@ package info.nightscout.pump.danars.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventDanaRSPairingSuccess : Event() diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/services/BLEComm.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/services/BLEComm.kt index 3cda6682bc..6c3a7391a7 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/services/BLEComm.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/services/BLEComm.kt @@ -18,15 +18,25 @@ import android.os.Build import android.os.SystemClock import android.util.Base64 import androidx.core.app.ActivityCompat +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.notifyAll import info.nightscout.core.utils.waitMillis -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump +import info.nightscout.pump.dana.R import info.nightscout.pump.danars.activities.EnterPinActivity import info.nightscout.pump.danars.activities.PairingHelperActivity import info.nightscout.pump.danars.comm.DanaRSMessageHashTable @@ -34,15 +44,6 @@ import info.nightscout.pump.danars.comm.DanaRSPacket import info.nightscout.pump.danars.comm.DanaRSPacketEtcKeepConnection import info.nightscout.pump.danars.encryption.EncryptionType import info.nightscout.pump.danars.events.EventDanaRSPairingSuccess -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventPumpStatusChanged -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 java.util.UUID import java.util.concurrent.ScheduledFuture import javax.inject.Inject @@ -163,30 +164,30 @@ class BLEComm @Inject internal constructor( if (!encryptedDataRead && encryptedCommandSent && encryption == EncryptionType.ENCRYPTION_BLE5) { // there was no response from pump after started encryption // assume pairing keys are invalid - val lastClearRequest = sp.getLong(info.nightscout.pump.dana.R.string.key_rs_last_clear_key_request, 0) + val lastClearRequest = sp.getLong(R.string.key_rs_last_clear_key_request, 0) if (lastClearRequest != 0L && dateUtil.isOlderThan(lastClearRequest, 5)) { - ToastUtils.errorToast(context, info.nightscout.pump.dana.R.string.invalidpairing) + ToastUtils.errorToast(context, R.string.invalidpairing) danaRSPlugin.changePump() removeBond() } else if (lastClearRequest == 0L) { aapsLogger.error("Clearing pairing keys postponed") - sp.putLong(info.nightscout.pump.dana.R.string.key_rs_last_clear_key_request, dateUtil.now()) + sp.putLong(R.string.key_rs_last_clear_key_request, dateUtil.now()) } } if (!encryptedDataRead && encryptedCommandSent && encryption == EncryptionType.ENCRYPTION_RSv3) { // there was no response from pump after started encryption // assume pairing keys are invalid - val lastClearRequest = sp.getLong(info.nightscout.pump.dana.R.string.key_rs_last_clear_key_request, 0) + val lastClearRequest = sp.getLong(R.string.key_rs_last_clear_key_request, 0) if (lastClearRequest != 0L && dateUtil.isOlderThan(lastClearRequest, 5)) { aapsLogger.error("Clearing pairing keys !!!") - sp.remove(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_randompairingkey) + danaRSPlugin.mDeviceName) - sp.remove(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_pairingkey) + danaRSPlugin.mDeviceName) - sp.remove(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_randomsynckey) + danaRSPlugin.mDeviceName) - ToastUtils.errorToast(context, info.nightscout.pump.dana.R.string.invalidpairing) + sp.remove(rh.gs(R.string.key_danars_v3_randompairingkey) + danaRSPlugin.mDeviceName) + sp.remove(rh.gs(R.string.key_danars_v3_pairingkey) + danaRSPlugin.mDeviceName) + sp.remove(rh.gs(R.string.key_danars_v3_randomsynckey) + danaRSPlugin.mDeviceName) + ToastUtils.errorToast(context, R.string.invalidpairing) danaRSPlugin.changePump() } else if (lastClearRequest == 0L) { aapsLogger.error("Clearing pairing keys postponed") - sp.putLong(info.nightscout.pump.dana.R.string.key_rs_last_clear_key_request, dateUtil.now()) + sp.putLong(R.string.key_rs_last_clear_key_request, dateUtil.now()) } } // cancel previous scheduled disconnection to prevent closing upcoming connection @@ -207,7 +208,7 @@ class BLEComm @Inject internal constructor( } private fun removeBond() { - sp.getStringOrNull(info.nightscout.pump.dana.R.string.key_danars_address, null)?.let { address -> + sp.getStringOrNull(R.string.key_danars_address, null)?.let { address -> bluetoothAdapter?.getRemoteDevice(address)?.let { device -> try { device::class.java.getMethod("removeBond").invoke(device) @@ -399,7 +400,7 @@ class BLEComm @Inject internal constructor( if (isConnected && (encryption == EncryptionType.ENCRYPTION_RSv3 || encryption == EncryptionType.ENCRYPTION_BLE5)) bleEncryption.decryptSecondLevelPacket(receivedData).also { encryptedDataRead = true - sp.putLong(info.nightscout.pump.dana.R.string.key_rs_last_clear_key_request, 0L) + sp.putLong(R.string.key_rs_last_clear_key_request, 0L) } else receivedData addToReadBuffer(incomingBuffer) @@ -513,7 +514,7 @@ class BLEComm @Inject internal constructor( private fun sendConnect() { val deviceName = connectDeviceName if (deviceName == null || deviceName == "") { - uiInteraction.addNotification(Notification.DEVICE_NOT_PAIRED, rh.gs(info.nightscout.pump.dana.R.string.pairfirst), Notification.URGENT) + uiInteraction.addNotification(Notification.DEVICE_NOT_PAIRED, rh.gs(R.string.pairfirst), Notification.URGENT) return } val bytes = bleEncryption.getEncryptedPacket(BleEncryption.DANAR_PACKET__OPCODE_ENCRYPTION__PUMP_CHECK, null, deviceName) @@ -529,7 +530,7 @@ class BLEComm @Inject internal constructor( encryption = EncryptionType.ENCRYPTION_DEFAULT danaPump.ignoreUserPassword = false // Grab pairing key from preferences if exists - val pairingKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_pairingkey) + danaRSPlugin.mDeviceName, "") + val pairingKey = sp.getString(rh.gs(R.string.key_danars_pairingkey) + danaRSPlugin.mDeviceName, "") aapsLogger.debug(LTag.PUMPBTCOMM, "Using stored pairing key: $pairingKey") if (pairingKey.isNotEmpty()) { sendPasskeyCheck(pairingKey) @@ -545,7 +546,7 @@ class BLEComm @Inject internal constructor( danaPump.hwModel = decryptedBuffer[5].toInt() danaPump.protocol = decryptedBuffer[7].toInt() // grab randomSyncKey - sp.putString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_randomsynckey) + danaRSPlugin.mDeviceName, String.format("%02x", decryptedBuffer[decryptedBuffer.size - 1])) + sp.putString(rh.gs(R.string.key_danars_v3_randomsynckey) + danaRSPlugin.mDeviceName, String.format("%02x", decryptedBuffer[decryptedBuffer.size - 1])) if (danaPump.hwModel == 0x05) { aapsLogger.debug(LTag.PUMPBTCOMM, "<<<<< " + "ENCRYPTION__PUMP_CHECK V3 (OK)" + " " + DanaRSPacket.toHexString(decryptedBuffer)) @@ -565,9 +566,9 @@ class BLEComm @Inject internal constructor( danaPump.protocol = decryptedBuffer[7].toInt() val pairingKey = DanaRSPacket.asciiStringFromBuff(decryptedBuffer, 8, 6) // used while bonding if (decryptedBuffer[8] != 0.toByte()) - sp.putString(rh.gs(info.nightscout.pump.dana.R.string.key_dana_ble5_pairingkey) + danaRSPlugin.mDeviceName, pairingKey) + sp.putString(rh.gs(R.string.key_dana_ble5_pairingkey) + danaRSPlugin.mDeviceName, pairingKey) - val storedPairingKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_dana_ble5_pairingkey) + danaRSPlugin.mDeviceName, "") + val storedPairingKey = sp.getString(rh.gs(R.string.key_dana_ble5_pairingkey) + danaRSPlugin.mDeviceName, "") if (storedPairingKey.isBlank()) { removeBond() disconnect("Non existing pairing key") @@ -583,9 +584,9 @@ class BLEComm @Inject internal constructor( } else if (decryptedBuffer.size == 6 && decryptedBuffer[2] == 'P'.code.toByte() && decryptedBuffer[3] == 'U'.code.toByte() && decryptedBuffer[4] == 'M'.code.toByte() && decryptedBuffer[5] == 'P'.code.toByte()) { aapsLogger.debug(LTag.PUMPBTCOMM, "<<<<< " + "ENCRYPTION__PUMP_CHECK (PUMP)" + " " + DanaRSPacket.toHexString(decryptedBuffer)) mSendQueue.clear() - rxBus.send(EventPumpStatusChanged(EventPumpStatusChanged.Status.DISCONNECTED, rh.gs(info.nightscout.pump.dana.R.string.pumperror))) - pumpSync.insertAnnouncement(rh.gs(info.nightscout.pump.dana.R.string.pumperror), null, danaPump.pumpType(), danaPump.serialNumber) - uiInteraction.addNotification(Notification.PUMP_ERROR, rh.gs(info.nightscout.pump.dana.R.string.pumperror), Notification.URGENT) + rxBus.send(EventPumpStatusChanged(EventPumpStatusChanged.Status.DISCONNECTED, rh.gs(R.string.pumperror))) + pumpSync.insertAnnouncement(rh.gs(R.string.pumperror), null, danaPump.pumpType(), danaPump.serialNumber) + uiInteraction.addNotification(Notification.PUMP_ERROR, rh.gs(R.string.pumperror), Notification.URGENT) // response BUSY: error status } else if (decryptedBuffer.size == 6 && decryptedBuffer[2] == 'B'.code.toByte() && decryptedBuffer[3] == 'U'.code.toByte() && decryptedBuffer[4] == 'S'.code.toByte() && decryptedBuffer[5] == 'Y'.code.toByte()) { aapsLogger.debug(LTag.PUMPBTCOMM, "<<<<< " + "ENCRYPTION__PUMP_CHECK (BUSY)" + " " + DanaRSPacket.toHexString(decryptedBuffer)) @@ -621,13 +622,13 @@ class BLEComm @Inject internal constructor( // 2nd packet v3 // 0x00 Start encryption, 0x01 Request pairing private fun sendV3PairingInformation() { - val randomPairingKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_randompairingkey) + danaRSPlugin.mDeviceName, "") - val pairingKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_pairingkey) + danaRSPlugin.mDeviceName, "") + val randomPairingKey = sp.getString(rh.gs(R.string.key_danars_v3_randompairingkey) + danaRSPlugin.mDeviceName, "") + val pairingKey = sp.getString(rh.gs(R.string.key_danars_v3_pairingkey) + danaRSPlugin.mDeviceName, "") if (randomPairingKey.isNotEmpty() && pairingKey.isNotEmpty()) { val tPairingKey = Base64.decode(pairingKey, Base64.DEFAULT) val tRandomPairingKey = Base64.decode(randomPairingKey, Base64.DEFAULT) var tRandomSyncKey: Byte = 0 - val randomSyncKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_randomsynckey) + danaRSPlugin.mDeviceName, "") + val randomSyncKey = sp.getString(rh.gs(R.string.key_danars_v3_randomsynckey) + danaRSPlugin.mDeviceName, "") if (randomSyncKey.isNotEmpty()) { tRandomSyncKey = randomSyncKey.toInt(16).toByte() } @@ -663,8 +664,8 @@ class BLEComm @Inject internal constructor( } else if (encryption == EncryptionType.ENCRYPTION_RSv3) { // decryptedBuffer[2] : 0x00 OK 0x01 Error, No pairing if (decryptedBuffer[2] == 0x00.toByte()) { - val randomPairingKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_randompairingkey) + danaRSPlugin.mDeviceName, "") - val pairingKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_pairingkey) + danaRSPlugin.mDeviceName, "") + val randomPairingKey = sp.getString(rh.gs(R.string.key_danars_v3_randompairingkey) + danaRSPlugin.mDeviceName, "") + val pairingKey = sp.getString(rh.gs(R.string.key_danars_v3_pairingkey) + danaRSPlugin.mDeviceName, "") if (randomPairingKey.isNotEmpty() && pairingKey.isNotEmpty()) { // expecting successful connect isConnected = true @@ -687,7 +688,7 @@ class BLEComm @Inject internal constructor( aapsLogger.debug(LTag.PUMPBTCOMM, "Pump user password: " + danaPump.rsPassword) if (!danaPump.isRSPasswordOK) { aapsLogger.error(LTag.PUMPBTCOMM, "Wrong pump password") - uiInteraction.addNotification(Notification.WRONG_PUMP_PASSWORD, rh.gs(info.nightscout.pump.dana.R.string.wrongpumppassword), Notification.URGENT) + uiInteraction.addNotification(Notification.WRONG_PUMP_PASSWORD, rh.gs(R.string.wrongpumppassword), Notification.URGENT) disconnect("WrongPassword") SystemClock.sleep(T.mins(1).msecs()) } else { @@ -719,8 +720,8 @@ class BLEComm @Inject internal constructor( // 3rd packet v3 : only after entering PIN codes fun finishV3Pairing() { - val randomPairingKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_randompairingkey) + danaRSPlugin.mDeviceName, "") - val pairingKey = sp.getString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_v3_pairingkey) + danaRSPlugin.mDeviceName, "") + val randomPairingKey = sp.getString(rh.gs(R.string.key_danars_v3_randompairingkey) + danaRSPlugin.mDeviceName, "") + val pairingKey = sp.getString(rh.gs(R.string.key_danars_v3_pairingkey) + danaRSPlugin.mDeviceName, "") if (randomPairingKey.isNotEmpty() && pairingKey.isNotEmpty()) { val tPairingKey = Base64.decode(pairingKey, Base64.DEFAULT) val tRandomPairingKey = Base64.decode(randomPairingKey, Base64.DEFAULT) @@ -746,7 +747,7 @@ class BLEComm @Inject internal constructor( sendTimeInfo() val pairingKey = byteArrayOf(decryptedBuffer[2], decryptedBuffer[3]) // store pairing key to preferences - sp.putString(rh.gs(info.nightscout.pump.dana.R.string.key_danars_pairingkey) + danaRSPlugin.mDeviceName, DanaRSPacket.bytesToHex(pairingKey)) + sp.putString(rh.gs(R.string.key_danars_pairingkey) + danaRSPlugin.mDeviceName, DanaRSPacket.bytesToHex(pairingKey)) aapsLogger.debug(LTag.PUMPBTCOMM, "Got pairing key: " + DanaRSPacket.bytesToHex(pairingKey)) } diff --git a/pump/danars/src/main/java/info/nightscout/pump/danars/services/DanaRSService.kt b/pump/danars/src/main/java/info/nightscout/pump/danars/services/DanaRSService.kt index e2e2d8a869..cfe1dfad54 100644 --- a/pump/danars/src/main/java/info/nightscout/pump/danars/services/DanaRSService.kt +++ b/pump/danars/src/main/java/info/nightscout/pump/danars/services/DanaRSService.kt @@ -6,23 +6,37 @@ import android.content.Intent import android.os.Binder import android.os.IBinder import android.os.SystemClock +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.BolusProgressData +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventInitializationChanged +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.BolusProgressData -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump +import info.nightscout.pump.dana.R import info.nightscout.pump.dana.comm.RecordTypes import info.nightscout.pump.dana.events.EventDanaRNewStatus import info.nightscout.pump.danars.DanaRSPlugin @@ -67,19 +81,6 @@ import info.nightscout.pump.danars.comm.DanaRSPacketOptionGetUserOption import info.nightscout.pump.danars.comm.DanaRSPacketOptionSetPumpTime import info.nightscout.pump.danars.comm.DanaRSPacketOptionSetPumpUTCAndTimeZone import info.nightscout.pump.danars.comm.DanaRSPacketOptionSetUserOption -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventInitializationChanged -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventProfileSwitchChanged -import info.nightscout.rx.events.EventPumpStatusChanged -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.joda.time.DateTime @@ -152,7 +153,7 @@ class DanaRSService : DaggerService() { fun readPumpStatus() { try { val pump = activePlugin.activePump - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.gettingpumpsettings))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingpumpsettings))) sendMessage(DanaRSPacketEtcKeepConnection(injector)) // test encryption for v3 & BLE if (!bleComm.isConnected) return sendMessage(DanaRSPacketGeneralGetShippingInformation(injector)) // serial no @@ -164,19 +165,19 @@ class DanaRSService : DaggerService() { if (danaPump.profile24) sendMessage(DanaRSPacketBolusGet24CIRCFArray(injector)) else sendMessage(DanaRSPacketBolusGetCIRCFArray(injector)) sendMessage(DanaRSPacketOptionGetUserOption(injector)) // Getting user options - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.gettingpumpstatus))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingpumpstatus))) sendMessage(DanaRSPacketGeneralInitialScreenInformation(injector)) - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.gettingbolusstatus))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingbolusstatus))) sendMessage(DanaRSPacketBolusGetStepBolusInformation(injector)) // last bolus, bolusStep, maxBolus danaPump.lastConnection = System.currentTimeMillis() val profile = profileFunction.getProfile() if (profile != null && abs(danaPump.currentBasal - profile.getBasal()) >= pump.pumpDescription.basalStep) { - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.gettingpumpsettings))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingpumpsettings))) if (!pump.isThisProfileSet(profile) && !commandQueue.isRunning(Command.CommandType.BASAL_PROFILE)) { rxBus.send(EventProfileSwitchChanged()) } } - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.gettingpumptime))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingpumptime))) if (danaPump.usingUTC) sendMessage(DanaRSPacketOptionGetPumpUTCAndTimeZone(injector)) else sendMessage(DanaRSPacketOptionGetPumpTime(injector)) var timeDiff = (danaPump.getPumpTime() - System.currentTimeMillis()) / 1000L @@ -198,7 +199,7 @@ class DanaRSService : DaggerService() { if (abs(timeDiff) > 60 * 60 * 1.5) { aapsLogger.debug(LTag.PUMPCOMM, "Pump time difference: $timeDiff seconds - large difference") //If time-diff is very large, warn user until we can synchronize history readings properly - uiInteraction.runAlarm(rh.gs(info.nightscout.pump.dana.R.string.largetimediff), rh.gs(info.nightscout.pump.dana.R.string.largetimedifftitle), info.nightscout.core.ui.R.raw.error) + uiInteraction.runAlarm(rh.gs(R.string.largetimediff), rh.gs(R.string.largetimedifftitle), info.nightscout.core.ui.R.raw.error) //de-initialize pump danaPump.reset() @@ -239,9 +240,9 @@ class DanaRSService : DaggerService() { if (danaPump.dailyTotalUnits > danaPump.maxDailyTotalUnits * Constants.dailyLimitWarning) { aapsLogger.debug(LTag.PUMPCOMM, "Approaching daily limit: " + danaPump.dailyTotalUnits + "/" + danaPump.maxDailyTotalUnits) if (System.currentTimeMillis() > lastApproachingDailyLimit + 30 * 60 * 1000) { - uiInteraction.addNotification(Notification.APPROACHING_DAILY_LIMIT, rh.gs(info.nightscout.pump.dana.R.string.approachingdailylimit), Notification.URGENT) + uiInteraction.addNotification(Notification.APPROACHING_DAILY_LIMIT, rh.gs(R.string.approachingdailylimit), Notification.URGENT) pumpSync.insertAnnouncement( - rh.gs(info.nightscout.pump.dana.R.string.approachingdailylimit) + ": " + danaPump.dailyTotalUnits + "/" + danaPump.maxDailyTotalUnits + "U", + rh.gs(R.string.approachingdailylimit) + ": " + danaPump.dailyTotalUnits + "/" + danaPump.maxDailyTotalUnits + "U", null, danaPump.pumpType(), danaPump.serialNumber @@ -270,7 +271,7 @@ class DanaRSService : DaggerService() { } danaPump.readHistoryFrom = if (danaPump.lastEventTimeLoaded != 0L) danaPump.lastEventTimeLoaded - T.mins(1).msecs() else 0 aapsLogger.debug(LTag.PUMPCOMM, "Events loaded") - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.gettingpumpstatus))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingpumpstatus))) sendMessage(DanaRSPacketGeneralInitialScreenInformation(injector)) danaPump.lastConnection = System.currentTimeMillis() return PumpEnactResult(injector).success(msg.success()) @@ -285,8 +286,8 @@ class DanaRSService : DaggerService() { fun bolus(insulin: Double, carbs: Int, carbTime: Long, t: EventOverviewBolusProgress.Treatment): Boolean { if (!isConnected) return false if (BolusProgressData.stopPressed) return false - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.startingbolus))) - val preferencesSpeed = sp.getInt(info.nightscout.pump.dana.R.string.key_danars_bolusspeed, 0) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.startingbolus))) + val preferencesSpeed = sp.getInt(R.string.key_danars_bolusspeed, 0) danaPump.bolusDone = false danaPump.bolusingTreatment = t danaPump.bolusAmountToBeDelivered = insulin @@ -301,7 +302,7 @@ class DanaRSService : DaggerService() { sendMessage(msgSetHistoryEntryV2) danaPump.readHistoryFrom = min(danaPump.readHistoryFrom, carbTime - T.mins(1).msecs()) if (!msgSetHistoryEntryV2.isReceived || msgSetHistoryEntryV2.failed) - uiInteraction.runAlarm(rh.gs(info.nightscout.pump.dana.R.string.carbs_store_error), rh.gs(info.nightscout.core.ui.R.string.error), info.nightscout.core.ui.R.raw.boluserror) + uiInteraction.runAlarm(rh.gs(R.string.carbs_store_error), rh.gs(info.nightscout.core.ui.R.string.error), info.nightscout.core.ui.R.raw.boluserror) } val bolusStart = System.currentTimeMillis() if (insulin > 0) { @@ -335,7 +336,7 @@ class DanaRSService : DaggerService() { val expectedEnd = bolusStart + bolusDurationInMSec + 2000 while (System.currentTimeMillis() < expectedEnd) { val waitTime = expectedEnd - System.currentTimeMillis() - bolusingEvent.status = rh.gs(info.nightscout.pump.dana.R.string.waitingforestimatedbolusend, waitTime / 1000) + bolusingEvent.status = rh.gs(R.string.waitingforestimatedbolusend, waitTime / 1000) rxBus.send(bolusingEvent) SystemClock.sleep(1000) } @@ -343,10 +344,10 @@ class DanaRSService : DaggerService() { commandQueue.loadEvents(object : Callback() { override fun run() { // reread bolus status - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.gettingbolusstatus))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingbolusstatus))) sendMessage(DanaRSPacketBolusGetStepBolusInformation(injector)) // last bolus bolusingEvent.percent = 100 - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.interfaces.R.string.disconnecting))) + rxBus.send(EventPumpStatusChanged(rh.gs(app.aaps.interfaces.R.string.disconnecting))) } }) return !start.failed @@ -373,11 +374,11 @@ class DanaRSService : DaggerService() { sendMessage(status) if (status.failed) return false if (status.isTempBasalInProgress) { - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.stoppingtempbasal))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.stoppingtempbasal))) sendMessage(DanaRSPacketBasalSetCancelTemporaryBasal(injector)) SystemClock.sleep(500) } - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.settingtempbasal))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.settingtempbasal))) val msgTBR = DanaRSPacketBasalSetTemporaryBasal(injector, percent, durationInHours) sendMessage(msgTBR) SystemClock.sleep(200) @@ -394,11 +395,11 @@ class DanaRSService : DaggerService() { sendMessage(status) if (status.failed) return false if (status.isTempBasalInProgress) { - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.stoppingtempbasal))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.stoppingtempbasal))) sendMessage(DanaRSPacketBasalSetCancelTemporaryBasal(injector)) SystemClock.sleep(500) } - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.settingtempbasal))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.settingtempbasal))) val msgTBR = DanaRSPacketAPSBasalSetTemporaryBasal(injector, percent) sendMessage(msgTBR) loadEvents() @@ -418,11 +419,11 @@ class DanaRSService : DaggerService() { sendMessage(status) if (status.failed) return false if (status.isTempBasalInProgress) { - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.stoppingtempbasal))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.stoppingtempbasal))) sendMessage(DanaRSPacketBasalSetCancelTemporaryBasal(injector)) SystemClock.sleep(500) } - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.settingtempbasal))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.settingtempbasal))) val msgTBR = DanaRSPacketAPSBasalSetTemporaryBasal(injector, percent) sendMessage(msgTBR) loadEvents() @@ -436,7 +437,7 @@ class DanaRSService : DaggerService() { fun tempBasalStop(): Boolean { if (!isConnected) return false - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.stoppingtempbasal))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.stoppingtempbasal))) val msgCancel = DanaRSPacketBasalSetCancelTemporaryBasal(injector) sendMessage(msgCancel) loadEvents() @@ -449,7 +450,7 @@ class DanaRSService : DaggerService() { fun extendedBolus(insulin: Double, durationInHalfHours: Int): Boolean { if (!isConnected) return false - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.settingextendedbolus))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.settingextendedbolus))) val msgExtended = DanaRSPacketBolusSetExtendedBolus(injector, insulin, durationInHalfHours) sendMessage(msgExtended) SystemClock.sleep(200) @@ -463,7 +464,7 @@ class DanaRSService : DaggerService() { fun extendedBolusStop(): Boolean { if (!isConnected) return false - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.stoppingextendedbolus))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.stoppingextendedbolus))) val msgStop = DanaRSPacketBolusSetExtendedBolusCancel(injector) sendMessage(msgStop) loadEvents() @@ -476,7 +477,7 @@ class DanaRSService : DaggerService() { fun updateBasalsInPump(profile: Profile): Boolean { if (!isConnected) return false - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.updatingbasalrates))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.updatingbasalrates))) val basal = danaPump.buildDanaRProfileRecord(profile) val msgSet = DanaRSPacketBasalSetProfileBasalRate(injector, 0, basal) sendMessage(msgSet) @@ -539,7 +540,7 @@ class DanaRSService : DaggerService() { val time = dateUtil.now() val timeToWholeMinute = 60000 - time % 60000 if (timeToWholeMinute > 59800 || timeToWholeMinute < 300) break - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.pump.dana.R.string.waitingfortimesynchronization, (timeToWholeMinute / 1000).toInt()))) + rxBus.send(EventPumpStatusChanged(rh.gs(R.string.waitingfortimesynchronization, (timeToWholeMinute / 1000).toInt()))) SystemClock.sleep(min(timeToWholeMinute, 100)) } } diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/DanaRSPluginTest.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/DanaRSPluginTest.kt index 96a348c830..484672440b 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/DanaRSPluginTest.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/DanaRSPluginTest.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.danars +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.queue.CommandQueue import dagger.android.AndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.pump.dana.database.DanaHistoryDatabase import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/DanaRSTestBase.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/DanaRSTestBase.kt index a40f1aa570..53976c5f68 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/DanaRSTestBase.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/DanaRSTestBase.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars +import app.aaps.interfaces.objects.Instantiator +import app.aaps.interfaces.ui.UiInteraction import app.aaps.shared.tests.TestBaseWithProfile import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.profile.Instantiator -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.danars.comm.DanaRSPacket import org.junit.jupiter.api.BeforeEach diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryCompleteTest.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryCompleteTest.kt index 06f09d9a46..a7d441e7c9 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryCompleteTest.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRSPacketNotifyDeliveryCompleteTest.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.pump.danars.DanaRSTestBase -import info.nightscout.rx.events.EventOverviewBolusProgress import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mockito.anyDouble diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsMessageHashTableTest.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsMessageHashTableTest.kt index 14a7f30e10..17e61a5895 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsMessageHashTableTest.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsMessageHashTableTest.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.constraints.ConstraintsChecker import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.ConstraintsChecker import info.nightscout.pump.dana.DanaPump import info.nightscout.pump.danars.DanaRSTestBase import org.junit.jupiter.api.Assertions diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketApsHistoryEventsTest.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketApsHistoryEventsTest.kt index fa3abb827d..0a3474b7c9 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketApsHistoryEventsTest.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketApsHistoryEventsTest.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage import info.nightscout.pump.danars.DanaRSTestBase import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt index af4ac3f1a1..7417071393 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.queue.CommandQueue import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.pump.dana.database.DanaHistoryDatabase import info.nightscout.pump.danars.DanaRSTestBase import org.junit.jupiter.api.Assertions diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketBolusSetStepBolusStopTest.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketBolusSetStepBolusStopTest.kt index b0dc17b336..7c18ffd325 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketBolusSetStepBolusStopTest.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketBolusSetStepBolusStopTest.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.pump.danars.DanaRSTestBase -import info.nightscout.rx.events.EventOverviewBolusProgress import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mockito diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketNotifyAlarmTest.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketNotifyAlarmTest.kt index 4317cc2557..1cc7c12f5e 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketNotifyAlarmTest.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketNotifyAlarmTest.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.pump.PumpSync import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.PumpSync import info.nightscout.pump.danars.DanaRSTestBase import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketNotifyDeliveryRateDisplayTest.kt b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketNotifyDeliveryRateDisplayTest.kt index 08865517af..8e148a3f35 100644 --- a/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketNotifyDeliveryRateDisplayTest.kt +++ b/pump/danars/src/test/java/info/nightscout/pump/danars/comm/DanaRsPacketNotifyDeliveryRateDisplayTest.kt @@ -1,15 +1,15 @@ package info.nightscout.pump.danars.comm +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.pump.dana.database.DanaHistoryDatabase import info.nightscout.pump.danars.DanaRSTestBase -import info.nightscout.rx.events.EventOverviewBolusProgress import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Fragment.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Fragment.kt index 196134e88b..2d0e75bc9e 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Fragment.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Fragment.kt @@ -8,30 +8,30 @@ import android.os.HandlerThread import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.WarnColors +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventExtendedBolusChange +import app.aaps.interfaces.rx.events.EventInitializationChanged +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.WarnColors -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.diaconn.activities.DiaconnG8HistoryActivity import info.nightscout.pump.diaconn.activities.DiaconnG8UserOptionsActivity import info.nightscout.pump.diaconn.databinding.DiaconnG8FragmentBinding import info.nightscout.pump.diaconn.events.EventDiaconnG8NewStatus -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventExtendedBolusChange -import info.nightscout.rx.events.EventInitializationChanged -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.rx.events.EventTempBasalChange -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 @@ -119,9 +119,11 @@ class DiaconnG8Fragment : DaggerFragment() { EventPumpStatusChanged.Status.CONNECTING -> @Suppress("SetTextI18n") binding.btconnection.text = "{fa-bluetooth-b spin} ${it.secondsElapsed}s" + EventPumpStatusChanged.Status.CONNECTED -> @Suppress("SetTextI18n") binding.btconnection.text = "{fa-bluetooth}" + EventPumpStatusChanged.Status.DISCONNECTED -> @Suppress("SetTextI18n") binding.btconnection.text = "{fa-bluetooth-b}" @@ -160,7 +162,7 @@ class DiaconnG8Fragment : DaggerFragment() { if (pump.lastConnection != 0L) { val agoMsec = System.currentTimeMillis() - pump.lastConnection val agoMin = (agoMsec.toDouble() / 60.0 / 1000.0).toInt() - binding.lastconnection.text = dateUtil.timeString(pump.lastConnection) + " (" + rh.gs(info.nightscout.interfaces.R.string.minago, agoMin) + ")" + binding.lastconnection.text = dateUtil.timeString(pump.lastConnection) + " (" + rh.gs(app.aaps.interfaces.R.string.minago, agoMin) + ")" warnColors.setColor(binding.lastconnection, agoMin.toDouble(), 16.0, 31.0) } if (pump.lastBolusTime != 0L) { @@ -168,7 +170,11 @@ class DiaconnG8Fragment : DaggerFragment() { val agoHours = agoMsec.toDouble() / 60.0 / 60.0 / 1000.0 if (agoHours < 6) // max 6h back - binding.lastbolus.text = dateUtil.timeString(pump.lastBolusTime) + " " + dateUtil.sinceString(pump.lastBolusTime, rh) + " " + rh.gs(info.nightscout.core.ui.R.string.format_insulin_units, pump.lastBolusAmount) + binding.lastbolus.text = + dateUtil.timeString(pump.lastBolusTime) + " " + dateUtil.sinceString(pump.lastBolusTime, rh) + " " + rh.gs( + info.nightscout.core.ui.R.string.format_insulin_units, + pump.lastBolusAmount + ) else binding.lastbolus.text = "" } @@ -185,7 +191,8 @@ class DiaconnG8Fragment : DaggerFragment() { warnColors.setColorInverse(binding.reservoir, pump.systemRemainInsulin, 50.0, 20.0) binding.battery.text = "{fa-battery-" + pump.systemRemainBattery / 25 + "}" + " (" + pump.systemRemainBattery + " %)" warnColors.setColorInverse(binding.battery, pump.systemRemainBattery.toDouble(), 51.0, 26.0) - binding.firmware.text = rh.gs(R.string.diaconn_g8_pump) + "\nVersion: " + pump.majorVersion.toString() + "." + pump.minorVersion.toString() + "\nCountry: " + pump.country.toString() + "\nProductType: " + pump.productType.toString() + "\nManufacture: " + pump.makeYear + "." + pump.makeMonth + "." + pump.makeDay + binding.firmware.text = + rh.gs(R.string.diaconn_g8_pump) + "\nVersion: " + pump.majorVersion.toString() + "." + pump.minorVersion.toString() + "\nCountry: " + pump.country.toString() + "\nProductType: " + pump.productType.toString() + "\nManufacture: " + pump.makeYear + "." + pump.makeMonth + "." + pump.makeDay binding.basalstep.text = pump.basalStep.toString() binding.bolusstep.text = pump.bolusStep.toString() binding.serialNumber.text = pump.serialNo.toString() diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Plugin.kt index b0e3937466..87f2b127db 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Plugin.kt @@ -8,51 +8,51 @@ import android.os.IBinder import android.text.format.DateFormat import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat +import app.aaps.interfaces.constraints.Constraint +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.OwnDatabasePlugin +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.Diaconn +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpPluginBase +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.pump.actions.CustomAction +import app.aaps.interfaces.pump.actions.CustomActionType +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventConfigBuilderChange +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.constraints.Constraint -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.OwnDatabasePlugin -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.Diaconn -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpPluginBase -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.Round import info.nightscout.pump.diaconn.database.DiaconnHistoryDatabase import info.nightscout.pump.diaconn.events.EventDiaconnG8DeviceChange import info.nightscout.pump.diaconn.service.DiaconnG8Service -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventConfigBuilderChange -import info.nightscout.rx.events.EventDismissNotification -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 org.json.JSONException import org.json.JSONObject diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Pump.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Pump.kt index 42f7140195..03262b5fa7 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Pump.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/DiaconnG8Pump.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.diaconn -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import javax.inject.Inject import javax.inject.Singleton import kotlin.math.max @@ -22,6 +22,7 @@ class DiaconnG8Pump @Inject constructor( ) { var isPumpLogUploadFailed: Boolean = false + //var bleResultInfo: Pair = Pair(null, false) var bolusConfirmMessage: Byte = 0 @@ -30,13 +31,13 @@ class DiaconnG8Pump @Inject constructor( var pumpIncarnationNum: Int = 65536 var isPumpVersionGe2_63: Boolean = false // is pumpVersion higher then 2.63 var isPumpVersionGe3_53: Boolean = false // is pumpVersion higher then 3.42 - var insulinWarningGrade: Int =0 - var insulinWarningProcess: Int =0 - var insulinWarningRemain: Int =0 + var insulinWarningGrade: Int = 0 + var insulinWarningProcess: Int = 0 + var insulinWarningRemain: Int = 0 var batteryWaningGrade: Int = 0 var batteryWaningProcess: Int = 0 var batteryWaningRemain: Int = 0 - var injectionBlockType: Int =0 + var injectionBlockType: Int = 0 var injectionBlockRemainAmount: Double = 0.0 var injectionBlockProcess: Int = 0 var injectionBlockGrade: Int = 0 @@ -50,6 +51,7 @@ class DiaconnG8Pump @Inject constructor( fun setPumpTime(value: Long) { pumpTime = value } + fun getPumpTime() = pumpTime // Status @@ -122,7 +124,7 @@ class DiaconnG8Pump @Inject constructor( extendedBolusAmount = 0.0 } } - val extendedBolusPassedMinutes:Int + val extendedBolusPassedMinutes: Int get() = T.msecs(max(0, dateUtil.now() - extendedBolusStart)).mins().toInt() val extendedBolusRemainingMinutes: Int get() = max(T.msecs(extendedBolusStart + extendedBolusDuration - dateUtil.now()).mins().toInt(), 0) @@ -155,6 +157,7 @@ class DiaconnG8Pump @Inject constructor( extendedBolusAmount = eb.amount } } + // Profile var activeProfile = 0 var pumpProfiles: Array>? = null @@ -182,12 +185,13 @@ class DiaconnG8Pump @Inject constructor( var bolusDone = false // success end val pumpUid: String - get() = "$country-$productType-$makeYear-${makeMonth.toString().padStart(2,'0')}-${makeDay.toString().padStart(2, '0')}-${lotNo.toString().padStart(3,'0')}-${serialNo.toString().padStart(5,'0')}" + get() = "$country-$productType-$makeYear-${makeMonth.toString().padStart(2, '0')}-${makeDay.toString().padStart(2, '0')}-${lotNo.toString().padStart(3, '0')}-${ + serialNo.toString().padStart(5, '0') + }" val pumpVersion: String get() = "$majorVersion.$minorVersion" - fun buildDiaconnG8ProfileRecord(nsProfile: Profile): Array { val record = Array(24) { 0.0 } for (hour in 0..23) { @@ -208,7 +212,7 @@ class DiaconnG8Pump @Inject constructor( } // G8 pump - var result:Int = 0 // 조회결과 + var result: Int = 0 // 조회결과 // 1. pump setting info var systemRemainInsulin = 0.0 // 인슐린 잔량 @@ -356,6 +360,7 @@ class DiaconnG8Pump @Inject constructor( var bolusingInjProgress = 0 companion object { + // User settings const val ALARM = 0 const val LCD = 1 diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8BLEScanActivity.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8BLEScanActivity.kt index ef46a1f1a7..162169fabe 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8BLEScanActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8BLEScanActivity.kt @@ -23,15 +23,15 @@ import android.view.ViewGroup import android.widget.BaseAdapter import android.widget.TextView import androidx.core.app.ActivityCompat +import app.aaps.interfaces.pump.BlePreCheck +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.extensions.safeEnable -import info.nightscout.interfaces.pump.BlePreCheck import info.nightscout.pump.diaconn.R import info.nightscout.pump.diaconn.databinding.DiaconnG8BlescannerActivityBinding import info.nightscout.pump.diaconn.events.EventDiaconnG8DeviceChange -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.sharedPreferences.SP import java.util.UUID import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8HistoryActivity.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8HistoryActivity.kt index 9ce2560536..58531bef91 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8HistoryActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8HistoryActivity.kt @@ -9,24 +9,24 @@ import android.widget.ArrayAdapter import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.pump.diaconn.R import info.nightscout.pump.diaconn.common.RecordTypes import info.nightscout.pump.diaconn.database.DiaconnHistoryRecord import info.nightscout.pump.diaconn.database.DiaconnHistoryRecordDao import info.nightscout.pump.diaconn.databinding.DiaconnG8HistoryActivityBinding -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPumpStatusChanged -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 @@ -133,7 +133,7 @@ class DiaconnG8HistoryActivity : TranslatedDaggerAppCompatActivity() { holder.duration.text = decimalFormatter.to0Decimal(record.duration.toDouble()) holder.alarm.text = record.alarm when (showingType) { - RecordTypes.RECORD_TYPE_ALARM -> { + RecordTypes.RECORD_TYPE_ALARM -> { holder.time.visibility = View.VISIBLE holder.value.visibility = View.VISIBLE holder.stringValue.visibility = View.VISIBLE @@ -145,7 +145,7 @@ class DiaconnG8HistoryActivity : TranslatedDaggerAppCompatActivity() { holder.alarm.visibility = View.VISIBLE } - RecordTypes.RECORD_TYPE_BOLUS -> { + RecordTypes.RECORD_TYPE_BOLUS -> { holder.time.visibility = View.VISIBLE holder.value.visibility = View.VISIBLE holder.stringValue.visibility = View.VISIBLE @@ -157,7 +157,7 @@ class DiaconnG8HistoryActivity : TranslatedDaggerAppCompatActivity() { holder.alarm.visibility = View.GONE } - RecordTypes.RECORD_TYPE_DAILY -> { + RecordTypes.RECORD_TYPE_DAILY -> { holder.dailyBasal.text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units, record.dailyBasal) holder.dailyBolus.text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units, record.dailyBolus) holder.dailyTotal.text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units, record.dailyBolus + record.dailyBasal) @@ -174,7 +174,7 @@ class DiaconnG8HistoryActivity : TranslatedDaggerAppCompatActivity() { } RecordTypes.RECORD_TYPE_BASALHOUR, - RecordTypes.RECORD_TYPE_REFILL -> { + RecordTypes.RECORD_TYPE_REFILL -> { holder.time.visibility = View.VISIBLE holder.value.visibility = View.VISIBLE holder.stringValue.visibility = View.VISIBLE @@ -186,7 +186,7 @@ class DiaconnG8HistoryActivity : TranslatedDaggerAppCompatActivity() { holder.alarm.visibility = View.GONE } - RecordTypes.RECORD_TYPE_TB -> { + RecordTypes.RECORD_TYPE_TB -> { holder.time.visibility = View.VISIBLE holder.value.visibility = View.VISIBLE holder.stringValue.visibility = View.VISIBLE @@ -198,7 +198,7 @@ class DiaconnG8HistoryActivity : TranslatedDaggerAppCompatActivity() { holder.alarm.visibility = View.GONE } - RecordTypes.RECORD_TYPE_SUSPEND -> { + RecordTypes.RECORD_TYPE_SUSPEND -> { holder.time.visibility = View.VISIBLE holder.value.visibility = View.GONE holder.stringValue.visibility = View.VISIBLE diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8UserOptionsActivity.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8UserOptionsActivity.kt index 708bdedcca..d160ceb66c 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8UserOptionsActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/activities/DiaconnG8UserOptionsActivity.kt @@ -5,20 +5,20 @@ import android.os.Bundle import android.view.View import android.widget.AdapterView import android.widget.ArrayAdapter +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R import info.nightscout.pump.diaconn.databinding.DiaconnG8UserOptionsActivityBinding -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 java.text.DecimalFormat import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/api/DiaconnLogUploader.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/api/DiaconnLogUploader.kt index 123a073a25..fd4e3a0128 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/api/DiaconnLogUploader.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/api/DiaconnLogUploader.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.diaconn.api -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import retrofit2.Retrofit import retrofit2.converter.gson.GsonConverterFactory @@ -9,10 +9,12 @@ import javax.inject.Inject import javax.inject.Singleton @Singleton -class DiaconnLogUploader @Inject constructor ( +class DiaconnLogUploader @Inject constructor( private val aapsLogger: AAPSLogger, ) { + companion object { + private const val BASE_URL = "https://api.diaconn.com/aaps/" const val UPLOAD_API_KEY = "D7B3DA9FA8229D5253F3D75E1E2B1BA4" } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/events/EventDiaconnG8DeviceChange.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/events/EventDiaconnG8DeviceChange.kt index cf90013945..193eed3573 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/events/EventDiaconnG8DeviceChange.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/events/EventDiaconnG8DeviceChange.kt @@ -1,5 +1,5 @@ package info.nightscout.pump.diaconn.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventDiaconnG8DeviceChange : Event() \ No newline at end of file diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/events/EventDiaconnG8NewStatus.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/events/EventDiaconnG8NewStatus.kt index 0cc07677a3..43c4db99c1 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/events/EventDiaconnG8NewStatus.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/events/EventDiaconnG8NewStatus.kt @@ -1,5 +1,5 @@ package info.nightscout.pump.diaconn.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventDiaconnG8NewStatus : Event() diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppCancelSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppCancelSettingPacket.kt index 68990f6f47..230476a8c2 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppCancelSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppCancelSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -12,7 +11,7 @@ import javax.inject.Inject class AppCancelSettingPacket( injector: HasAndroidInjector, private var reqMsgType: Byte, -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -21,7 +20,7 @@ class AppCancelSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "AppCancelSettingPacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(reqMsgType) // 명령코드 return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppCancelSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppCancelSettingResponsePacket.kt index 87ac0a9eb5..864e6b83d7 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppCancelSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppCancelSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class AppCancelSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump - var result =0 + var result = 0 + init { msgType = 0xA9.toByte() aapsLogger.debug(LTag.PUMPCOMM, "AppCancelSettingResPacket init ") @@ -29,8 +29,8 @@ class AppCancelSettingResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + result = getByteToInt(bufferData) + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppConfirmSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppConfirmSettingPacket.kt index c3bc6fadc0..ed19d4859e 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppConfirmSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppConfirmSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -13,7 +12,7 @@ class AppConfirmSettingPacket( injector: HasAndroidInjector, private var reqMsgType: Byte, // 명령코드 private var otp: Int // 응답시 전달받은 opt (random 6 digit numbner) -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -22,7 +21,7 @@ class AppConfirmSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "AppConfirmSettingPacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(reqMsgType) // 명령코드 diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppConfirmSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppConfirmSettingResponsePacket.kt index 954d0f0ffc..a16007c4e8 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppConfirmSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/AppConfirmSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class AppConfirmSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump - var result =0 + var result = 0 + init { msgType = 0xB7.toByte() aapsLogger.debug(LTag.PUMPCOMM, "AppConfirmSettingReqPacket Response ") @@ -28,17 +28,17 @@ class AppConfirmSettingResponsePacket( return } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) + result = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${result}") - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } // The bolus progress dialog opens only when the confirm result is successful - if(diaconnG8Pump.bolusConfirmMessage == 0x07.toByte()) { - diaconnG8Pump.isReadyToBolus = true + if (diaconnG8Pump.bolusConfirmMessage == 0x07.toByte()) { + diaconnG8Pump.isReadyToBolus = true } } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalLimitInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalLimitInquirePacket.kt index 84e3bfa601..3a76857e10 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalLimitInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalLimitInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class BasalLimitInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -20,7 +19,7 @@ class BasalLimitInquirePacket( aapsLogger.debug(LTag.PUMPCOMM, "BasalLimitInquirePacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalLimitInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalLimitInquireResponsePacket.kt index 0089294c28..4be815918b 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalLimitInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalLimitInquireResponsePacket.kt @@ -1,18 +1,18 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R import info.nightscout.pump.diaconn.pumplog.PumpLogUtil -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject /** * BasalLimitInquireResponsePacket */ -class BasalLimitInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class BasalLimitInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @Inject lateinit var sp: SP @@ -32,17 +32,17 @@ class BasalLimitInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8P } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result2)) { + val result2 = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result2)) { failed = true return } diaconnG8Pump.maxBasalPerHours = getShortToInt(bufferData).toDouble() / 100.0 // not include tempbasal limit val pumpFirmwareVersion = sp.getString(rh.gs(R.string.pumpversion), "") - if(pumpFirmwareVersion.isNotEmpty() && PumpLogUtil.isPumpVersionGe(pumpFirmwareVersion, 3, 0)) { - diaconnG8Pump.maxBasal = diaconnG8Pump.maxBasalPerHours * 2.5 // include tempbasal + if (pumpFirmwareVersion.isNotEmpty() && PumpLogUtil.isPumpVersionGe(pumpFirmwareVersion, 3, 0)) { + diaconnG8Pump.maxBasal = diaconnG8Pump.maxBasalPerHours * 2.5 // include tempbasal } else { - diaconnG8Pump.maxBasal = diaconnG8Pump.maxBasalPerHours * 2.0 // include tempbasal + diaconnG8Pump.maxBasal = diaconnG8Pump.maxBasalPerHours * 2.0 // include tempbasal } aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseReportPacket.kt index 81363dd91a..36c6283980 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseReportPacket.kt @@ -1,18 +1,17 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** * BasalPauseReportPacket */ -class BasalPauseReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class BasalPauseReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump - var status:Int? = null + var status: Int? = null init { msgType = 0xC3.toByte() @@ -28,7 +27,7 @@ class BasalPauseReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(inj } else failed = false val bufferData = prefixDecode(data) - status = getByteToInt(bufferData) //(1: pauseed, 2: pause cancel) + status = getByteToInt(bufferData) //(1: pauseed, 2: pause cancel) aapsLogger.debug(LTag.PUMPCOMM, "status --> ${status}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseSettingPacket.kt index a1163e7a57..a041ef44be 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,8 +10,8 @@ import javax.inject.Inject */ class BasalPauseSettingPacket( injector: HasAndroidInjector, - private var status:Int //(1:pause, 2: cancel pause) -) : DiaconnG8Packet(injector ) { + private var status: Int //(1:pause, 2: cancel pause) +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -21,7 +20,7 @@ class BasalPauseSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "BasalPauseSettingPacket Init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(status.toByte()) // (1:pause, 2: cancel pause) return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseSettingResponsePacket.kt index 98e8c87f9e..6ae517e1cd 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalPauseSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class BasalPauseSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 @@ -30,15 +29,15 @@ class BasalPauseSettingResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) + result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${result}") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingPacket.kt index e2585dd2a9..b4078ced33 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -19,7 +18,7 @@ class BasalSettingPacket( private var amount4: Int, private var amount5: Int, private var amount6: Int -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -29,7 +28,7 @@ class BasalSettingPacket( } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = if (group == 4) { // 마지막 그룹일때 prefixEncode(msgType, msgSeq, MSG_CON_END) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingReportPacket.kt index e9a159e483..0fb5218ea9 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingReportPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class BasalSettingReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 @@ -30,7 +29,7 @@ class BasalSettingReportPacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) + result = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") // no Response } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingResponsePacket.kt index 595c432c60..b7f9201fe9 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BasalSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class BasalSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 @@ -30,13 +29,13 @@ class BasalSettingResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + result = getByteToInt(bufferData) + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BatteryWarningReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BatteryWarningReportPacket.kt index 6cd154a17f..f1f5cd1377 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BatteryWarningReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BatteryWarningReportPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class BatteryWarningReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -31,7 +30,7 @@ class BatteryWarningReportPacket( val bufferData = prefixDecode(data) diaconnG8Pump.batteryWaningGrade = getByteToInt(bufferData) diaconnG8Pump.batteryWaningProcess = getByteToInt(bufferData) - diaconnG8Pump.batteryWaningRemain = getByteToInt(bufferData) + diaconnG8Pump.batteryWaningRemain = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "batteryWaningGrade --> ${diaconnG8Pump.batteryWaningGrade} (1:info, 2: warning , 3: major , 4: critical)") aapsLogger.debug(LTag.PUMPCOMM, "batteryWaningProcess --> ${diaconnG8Pump.batteryWaningProcess} (1:skip, 2: stop , 3: ignore ) ") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigAPSMainInfoInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigAPSMainInfoInquirePacket.kt index 63d9ca1030..ef915f9d50 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigAPSMainInfoInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigAPSMainInfoInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -12,7 +11,7 @@ import javax.inject.Inject */ class BigAPSMainInfoInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -22,7 +21,7 @@ class BigAPSMainInfoInquirePacket( } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigAPSMainInfoInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigAPSMainInfoInquireResponsePacket.kt index 676a3193e0..e2c1d9ca0f 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigAPSMainInfoInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigAPSMainInfoInquireResponsePacket.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R import info.nightscout.pump.diaconn.pumplog.PumpLogUtil -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.joda.time.DateTime import javax.inject.Inject import kotlin.math.floor @@ -36,8 +36,8 @@ class BigAPSMainInfoInquireResponsePacket( } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) // 결과비트 상위 4비트 제거 - if(!isSuccInquireResponseResult(result2)) { + val result2 = getByteToInt(bufferData) // 결과비트 상위 4비트 제거 + if (!isSuccInquireResponseResult(result2)) { failed = true return } @@ -134,18 +134,18 @@ class BigAPSMainInfoInquireResponsePacket( diaconnG8Pump.currentBasePattern = getByteToInt(bufferData) // 패턴 종류 (1=기본, 2=생활1, 3=생활2, 4=생활3, 5=닥터1, 6=닥터2) diaconnG8Pump.currentBaseHour = getByteToInt(bufferData) // 현재주입시간(0~23) diaconnG8Pump.currentBaseTbBeforeAmount = getShortToInt(bufferData) / 100.0 // 해당시간의 임시기저 계산 전 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750) - diaconnG8Pump.currentBaseTbAfterAmount = getShortToInt(bufferData)/ 100.0 // 해당시간의 임시기저 계산 후 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750) + diaconnG8Pump.currentBaseTbAfterAmount = getShortToInt(bufferData) / 100.0 // 해당시간의 임시기저 계산 후 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750) // 15. saved basal pattern status - diaconnG8Pump.baseAmount1 = getShortToInt(bufferData) / 100.0 // 주입량 1(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount2 = getShortToInt(bufferData) / 100.0 // 주입량 2(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount3 = getShortToInt(bufferData) / 100.0 // 주입량 3(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount4 = getShortToInt(bufferData) / 100.0 // 주입량 4(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount5 = getShortToInt(bufferData) / 100.0 // 주입량 5(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount6 = getShortToInt(bufferData) / 100.0 // 주입량 6(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount7 = getShortToInt(bufferData) / 100.0 // 주입량 7(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount8 = getShortToInt(bufferData) / 100.0 // 주입량 8(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount9 = getShortToInt(bufferData) / 100.0 // 주입량 9(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount1 = getShortToInt(bufferData) / 100.0 // 주입량 1(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount2 = getShortToInt(bufferData) / 100.0 // 주입량 2(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount3 = getShortToInt(bufferData) / 100.0 // 주입량 3(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount4 = getShortToInt(bufferData) / 100.0 // 주입량 4(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount5 = getShortToInt(bufferData) / 100.0 // 주입량 5(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount6 = getShortToInt(bufferData) / 100.0 // 주입량 6(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount7 = getShortToInt(bufferData) / 100.0 // 주입량 7(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount8 = getShortToInt(bufferData) / 100.0 // 주입량 8(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount9 = getShortToInt(bufferData) / 100.0 // 주입량 9(량*100, 23.25->2325, 15.2->1520) diaconnG8Pump.baseAmount10 = getShortToInt(bufferData) / 100.0 // 주입량 10(량*100, 23.25->2325, 15.2->1520) diaconnG8Pump.baseAmount11 = getShortToInt(bufferData) / 100.0 // 주입량 11(량*100, 23.25->2325, 15.2->1520) diaconnG8Pump.baseAmount12 = getShortToInt(bufferData) / 100.0 // 주입량 12(량*100, 23.25->2325, 15.2->1520) @@ -164,40 +164,40 @@ class BigAPSMainInfoInquireResponsePacket( // 16. 1hour basal limit diaconnG8Pump.maxBasalPerHours = getShortToInt(bufferData).toDouble() / 100.0 // not include tempbasal limit - diaconnG8Pump.maxBasal = diaconnG8Pump.maxBasalPerHours * 2.5 // include tempbasal + diaconnG8Pump.maxBasal = diaconnG8Pump.maxBasalPerHours * 2.5 // include tempbasal // 17. snack limit diaconnG8Pump.mealLimitTime = getByteToInt(bufferData) // mealLimittime - diaconnG8Pump.maxBolus = getShortToInt(bufferData).toDouble() / 100 - diaconnG8Pump.maxBolusePerDay = getShortToInt(bufferData).toDouble() / 100 + diaconnG8Pump.maxBolus = getShortToInt(bufferData).toDouble() / 100 + diaconnG8Pump.maxBolusePerDay = getShortToInt(bufferData).toDouble() / 100 // 18. pump sound - diaconnG8Pump.beepAndAlarm = getByteToInt(bufferData) -1 - diaconnG8Pump.alarmIntensity = getByteToInt(bufferData) -1 + diaconnG8Pump.beepAndAlarm = getByteToInt(bufferData) - 1 + diaconnG8Pump.alarmIntensity = getByteToInt(bufferData) - 1 // 19. pump light time - diaconnG8Pump.lcdOnTimeSec = getByteToInt(bufferData) // kind (1=30 sec, 2=40 sec, 3=50 sec) + diaconnG8Pump.lcdOnTimeSec = getByteToInt(bufferData) // kind (1=30 sec, 2=40 sec, 3=50 sec) // 20. language - diaconnG8Pump.selectedLanguage = getByteToInt(bufferData) // language (1=Chiness, 2=Korean, 3=English) + diaconnG8Pump.selectedLanguage = getByteToInt(bufferData) // language (1=Chiness, 2=Korean, 3=English) // pump time setting 'yyyy-MM-dd'T'HH:mm:ssZ' “2019-07-04T12:30:30+0530” - val time = DateTime(diaconnG8Pump.year, diaconnG8Pump.month, diaconnG8Pump.day, diaconnG8Pump.hour, diaconnG8Pump.minute, diaconnG8Pump.second) + val time = DateTime(diaconnG8Pump.year, diaconnG8Pump.month, diaconnG8Pump.day, diaconnG8Pump.hour, diaconnG8Pump.minute, diaconnG8Pump.second) diaconnG8Pump.setPumpTime(time.millis) aapsLogger.debug(LTag.PUMPCOMM, "Pump time " + dateUtil.dateAndTimeAndSecondsString(time.millis)) // basal pattern from pump diaconnG8Pump.pumpProfiles = Array(4) { Array(24) { 0.0 } } - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][0] = diaconnG8Pump.baseAmount1 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][1] = diaconnG8Pump.baseAmount2 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][2] = diaconnG8Pump.baseAmount3 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][3] = diaconnG8Pump.baseAmount4 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][4] = diaconnG8Pump.baseAmount5 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][5] = diaconnG8Pump.baseAmount6 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][6] = diaconnG8Pump.baseAmount7 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][7] = diaconnG8Pump.baseAmount8 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][8] = diaconnG8Pump.baseAmount9 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][9] = diaconnG8Pump.baseAmount10 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][0] = diaconnG8Pump.baseAmount1 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][1] = diaconnG8Pump.baseAmount2 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][2] = diaconnG8Pump.baseAmount3 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][3] = diaconnG8Pump.baseAmount4 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][4] = diaconnG8Pump.baseAmount5 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][5] = diaconnG8Pump.baseAmount6 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][6] = diaconnG8Pump.baseAmount7 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][7] = diaconnG8Pump.baseAmount8 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][8] = diaconnG8Pump.baseAmount9 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][9] = diaconnG8Pump.baseAmount10 diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][10] = diaconnG8Pump.baseAmount11 diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][11] = diaconnG8Pump.baseAmount12 diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][12] = diaconnG8Pump.baseAmount13 diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigLogInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigLogInquirePacket.kt index 40ca17e8d1..57c5cbf5a4 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigLogInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigLogInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -13,16 +12,18 @@ import javax.inject.Inject class BigLogInquirePacket( injector: HasAndroidInjector, private val start: Int, - private val end:Int, - private val delay:Int -) : DiaconnG8Packet(injector ) { + private val end: Int, + private val delay: Int +) : DiaconnG8Packet(injector) { + @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x72 aapsLogger.debug(LTag.PUMPCOMM, "BigLogInquirePacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.putShort(start.toShort()) buffer.putShort(end.toShort()) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigLogInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigLogInquireResponsePacket.kt index 4a0ec8dd1e..491ee9f07e 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigLogInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigLogInquireResponsePacket.kt @@ -1,15 +1,21 @@ package info.nightscout.pump.diaconn.packet import android.content.Context +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.T import app.aaps.shared.impl.extensions.safeGetPackageInfo import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R import info.nightscout.pump.diaconn.api.ApiResponse @@ -46,12 +52,6 @@ import info.nightscout.pump.diaconn.pumplog.LogSuspendV2 import info.nightscout.pump.diaconn.pumplog.LogTbStartV3 import info.nightscout.pump.diaconn.pumplog.LogTbStopV3 import info.nightscout.pump.diaconn.pumplog.PumpLogUtil -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPumpStatusChanged -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 org.apache.commons.lang3.time.DateUtils import org.joda.time.DateTime import retrofit2.Call diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigMainInfoInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigMainInfoInquirePacket.kt index df36501b80..031c096509 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigMainInfoInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigMainInfoInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -12,7 +11,7 @@ import javax.inject.Inject */ class BigMainInfoInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -22,7 +21,7 @@ class BigMainInfoInquirePacket( } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigMainInfoInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigMainInfoInquireResponsePacket.kt index 1354b1915b..3eeda81a9e 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigMainInfoInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BigMainInfoInquireResponsePacket.kt @@ -1,14 +1,14 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R import info.nightscout.pump.diaconn.pumplog.PumpLogUtil -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.joda.time.DateTime import javax.inject.Inject import kotlin.math.floor @@ -39,8 +39,8 @@ class BigMainInfoInquireResponsePacket( } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) // 결과비트 상위 4비트 제거 - if(!isSuccInquireResponseResult(result2)) { + val result2 = getByteToInt(bufferData) // 결과비트 상위 4비트 제거 + if (!isSuccInquireResponseResult(result2)) { failed = true return } @@ -152,18 +152,18 @@ class BigMainInfoInquireResponsePacket( diaconnG8Pump.currentBasePattern = getByteToInt(bufferData) // 패턴 종류 (1=기본, 2=생활1, 3=생활2, 4=생활3, 5=닥터1, 6=닥터2) diaconnG8Pump.currentBaseHour = getByteToInt(bufferData) // 현재주입시간(0~23) diaconnG8Pump.currentBaseTbBeforeAmount = getShortToInt(bufferData) / 100.0 // 해당시간의 임시기저 계산 전 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750) - diaconnG8Pump.currentBaseTbAfterAmount = getShortToInt(bufferData)/ 100.0 // 해당시간의 임시기저 계산 후 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750) + diaconnG8Pump.currentBaseTbAfterAmount = getShortToInt(bufferData) / 100.0 // 해당시간의 임시기저 계산 후 기저주입량: 기저주입막힘 발생 시 기저주입 막힘량 제외, 기저정지로 인해 주입되지 않은 량 제외, 리셋으로 인해 주입되지 않은 량 제외(47.5=4750) // 17. saved basal pattern status - diaconnG8Pump.baseAmount1 = getShortToInt(bufferData) / 100.0 // 주입량 1(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount2 = getShortToInt(bufferData) / 100.0 // 주입량 2(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount3 = getShortToInt(bufferData) / 100.0 // 주입량 3(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount4 = getShortToInt(bufferData) / 100.0 // 주입량 4(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount5 = getShortToInt(bufferData) / 100.0 // 주입량 5(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount6 = getShortToInt(bufferData) / 100.0 // 주입량 6(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount7 = getShortToInt(bufferData) / 100.0 // 주입량 7(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount8 = getShortToInt(bufferData) / 100.0 // 주입량 8(량*100, 23.25->2325, 15.2->1520) - diaconnG8Pump.baseAmount9 = getShortToInt(bufferData) / 100.0 // 주입량 9(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount1 = getShortToInt(bufferData) / 100.0 // 주입량 1(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount2 = getShortToInt(bufferData) / 100.0 // 주입량 2(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount3 = getShortToInt(bufferData) / 100.0 // 주입량 3(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount4 = getShortToInt(bufferData) / 100.0 // 주입량 4(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount5 = getShortToInt(bufferData) / 100.0 // 주입량 5(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount6 = getShortToInt(bufferData) / 100.0 // 주입량 6(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount7 = getShortToInt(bufferData) / 100.0 // 주입량 7(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount8 = getShortToInt(bufferData) / 100.0 // 주입량 8(량*100, 23.25->2325, 15.2->1520) + diaconnG8Pump.baseAmount9 = getShortToInt(bufferData) / 100.0 // 주입량 9(량*100, 23.25->2325, 15.2->1520) diaconnG8Pump.baseAmount10 = getShortToInt(bufferData) / 100.0 // 주입량 10(량*100, 23.25->2325, 15.2->1520) diaconnG8Pump.baseAmount11 = getShortToInt(bufferData) / 100.0 // 주입량 11(량*100, 23.25->2325, 15.2->1520) diaconnG8Pump.baseAmount12 = getShortToInt(bufferData) / 100.0 // 주입량 12(량*100, 23.25->2325, 15.2->1520) @@ -181,22 +181,22 @@ class BigMainInfoInquireResponsePacket( diaconnG8Pump.baseAmount24 = getShortToInt(bufferData) / 100.0 // 주입량 24(량*100, 23.25->2325, 15.2->1520) // pump time setting 'yyyy-MM-dd'T'HH:mm:ssZ' “2019-07-04T12:30:30+0530” - val time = DateTime(diaconnG8Pump.year, diaconnG8Pump.month, diaconnG8Pump.day, diaconnG8Pump.hour, diaconnG8Pump.minute, diaconnG8Pump.second) + val time = DateTime(diaconnG8Pump.year, diaconnG8Pump.month, diaconnG8Pump.day, diaconnG8Pump.hour, diaconnG8Pump.minute, diaconnG8Pump.second) diaconnG8Pump.setPumpTime(time.millis) aapsLogger.debug(LTag.PUMPCOMM, "Pump time " + dateUtil.dateAndTimeAndSecondsString(time.millis)) // basal pattern from pump diaconnG8Pump.pumpProfiles = Array(4) { Array(24) { 0.0 } } - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][0] = diaconnG8Pump.baseAmount1 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][1] = diaconnG8Pump.baseAmount2 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][2] = diaconnG8Pump.baseAmount3 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][3] = diaconnG8Pump.baseAmount4 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][4] = diaconnG8Pump.baseAmount5 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][5] = diaconnG8Pump.baseAmount6 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][6] = diaconnG8Pump.baseAmount7 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][7] = diaconnG8Pump.baseAmount8 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][8] = diaconnG8Pump.baseAmount9 - diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][9] = diaconnG8Pump.baseAmount10 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][0] = diaconnG8Pump.baseAmount1 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][1] = diaconnG8Pump.baseAmount2 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][2] = diaconnG8Pump.baseAmount3 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][3] = diaconnG8Pump.baseAmount4 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][4] = diaconnG8Pump.baseAmount5 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][5] = diaconnG8Pump.baseAmount6 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][6] = diaconnG8Pump.baseAmount7 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][7] = diaconnG8Pump.baseAmount8 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][8] = diaconnG8Pump.baseAmount9 + diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][9] = diaconnG8Pump.baseAmount10 diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][10] = diaconnG8Pump.baseAmount11 diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][11] = diaconnG8Pump.baseAmount12 diaconnG8Pump.pumpProfiles!![diaconnG8Pump.activeProfile][12] = diaconnG8Pump.baseAmount13 diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedInquirePacket.kt index e5d4f8dfe8..664c6a7dbe 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedInquirePacket.kt @@ -1,23 +1,23 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** * BolusSpeedInquirePacket */ -class BolusSpeedInquirePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class BolusSpeedInquirePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x45.toByte() aapsLogger.debug(LTag.PUMPCOMM, "BolusSpeedInquirePacket init ") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { return suffixEncode(prefixEncode(msgType, msgSeq, MSG_CON_END)) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedInquireResponsePacket.kt index e8b85a3867..443d5a4e8a 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedInquireResponsePacket.kt @@ -1,16 +1,15 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject /** * BolusSpeedInquireResponsePacket */ -class BolusSpeedInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class BolusSpeedInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @Inject lateinit var sp: SP @@ -29,9 +28,9 @@ class BolusSpeedInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8P } else failed = false val bufferData = prefixDecode(data) - val result = getByteToInt(bufferData) + val result = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result)) { + if (!isSuccInquireResponseResult(result)) { failed = true return } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingPacket.kt index 3254d4598a..8eff3c9f1f 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -21,7 +20,7 @@ class BolusSpeedSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "BolusSpeedSettingPacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(type.toByte()) // 명령코드 return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingReportPacket.kt index ee2048d231..b2398617f5 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingReportPacket.kt @@ -1,11 +1,10 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R -import info.nightscout.rx.logging.LTag - -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject /** @@ -13,10 +12,11 @@ import javax.inject.Inject */ class BolusSpeedSettingReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @Inject lateinit var sp: SP + init { msgType = 0xC5.toByte() aapsLogger.debug(LTag.PUMPCOMM, "BolusSpeedSettingReportPacket init ") @@ -31,7 +31,7 @@ class BolusSpeedSettingReportPacket( } else failed = false val bufferData = prefixDecode(data) - diaconnG8Pump.speed = getByteToInt(bufferData) // speed result + diaconnG8Pump.speed = getByteToInt(bufferData) // speed result sp.putBoolean(R.string.key_diaconn_g8_is_bolus_speed_sync, true) aapsLogger.debug(LTag.PUMPCOMM, "bolusSpeed --> ${diaconnG8Pump.speed}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingResponsePacket.kt index 8da7480376..cae81cbff5 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/BolusSpeedSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -15,6 +14,7 @@ class BolusSpeedSettingResponsePacket( @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x85.toByte() aapsLogger.debug(LTag.PUMPCOMM, "BolusSpeedSettingResponsePacket init") @@ -29,15 +29,15 @@ class BolusSpeedSettingResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) + result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/ConfirmReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/ConfirmReportPacket.kt index 850f63a5de..174318fa2c 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/ConfirmReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/ConfirmReportPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class ConfirmReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump - var reqMsgType:Int? = null + var reqMsgType: Int? = null + init { msgType = 0xE8.toByte() aapsLogger.debug(LTag.PUMPCOMM, "ConfirmReportPacket init ") @@ -29,7 +29,7 @@ class ConfirmReportPacket( } else failed = false val bufferData = prefixDecode(data) - reqMsgType = getByteToInt(bufferData) + reqMsgType = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Pump Report Confirm reqMsgType --> ${reqMsgType}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DiaconnG8Packet.java b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DiaconnG8Packet.java index 11f248adec..a35e2d91ad 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DiaconnG8Packet.java +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DiaconnG8Packet.java @@ -5,10 +5,10 @@ import java.nio.ByteOrder; import javax.inject.Inject; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.utils.DateUtil; import dagger.android.HasAndroidInjector; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; -import info.nightscout.shared.utils.DateUtil; public class DiaconnG8Packet { @@ -23,50 +23,50 @@ public class DiaconnG8Packet { public static final int MSG_LEN = 20; // 메시지 길이(20바이트 패킷) public static final int MSG_LEN_BIG = 182; // 메시지 길이(182바이트 대량패킷) public static final byte SOP = (byte) 0xef; // 패킷 시작 바이트(20바이트 패킷) - public static final byte SOP_BIG = (byte) 0xed; // 대량 패킷 시작 바이트(182바이트 대량패킷) + public static final byte SOP_BIG = (byte) 0xed; // 대량 패킷 시작 바이트(182바이트 대량패킷) public static final byte MSG_TYPE_LOC = 1; // 메시지 종류 위치 public static final byte MSG_SEQ_LOC = 2; // 메시지 시퀀스번호 위치 public static final byte BT_MSG_DATA_LOC = 4; // 데이터 위치 - public static final byte MSG_PAD = (byte) 0xff; // 메시지 뒷부분 빈공간을 채우는 값 - public static final byte MSG_CON_END = (byte) 0x00; // 패킷 내용 끝 - public static final byte MSG_CON_CONTINUE = (byte) 0x01; // 패킷 내용 계속 + public static final byte MSG_PAD = (byte) 0xff; // 메시지 뒷부분 빈공간을 채우는 값 + public static final byte MSG_CON_END = (byte) 0x00; // 패킷 내용 끝 + public static final byte MSG_CON_CONTINUE = (byte) 0x01; // 패킷 내용 계속 /** - * CRC 정보 + * CRC 정보 */ private static final byte[] crc_table = { - (byte) 0x00, (byte) 0x25, (byte) 0x4A, (byte) 0x6F, (byte) 0x94, (byte) 0xB1, (byte) 0xDE, (byte) 0xFB, - (byte) 0x0D, (byte) 0x28, (byte) 0x47, (byte) 0x62, (byte) 0x99, (byte) 0xBC, (byte) 0xD3, (byte) 0xF6, - (byte) 0x1A, (byte) 0x3F, (byte) 0x50, (byte) 0x75, (byte) 0x8E, (byte) 0xAB, (byte) 0xC4, (byte) 0xE1, - (byte) 0x17, (byte) 0x32, (byte) 0x5D, (byte) 0x78, (byte) 0x83, (byte) 0xA6, (byte) 0xC9, (byte) 0xEC, - (byte) 0x34, (byte) 0x11, (byte) 0x7E, (byte) 0x5B, (byte) 0xA0, (byte) 0x85, (byte) 0xEA, (byte) 0xCF, - (byte) 0x39, (byte) 0x1C, (byte) 0x73, (byte) 0x56, (byte) 0xAD, (byte) 0x88, (byte) 0xE7, (byte) 0xC2, - (byte) 0x2E, (byte) 0x0B, (byte) 0x64, (byte) 0x41, (byte) 0xBA, (byte) 0x9F, (byte) 0xF0, (byte) 0xD5, - (byte) 0x23, (byte) 0x06, (byte) 0x69, (byte) 0x4C, (byte) 0xB7, (byte) 0x92, (byte) 0xFD, (byte) 0xD8, - (byte) 0x68, (byte) 0x4D, (byte) 0x22, (byte) 0x07, (byte) 0xFC, (byte) 0xD9, (byte) 0xB6, (byte) 0x93, - (byte) 0x65, (byte) 0x40, (byte) 0x2F, (byte) 0x0A, (byte) 0xF1, (byte) 0xD4, (byte) 0xBB, (byte) 0x9E, - (byte) 0x72, (byte) 0x57, (byte) 0x38, (byte) 0x1D, (byte) 0xE6, (byte) 0xC3, (byte) 0xAC, (byte) 0x89, - (byte) 0x7F, (byte) 0x5A, (byte) 0x35, (byte) 0x10, (byte) 0xEB, (byte) 0xCE, (byte) 0xA1, (byte) 0x84, - (byte) 0x5C, (byte) 0x79, (byte) 0x16, (byte) 0x33, (byte) 0xC8, (byte) 0xED, (byte) 0x82, (byte) 0xA7, - (byte) 0x51, (byte) 0x74, (byte) 0x1B, (byte) 0x3E, (byte) 0xC5, (byte) 0xE0, (byte) 0x8F, (byte) 0xAA, - (byte) 0x46, (byte) 0x63, (byte) 0x0C, (byte) 0x29, (byte) 0xD2, (byte) 0xF7, (byte) 0x98, (byte) 0xBD, - (byte) 0x4B, (byte) 0x6E, (byte) 0x01, (byte) 0x24, (byte) 0xDF, (byte) 0xFA, (byte) 0x95, (byte) 0xB0, - (byte) 0xD0, (byte) 0xF5, (byte) 0x9A, (byte) 0xBF, (byte) 0x44, (byte) 0x61, (byte) 0x0E, (byte) 0x2B, - (byte) 0xDD, (byte) 0xF8, (byte) 0x97, (byte) 0xB2, (byte) 0x49, (byte) 0x6C, (byte) 0x03, (byte) 0x26, - (byte) 0xCA, (byte) 0xEF, (byte) 0x80, (byte) 0xA5, (byte) 0x5E, (byte) 0x7B, (byte) 0x14, (byte) 0x31, - (byte) 0xC7, (byte) 0xE2, (byte) 0x8D, (byte) 0xA8, (byte) 0x53, (byte) 0x76, (byte) 0x19, (byte) 0x3C, - (byte) 0xE4, (byte) 0xC1, (byte) 0xAE, (byte) 0x8B, (byte) 0x70, (byte) 0x55, (byte) 0x3A, (byte) 0x1F, - (byte) 0xE9, (byte) 0xCC, (byte) 0xA3, (byte) 0x86, (byte) 0x7D, (byte) 0x58, (byte) 0x37, (byte) 0x12, - (byte) 0xFE, (byte) 0xDB, (byte) 0xB4, (byte) 0x91, (byte) 0x6A, (byte) 0x4F, (byte) 0x20, (byte) 0x05, - (byte) 0xF3, (byte) 0xD6, (byte) 0xB9, (byte) 0x9C, (byte) 0x67, (byte) 0x42, (byte) 0x2D, (byte) 0x08, - (byte) 0xB8, (byte) 0x9D, (byte) 0xF2, (byte) 0xD7, (byte) 0x2C, (byte) 0x09, (byte) 0x66, (byte) 0x43, - (byte) 0xB5, (byte) 0x90, (byte) 0xFF, (byte) 0xDA, (byte) 0x21, (byte) 0x04, (byte) 0x6B, (byte) 0x4E, - (byte) 0xA2, (byte) 0x87, (byte) 0xE8, (byte) 0xCD, (byte) 0x36, (byte) 0x13, (byte) 0x7C, (byte) 0x59, - (byte) 0xAF, (byte) 0x8A, (byte) 0xE5, (byte) 0xC0, (byte) 0x3B, (byte) 0x1E, (byte) 0x71, (byte) 0x54, - (byte) 0x8C, (byte) 0xA9, (byte) 0xC6, (byte) 0xE3, (byte) 0x18, (byte) 0x3D, (byte) 0x52, (byte) 0x77, - (byte) 0x81, (byte) 0xA4, (byte) 0xCB, (byte) 0xEE, (byte) 0x15, (byte) 0x30, (byte) 0x5F, (byte) 0x7A, - (byte) 0x96, (byte) 0xB3, (byte) 0xDC, (byte) 0xF9, (byte) 0x02, (byte) 0x27, (byte) 0x48, (byte) 0x6D, - (byte) 0x9B, (byte) 0xBE, (byte) 0xD1, (byte) 0xF4, (byte) 0x0F, (byte) 0x2A, (byte) 0x45, (byte) 0x60 + (byte) 0x00, (byte) 0x25, (byte) 0x4A, (byte) 0x6F, (byte) 0x94, (byte) 0xB1, (byte) 0xDE, (byte) 0xFB, + (byte) 0x0D, (byte) 0x28, (byte) 0x47, (byte) 0x62, (byte) 0x99, (byte) 0xBC, (byte) 0xD3, (byte) 0xF6, + (byte) 0x1A, (byte) 0x3F, (byte) 0x50, (byte) 0x75, (byte) 0x8E, (byte) 0xAB, (byte) 0xC4, (byte) 0xE1, + (byte) 0x17, (byte) 0x32, (byte) 0x5D, (byte) 0x78, (byte) 0x83, (byte) 0xA6, (byte) 0xC9, (byte) 0xEC, + (byte) 0x34, (byte) 0x11, (byte) 0x7E, (byte) 0x5B, (byte) 0xA0, (byte) 0x85, (byte) 0xEA, (byte) 0xCF, + (byte) 0x39, (byte) 0x1C, (byte) 0x73, (byte) 0x56, (byte) 0xAD, (byte) 0x88, (byte) 0xE7, (byte) 0xC2, + (byte) 0x2E, (byte) 0x0B, (byte) 0x64, (byte) 0x41, (byte) 0xBA, (byte) 0x9F, (byte) 0xF0, (byte) 0xD5, + (byte) 0x23, (byte) 0x06, (byte) 0x69, (byte) 0x4C, (byte) 0xB7, (byte) 0x92, (byte) 0xFD, (byte) 0xD8, + (byte) 0x68, (byte) 0x4D, (byte) 0x22, (byte) 0x07, (byte) 0xFC, (byte) 0xD9, (byte) 0xB6, (byte) 0x93, + (byte) 0x65, (byte) 0x40, (byte) 0x2F, (byte) 0x0A, (byte) 0xF1, (byte) 0xD4, (byte) 0xBB, (byte) 0x9E, + (byte) 0x72, (byte) 0x57, (byte) 0x38, (byte) 0x1D, (byte) 0xE6, (byte) 0xC3, (byte) 0xAC, (byte) 0x89, + (byte) 0x7F, (byte) 0x5A, (byte) 0x35, (byte) 0x10, (byte) 0xEB, (byte) 0xCE, (byte) 0xA1, (byte) 0x84, + (byte) 0x5C, (byte) 0x79, (byte) 0x16, (byte) 0x33, (byte) 0xC8, (byte) 0xED, (byte) 0x82, (byte) 0xA7, + (byte) 0x51, (byte) 0x74, (byte) 0x1B, (byte) 0x3E, (byte) 0xC5, (byte) 0xE0, (byte) 0x8F, (byte) 0xAA, + (byte) 0x46, (byte) 0x63, (byte) 0x0C, (byte) 0x29, (byte) 0xD2, (byte) 0xF7, (byte) 0x98, (byte) 0xBD, + (byte) 0x4B, (byte) 0x6E, (byte) 0x01, (byte) 0x24, (byte) 0xDF, (byte) 0xFA, (byte) 0x95, (byte) 0xB0, + (byte) 0xD0, (byte) 0xF5, (byte) 0x9A, (byte) 0xBF, (byte) 0x44, (byte) 0x61, (byte) 0x0E, (byte) 0x2B, + (byte) 0xDD, (byte) 0xF8, (byte) 0x97, (byte) 0xB2, (byte) 0x49, (byte) 0x6C, (byte) 0x03, (byte) 0x26, + (byte) 0xCA, (byte) 0xEF, (byte) 0x80, (byte) 0xA5, (byte) 0x5E, (byte) 0x7B, (byte) 0x14, (byte) 0x31, + (byte) 0xC7, (byte) 0xE2, (byte) 0x8D, (byte) 0xA8, (byte) 0x53, (byte) 0x76, (byte) 0x19, (byte) 0x3C, + (byte) 0xE4, (byte) 0xC1, (byte) 0xAE, (byte) 0x8B, (byte) 0x70, (byte) 0x55, (byte) 0x3A, (byte) 0x1F, + (byte) 0xE9, (byte) 0xCC, (byte) 0xA3, (byte) 0x86, (byte) 0x7D, (byte) 0x58, (byte) 0x37, (byte) 0x12, + (byte) 0xFE, (byte) 0xDB, (byte) 0xB4, (byte) 0x91, (byte) 0x6A, (byte) 0x4F, (byte) 0x20, (byte) 0x05, + (byte) 0xF3, (byte) 0xD6, (byte) 0xB9, (byte) 0x9C, (byte) 0x67, (byte) 0x42, (byte) 0x2D, (byte) 0x08, + (byte) 0xB8, (byte) 0x9D, (byte) 0xF2, (byte) 0xD7, (byte) 0x2C, (byte) 0x09, (byte) 0x66, (byte) 0x43, + (byte) 0xB5, (byte) 0x90, (byte) 0xFF, (byte) 0xDA, (byte) 0x21, (byte) 0x04, (byte) 0x6B, (byte) 0x4E, + (byte) 0xA2, (byte) 0x87, (byte) 0xE8, (byte) 0xCD, (byte) 0x36, (byte) 0x13, (byte) 0x7C, (byte) 0x59, + (byte) 0xAF, (byte) 0x8A, (byte) 0xE5, (byte) 0xC0, (byte) 0x3B, (byte) 0x1E, (byte) 0x71, (byte) 0x54, + (byte) 0x8C, (byte) 0xA9, (byte) 0xC6, (byte) 0xE3, (byte) 0x18, (byte) 0x3D, (byte) 0x52, (byte) 0x77, + (byte) 0x81, (byte) 0xA4, (byte) 0xCB, (byte) 0xEE, (byte) 0x15, (byte) 0x30, (byte) 0x5F, (byte) 0x7A, + (byte) 0x96, (byte) 0xB3, (byte) 0xDC, (byte) 0xF9, (byte) 0x02, (byte) 0x27, (byte) 0x48, (byte) 0x6D, + (byte) 0x9B, (byte) 0xBE, (byte) 0xD1, (byte) 0xF4, (byte) 0x0F, (byte) 0x2A, (byte) 0x45, (byte) 0x60 }; public DiaconnG8Packet(HasAndroidInjector injector) { @@ -79,6 +79,7 @@ public class DiaconnG8Packet { public boolean success() { return !failed; } + public void setReceived() { received = true; } @@ -170,7 +171,7 @@ public class DiaconnG8Packet { // Start Code Check result = 98; } else if ((bytes[0] == SOP && bytes.length != MSG_LEN) || - (bytes[0] == SOP_BIG && bytes.length != MSG_LEN_BIG)) { + (bytes[0] == SOP_BIG && bytes.length != MSG_LEN_BIG)) { // 패킷 길이 체크 result = 97; } else if (bytes[bytes.length - 1] != getCRC(bytes, bytes.length - 1)) { @@ -180,7 +181,9 @@ public class DiaconnG8Packet { return result; } - public byte[] encode(int msgSeq) { return new byte[0]; } + public byte[] encode(int msgSeq) { + return new byte[0]; + } public static String toHex(byte[] bytes) { @@ -197,7 +200,8 @@ public class DiaconnG8Packet { return sb.toString(); } - public void handleMessage(byte[] data) { } + public void handleMessage(byte[] data) { + } public String getFriendlyName() { return "UNKNOWN_PACKET"; @@ -206,18 +210,18 @@ public class DiaconnG8Packet { public Boolean isSuccInquireResponseResult(int result) { boolean isSuccess = false; switch (result) { - case 16 : - isSuccess = true; + case 16: + isSuccess = true; break; - case 17 : + case 17: aapsLogger.error(LTag.PUMPCOMM, "Packet CRC error"); break; - case 18 : + case 18: aapsLogger.error(LTag.PUMPCOMM, "Parameter error."); break; - case 19 : + case 19: aapsLogger.error(LTag.PUMPCOMM, "Protocol specification error."); break; diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeInquirePacket.kt index 4d0c895d0e..23e0bddeaa 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class DisplayTimeInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -20,7 +19,7 @@ class DisplayTimeInquirePacket( aapsLogger.debug(LTag.PUMPCOMM, "DisplayTimeInquirePacket request") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeInquireResponsePacket.kt index d74cf578bc..521b8b6c08 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeInquireResponsePacket.kt @@ -1,15 +1,14 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** * DisplayTimeInquireResponsePacket */ -class DisplayTimeInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class DisplayTimeInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -27,13 +26,13 @@ class DisplayTimeInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8 } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result2)) { + val result2 = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result2)) { failed = true return } - diaconnG8Pump.lcdOnTimeSec = getByteToInt(bufferData) + diaconnG8Pump.lcdOnTimeSec = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}") aapsLogger.debug(LTag.PUMPCOMM, "lcdOnTimeSec --> ${diaconnG8Pump.lcdOnTimeSec}") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeoutSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeoutSettingPacket.kt index ae28d8a901..c6c31a6207 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeoutSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeoutSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -12,7 +11,7 @@ import javax.inject.Inject class DisplayTimeoutSettingPacket( injector: HasAndroidInjector, private var type: Int -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -21,7 +20,7 @@ class DisplayTimeoutSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "DisplayTimeoutSettingPacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(type.toByte()) // cmd return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeoutSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeoutSettingResponsePacket.kt index 9a9c5fdd4c..d6dd774a40 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeoutSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/DisplayTimeoutSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class DisplayTimeoutSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x8E.toByte() aapsLogger.debug(LTag.PUMPCOMM, "DisplayTimeoutSettingResponsePacket init ") @@ -31,12 +31,12 @@ class DisplayTimeoutSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/IncarnationInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/IncarnationInquirePacket.kt index 217cba50e6..1cbd6ba6dc 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/IncarnationInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/IncarnationInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -12,14 +11,16 @@ import javax.inject.Inject */ class IncarnationInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { + @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x7A aapsLogger.debug(LTag.PUMPCOMM, "IncarnationInquirePacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/IncarnationInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/IncarnationInquireResponsePacket.kt index a5cb594497..388036e829 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/IncarnationInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/IncarnationInquireResponsePacket.kt @@ -1,10 +1,10 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject /** @@ -12,13 +12,14 @@ import javax.inject.Inject */ open class IncarnationInquireResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @Inject lateinit var sp: SP @Inject lateinit var rh: ResourceHelper var result = 0 + init { msgType = 0xBA.toByte() aapsLogger.debug(LTag.PUMPCOMM, "IncarnationInquireResponsePacket init") @@ -33,8 +34,8 @@ open class IncarnationInquireResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result)) { + result = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result)) { failed = true return } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalReportPacket.kt index 92cea372cd..7ec45b3f7d 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalReportPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,9 +10,10 @@ import javax.inject.Inject */ class InjectionBasalReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0xCC.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionBasalReportPacket init ") @@ -28,7 +28,7 @@ class InjectionBasalReportPacket( } else failed = false val bufferData = prefixDecode(data) - diaconnG8Pump.systemBasePattern = getByteToInt(bufferData) + diaconnG8Pump.systemBasePattern = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Pump Report BasalPattern --> ${diaconnG8Pump.systemBasePattern} (1:basic, 2: life1 , 3: life2 , 4: life3 , 5:dr1, 6:dr2) ") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalSettingPacket.kt index 05515f923b..181f19cca0 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,16 +10,17 @@ import javax.inject.Inject */ class InjectionBasalSettingPacket( injector: HasAndroidInjector, - private val pattern:Int -) : DiaconnG8Packet(injector ) { + private val pattern: Int +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x0C.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionBasalSettingPacket init ") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(pattern.toByte()) return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalSettingResponsePacket.kt index 1eae5f8fec..d5e2afabbe 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBasalSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class InjectionBasalSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x8C.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionBasalSettingResponsePacket init ") @@ -31,12 +31,12 @@ class InjectionBasalSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBlockReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBlockReportPacket.kt index 9a72874feb..43ba98c5d4 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBlockReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionBlockReportPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class InjectionBlockReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -32,7 +31,7 @@ class InjectionBlockReportPacket( diaconnG8Pump.injectionBlockGrade = getByteToInt(bufferData) diaconnG8Pump.injectionBlockProcess = getByteToInt(bufferData) diaconnG8Pump.injectionBlockRemainAmount = getShortToInt(bufferData) / 100.0 - diaconnG8Pump.injectionBlockType = getByteToInt(bufferData) + diaconnG8Pump.injectionBlockType = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "injectionBlockGrade --> ${diaconnG8Pump.injectionBlockGrade} (1:info, 2: warning , 3: major , 4: critical)") aapsLogger.debug(LTag.PUMPCOMM, "injectionBlockProcess --> ${diaconnG8Pump.injectionBlockProcess} (1:skip, 2: stop , 3: ignore ) ") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionCancelSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionCancelSettingPacket.kt index f04339b336..ee53197bd4 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionCancelSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionCancelSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -12,7 +11,7 @@ import javax.inject.Inject class InjectionCancelSettingPacket( injector: HasAndroidInjector, private var reqMsgType: Byte, // 명령코드 -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -21,7 +20,7 @@ class InjectionCancelSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "InjectionCancelSettingPacket INIT") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(reqMsgType) return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionCancelSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionCancelSettingResponsePacket.kt index 2d8e6d4076..7cfc14378a 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionCancelSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionCancelSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class InjectionCancelSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0xAB.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionCancelSettingResponsePacket init ") @@ -31,12 +31,12 @@ class InjectionCancelSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusResultReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusResultReportPacket.kt index 6876796e29..2432577bf7 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusResultReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusResultReportPacket.kt @@ -1,16 +1,16 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject /** * InjectionExtendedBolusResultReportPacket */ -class InjectionExtendedBolusResultReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class InjectionExtendedBolusResultReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @Inject lateinit var rxBus: RxBus @@ -34,7 +34,7 @@ class InjectionExtendedBolusResultReportPacket(injector: HasAndroidInjector) : D val result = getByteToInt(bufferData) // 0: success , 1: user stop, 2:fail val settingMinutes = getShortToInt(bufferData) val elapsedTime = getShortToInt(bufferData) - val bolusAmountToBeDelivered = getShortToInt(bufferData) / 100.0 + val bolusAmountToBeDelivered = getShortToInt(bufferData) / 100.0 val deliveredBolusAmount = getShortToInt(bufferData) / 100.0 diaconnG8Pump.isExtendedInProgress = result == 0 diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusSettingPacket.kt index 34f52e4243..e7b891cbee 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -13,16 +12,17 @@ class InjectionExtendedBolusSettingPacket( injector: HasAndroidInjector, private val amount: Int, private val minutes: Int, - private val bcDttm:Long -) : DiaconnG8Packet(injector ) { + private val bcDttm: Long +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x08.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionExtendedBolusSettingPacket init ") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.putShort(minutes.toShort()) buffer.putShort(amount.toShort()) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusSettingResponsePacket.kt index 82a546f961..23c09ad777 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionExtendedBolusSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class InjectionExtendedBolusSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x88.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionExtendedBolusSettingResponsePacket init ") @@ -31,12 +31,12 @@ class InjectionExtendedBolusSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionMealSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionMealSettingPacket.kt index 45e5d98179..29b597155f 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionMealSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionMealSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,17 +10,18 @@ import javax.inject.Inject */ class InjectionMealSettingPacket( injector: HasAndroidInjector, - private val amount:Int, - private val bcDttm:Long -) : DiaconnG8Packet(injector ) { + private val amount: Int, + private val bcDttm: Long +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x06.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionMealSettingPacket init ") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.putShort(amount.toShort()) buffer.putLong(bcDttm) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionMealSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionMealSettingResponsePacket.kt index f128d158b0..2010448578 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionMealSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionMealSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class InjectionMealSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x86.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionMealSettingResponsePacket init ") @@ -31,12 +31,12 @@ class InjectionMealSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionProgressReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionProgressReportPacket.kt index 9e0de742e4..fa85420653 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionProgressReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionProgressReportPacket.kt @@ -1,16 +1,16 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject /** * InjectionProgressReportPacket */ -class InjectionProgressReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class InjectionProgressReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @Inject lateinit var rxBus: RxBus @@ -30,10 +30,10 @@ class InjectionProgressReportPacket(injector: HasAndroidInjector) : DiaconnG8Pac } else failed = false val bufferData = prefixDecode(data) - val setAmount = getShortToInt(bufferData) /100.0 - val injAmount = getShortToInt(bufferData)/100.0 - val speed = getByteToInt(bufferData); - val injProgress = getByteToInt(bufferData) + val setAmount = getShortToInt(bufferData) / 100.0 + val injAmount = getShortToInt(bufferData) / 100.0 + val speed = getByteToInt(bufferData) + val injProgress = getByteToInt(bufferData) diaconnG8Pump.bolusingSetAmount = setAmount diaconnG8Pump.bolusingInjAmount = injAmount diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackInquirePacket.kt index f63259e60e..936f83daa4 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackInquirePacket.kt @@ -1,23 +1,23 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** * InjectionSneckInquirePacket */ -class InjectionSnackInquirePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class InjectionSnackInquirePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x47.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionSnackInquirePacket init ") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { return suffixEncode(prefixEncode(msgType, msgSeq, MSG_CON_END)) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackInquireResponsePacket.kt index d7b2b5dd1f..852efe8b37 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackInquireResponsePacket.kt @@ -1,15 +1,14 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** * InjectionSnackInquireResponsePacket */ -class InjectionSnackInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class InjectionSnackInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -27,9 +26,9 @@ class InjectionSnackInquireResponsePacket(injector: HasAndroidInjector) : Diacon } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) + val result2 = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result2)) { + if (!isSuccInquireResponseResult(result2)) { failed = true return } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackResultReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackResultReportPacket.kt index 0bc11d81de..2e6bfebb79 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackResultReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackResultReportPacket.kt @@ -1,16 +1,16 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject /** * InjectionSnackResultReportPacket */ -class InjectionSnackResultReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class InjectionSnackResultReportPacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @Inject lateinit var rxBus: RxBus @@ -31,15 +31,15 @@ class InjectionSnackResultReportPacket(injector: HasAndroidInjector) : DiaconnG8 val bufferData = prefixDecode(data) val result = getByteToInt(bufferData) - val bolusAmountToBeDelivered = getShortToInt(bufferData)/100.0 - val deliveredBolusAmount = getShortToInt(bufferData)/100.0 + val bolusAmountToBeDelivered = getShortToInt(bufferData) / 100.0 + val deliveredBolusAmount = getShortToInt(bufferData) / 100.0 diaconnG8Pump.bolusAmountToBeDelivered = bolusAmountToBeDelivered diaconnG8Pump.lastBolusAmount = deliveredBolusAmount diaconnG8Pump.lastBolusTime = dateUtil.now() diaconnG8Pump.bolusingTreatment?.insulin = deliveredBolusAmount - if(result == 1) { + if (result == 1) { diaconnG8Pump.bolusStopped = true // 주입 중 취소 처리! } diaconnG8Pump.bolusDone = true // 주입완료 처리! diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackSettingPacket.kt index 359dcf6fb8..89a7c49c65 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,16 +10,17 @@ import javax.inject.Inject */ class InjectionSnackSettingPacket( injector: HasAndroidInjector, - private val amount:Int -) : DiaconnG8Packet(injector ) { + private val amount: Int +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x07.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionSnackSettingPacket init ") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.putShort(amount.toShort()) return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackSettingResponsePacket.kt index 76d63ec51a..0bda30aa7d 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InjectionSnackSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class InjectionSnackSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x87.toByte() aapsLogger.debug(LTag.PUMPCOMM, "InjectionSnackSettingResponsePacket init ") @@ -31,12 +31,12 @@ class InjectionSnackSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InsulinLackReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InsulinLackReportPacket.kt index 0e24692ba8..9cce79ec0b 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InsulinLackReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/InsulinLackReportPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class InsulinLackReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageInquirePacket.kt index 2523a95c01..4c8133f81a 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class LanguageInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -20,7 +19,7 @@ class LanguageInquirePacket( aapsLogger.debug(LTag.PUMPCOMM, "LanguageInquirePacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageInquireResponsePacket.kt index 0c360069f7..75aa8249a1 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageInquireResponsePacket.kt @@ -1,15 +1,14 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** * LanguageInquireResponsePacket */ -class LanguageInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class LanguageInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -27,12 +26,12 @@ class LanguageInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Pac } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result2)) { + val result2 = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result2)) { failed = true return } - diaconnG8Pump.selectedLanguage = getByteToInt(bufferData) + diaconnG8Pump.selectedLanguage = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}") aapsLogger.debug(LTag.PUMPCOMM, "selectedLanguage --> ${diaconnG8Pump.selectedLanguage}") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageSettingPacket.kt index 3b955bbb7f..175924bd24 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -12,7 +11,7 @@ import javax.inject.Inject class LanguageSettingPacket( injector: HasAndroidInjector, private var type: Int -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -21,7 +20,7 @@ class LanguageSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "LanguageSettingPacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(type.toByte()) // 명령코드 return suffixEncode(buffer) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageSettingResponsePacket.kt index a87ce2e9a3..b95e9b51b7 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LanguageSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class LanguageSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0xA0.toByte() aapsLogger.debug(LTag.PUMPCOMM, "LanguageSettingResponsePacket init") @@ -29,15 +29,15 @@ class LanguageSettingResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) + result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LogStatusInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LogStatusInquirePacket.kt index 20563b1fee..71ec9a9b5d 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LogStatusInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LogStatusInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,14 +10,16 @@ import javax.inject.Inject */ class LogStatusInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { + @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x56 aapsLogger.debug(LTag.PUMPCOMM, "LogStatusInquirePacket INIT") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LogStatusInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LogStatusInquireResponsePacket.kt index 321d9e5d70..f3189810d7 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LogStatusInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/LogStatusInquireResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,11 +10,12 @@ import javax.inject.Inject */ open class LogStatusInquireResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x96.toByte() aapsLogger.debug(LTag.PUMPCOMM, "LogStatusInquireResponsePacket init") @@ -30,8 +30,8 @@ open class LogStatusInquireResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result)) { + result = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result)) { failed = true return } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/RejectReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/RejectReportPacket.kt index c7049d8edf..3bf307396f 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/RejectReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/RejectReportPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,11 +10,12 @@ import javax.inject.Inject */ class RejectReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump - var reqMsgType:Int? = null - var reason:Int? = null + var reqMsgType: Int? = null + var reason: Int? = null + init { msgType = 0xE2.toByte() aapsLogger.debug(LTag.PUMPCOMM, "RejectReportPacket init ") @@ -30,8 +30,8 @@ class RejectReportPacket( } else failed = false val bufferData = prefixDecode(data) - reqMsgType = getByteToInt(bufferData) - reason = getByteToInt(bufferData) + reqMsgType = getByteToInt(bufferData) + reason = getByteToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "reqMsgType --> $reqMsgType") aapsLogger.debug(LTag.PUMPCOMM, "Reject Reason --> $reason (6:cancel, 10:timeout) ") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SerialNumInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SerialNumInquirePacket.kt index 147d3683b9..c6d41dd315 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SerialNumInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SerialNumInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -12,14 +11,16 @@ import javax.inject.Inject */ class SerialNumInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { + @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { msgType = 0x6E aapsLogger.debug(LTag.PUMPCOMM, "SeialNumInquirePacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SerialNumInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SerialNumInquireResponsePacket.kt index c648a5e9a9..7e93446c08 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SerialNumInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SerialNumInquireResponsePacket.kt @@ -1,23 +1,22 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject /** * SerialNumInquireResponsePacket */ -class SerialNumInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class SerialNumInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @Inject lateinit var sp: SP @Inject lateinit var rh: ResourceHelper - init { msgType = 0xAE.toByte() aapsLogger.debug(LTag.PUMPCOMM, "SerialNumInquireResponsePacket init") @@ -32,8 +31,8 @@ class SerialNumInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Pa } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result2)) { + val result2 = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result2)) { failed = true return } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SneckLimitInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SneckLimitInquirePacket.kt index dd56f02a4e..3de1569110 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SneckLimitInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SneckLimitInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class SneckLimitInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -20,7 +19,7 @@ class SneckLimitInquirePacket( aapsLogger.debug(LTag.PUMPCOMM, "SneckLimitInquirePacket limit request") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SneckLimitInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SneckLimitInquireResponsePacket.kt index 938971a4aa..4ff27cdc1b 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SneckLimitInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SneckLimitInquireResponsePacket.kt @@ -1,15 +1,14 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** * SneckLimitInquireResponsePacket */ -class SneckLimitInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class SneckLimitInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -27,14 +26,14 @@ class SneckLimitInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8P } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result2)) { + val result2 = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result2)) { failed = true return } - diaconnG8Pump.maxBolus = getShortToInt(bufferData).toDouble() / 100 - diaconnG8Pump.maxBolusePerDay = getShortToInt(bufferData).toDouble() / 100 + diaconnG8Pump.maxBolus = getShortToInt(bufferData).toDouble() / 100 + diaconnG8Pump.maxBolusePerDay = getShortToInt(bufferData).toDouble() / 100 aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}") aapsLogger.debug(LTag.PUMPCOMM, "maxBolusePerDay --> ${diaconnG8Pump.maxBolusePerDay}") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundInquirePacket.kt index 893a76872e..de5589f4c5 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class SoundInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -20,7 +19,7 @@ class SoundInquirePacket( aapsLogger.debug(LTag.PUMPCOMM, "SoundInquirePacket request") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundInquireResponsePacket.kt index 80dd3f531f..ffb8caa3d6 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundInquireResponsePacket.kt @@ -1,15 +1,14 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** * SoundInquireResponsePacket */ -class SoundInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { +class SoundInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -27,14 +26,14 @@ class SoundInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result2)) { + val result2 = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result2)) { failed = true return } - diaconnG8Pump.beepAndAlarm = getByteToInt(bufferData) -1 - diaconnG8Pump.alarmIntensity = getByteToInt(bufferData) -1 + diaconnG8Pump.beepAndAlarm = getByteToInt(bufferData) - 1 + diaconnG8Pump.alarmIntensity = getByteToInt(bufferData) - 1 aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}") aapsLogger.debug(LTag.PUMPCOMM, "beepAndAlarm --> ${diaconnG8Pump.beepAndAlarm}") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundSettingPacket.kt index 0309aee238..2d2117d9b2 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -13,7 +12,7 @@ class SoundSettingPacket( injector: HasAndroidInjector, private var type: Int, // private var intensity: Int // -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -22,7 +21,7 @@ class SoundSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "SoundSettingPacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) buffer.put(type.toByte()) // 명령코드 buffer.put(intensity.toByte()) // 명령코드 diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundSettingResponsePacket.kt index 981d09c630..1ab1185c83 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/SoundSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class SoundSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x8D.toByte() aapsLogger.debug(LTag.PUMPCOMM, "SoundSettingResponsePacket init") @@ -29,15 +29,15 @@ class SoundSettingResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) + result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalInquirePacket.kt index b62219c536..8b3e7dde39 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class TempBasalInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -20,7 +19,7 @@ class TempBasalInquirePacket( aapsLogger.debug(LTag.PUMPCOMM, "TempBasalInquirePacket Init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { return suffixEncode(prefixEncode(msgType, msgSeq, MSG_CON_END)) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalInquireResponsePacket.kt index f84724bccf..fda026c669 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalInquireResponsePacket.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag import javax.inject.Inject /** @@ -11,12 +11,13 @@ import javax.inject.Inject */ open class TempBasalInquireResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x8A.toByte() aapsLogger.debug(LTag.PUMPCOMM, "TempBasalInquireResponsePacket init") @@ -31,8 +32,8 @@ open class TempBasalInquireResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result)) { + result = getByteToInt(bufferData) + if (!isSuccInquireResponseResult(result)) { failed = true return } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalReportPacket.kt index 20cbee15f2..54b82d6438 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalReportPacket.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag import javax.inject.Inject /** @@ -11,7 +11,7 @@ import javax.inject.Inject */ class TempBasalReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var diaconnG8Pump: DiaconnG8Pump diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalSettingPacket.kt index 4f299078c5..ffb0f2f2f9 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -14,7 +13,7 @@ class TempBasalSettingPacket( private var status: Int, // (1:tempbasal running, 2:tempbasal dismissed) private var time: Int, //hour group (1=00~05, 2=06~11, 3=12~17, 4=18~23) private var injectRateRatio: Int -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -23,8 +22,8 @@ class TempBasalSettingPacket( aapsLogger.debug(LTag.PUMPCOMM, "TempBasalSettingPacket Init") } - override fun encode(msgSeq:Int): ByteArray { - val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) + override fun encode(msgSeq: Int): ByteArray { + val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) val apsSecond = 946652400L //fixed value 2000-01-01 00:00:00 (second) buffer.put(status.toByte()) // status buffer.put(time.toByte()) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalSettingResponsePacket.kt index b6c46598d9..f87e2c3f86 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TempBasalSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class TempBasalSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x8A.toByte() aapsLogger.debug(LTag.PUMPCOMM, "TempBasalSettingResponsePacket init") @@ -29,15 +29,15 @@ class TempBasalSettingResponsePacket( } else failed = false val bufferData = prefixDecode(data) - result = getByteToInt(bufferData) + result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeInquirePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeInquirePacket.kt index ca6628bf9a..de092ccbe0 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeInquirePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeInquirePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class TimeInquirePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -20,7 +19,7 @@ class TimeInquirePacket( aapsLogger.debug(LTag.PUMPCOMM, "TimeInquirePacket init") } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) return suffixEncode(buffer) } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeInquireResponsePacket.kt index fa515c5afa..d4da9a266d 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeInquireResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,7 +10,7 @@ import javax.inject.Inject */ class TimeInquireResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -30,7 +29,7 @@ class TimeInquireResponsePacket( val bufferData = prefixDecode(data) val result = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result)) { + if (!isSuccInquireResponseResult(result)) { failed = true return } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeReportPacket.kt index 8b93d64238..0c929ae48e 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeReportPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class TimeReportPacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump - var result =0 + var result = 0 + init { msgType = 0xCF.toByte() aapsLogger.debug(LTag.PUMPCOMM, "TimeReportPacket init ") @@ -29,17 +29,17 @@ class TimeReportPacket( } else failed = false val bufferData = prefixDecode(data) - diaconnG8Pump.year = getByteToInt(bufferData) // yyyy - diaconnG8Pump.month = getByteToInt(bufferData) // month - diaconnG8Pump.day = getByteToInt(bufferData) // day - diaconnG8Pump.hour = getByteToInt(bufferData) // hour + diaconnG8Pump.year = getByteToInt(bufferData) // yyyy + diaconnG8Pump.month = getByteToInt(bufferData) // month + diaconnG8Pump.day = getByteToInt(bufferData) // day + diaconnG8Pump.hour = getByteToInt(bufferData) // hour diaconnG8Pump.minute = getByteToInt(bufferData) // min diaconnG8Pump.second = getByteToInt(bufferData) // second - aapsLogger.debug(LTag.PUMPCOMM, "year --> ${diaconnG8Pump.year }") - aapsLogger.debug(LTag.PUMPCOMM, "month --> ${diaconnG8Pump.month }") - aapsLogger.debug(LTag.PUMPCOMM, "day --> ${diaconnG8Pump.day }") - aapsLogger.debug(LTag.PUMPCOMM, "hour --> ${diaconnG8Pump.hour }") + aapsLogger.debug(LTag.PUMPCOMM, "year --> ${diaconnG8Pump.year}") + aapsLogger.debug(LTag.PUMPCOMM, "month --> ${diaconnG8Pump.month}") + aapsLogger.debug(LTag.PUMPCOMM, "day --> ${diaconnG8Pump.day}") + aapsLogger.debug(LTag.PUMPCOMM, "hour --> ${diaconnG8Pump.hour}") aapsLogger.debug(LTag.PUMPCOMM, "minute --> ${diaconnG8Pump.minute}") aapsLogger.debug(LTag.PUMPCOMM, "second --> ${diaconnG8Pump.second}") } diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeSettingPacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeSettingPacket.kt index c3c2f7e820..d5e39842af 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeSettingPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeSettingPacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import org.joda.time.DateTime import org.joda.time.DateTimeZone import javax.inject.Inject @@ -14,8 +13,8 @@ import javax.inject.Inject class TimeSettingPacket( injector: HasAndroidInjector, private var time: Long = 0, - private var offset:Int = 0 -) : DiaconnG8Packet(injector ) { + private var offset: Int = 0 +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump @@ -25,7 +24,7 @@ class TimeSettingPacket( } - override fun encode(msgSeq:Int): ByteArray { + override fun encode(msgSeq: Int): ByteArray { val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) val date = DateTime(time).withZone(DateTimeZone.UTC) buffer.put((date.year - 2000 and 0xff).toByte()) diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeSettingResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeSettingResponsePacket.kt index 698c55fc31..893efa75be 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeSettingResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/packet/TimeSettingResponsePacket.kt @@ -1,9 +1,8 @@ package info.nightscout.pump.diaconn.packet +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.diaconn.DiaconnG8Pump -import info.nightscout.rx.logging.LTag - import javax.inject.Inject /** @@ -11,10 +10,11 @@ import javax.inject.Inject */ class TimeSettingResponsePacket( injector: HasAndroidInjector -) : DiaconnG8Packet(injector ) { +) : DiaconnG8Packet(injector) { @Inject lateinit var diaconnG8Pump: DiaconnG8Pump var result = 0 + init { msgType = 0x8F.toByte() aapsLogger.debug(LTag.PUMPCOMM, "TimeSettingResponsePacket init ") @@ -31,12 +31,12 @@ class TimeSettingResponsePacket( val bufferData = prefixDecode(data) result = getByteToInt(bufferData) - if(!isSuccSettingResponseResult(result)) { + if (!isSuccSettingResponseResult(result)) { diaconnG8Pump.resultErrorCode = result failed = true return } - diaconnG8Pump.otpNumber = getIntToInt(bufferData) + diaconnG8Pump.otpNumber = getIntToInt(bufferData) aapsLogger.debug(LTag.PUMPCOMM, "Result --> $result") aapsLogger.debug(LTag.PUMPCOMM, "otpNumber --> ${diaconnG8Pump.otpNumber}") diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/service/BLECommonService.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/service/BLECommonService.kt index 4a171a9209..fffea71c31 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/service/BLECommonService.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/service/BLECommonService.kt @@ -16,11 +16,16 @@ import android.content.pm.PackageManager import android.os.Build import android.os.SystemClock import androidx.core.app.ActivityCompat +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.notifyAll import info.nightscout.core.utils.waitMillis -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R import info.nightscout.pump.diaconn.packet.BatteryWarningReportPacket @@ -30,11 +35,6 @@ import info.nightscout.pump.diaconn.packet.DiaconnG8ResponseMessageHashTable import info.nightscout.pump.diaconn.packet.DiaconnG8SettingResponseMessageHashTable import info.nightscout.pump.diaconn.packet.InjectionBlockReportPacket import info.nightscout.pump.diaconn.packet.InsulinLackReportPacket -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import java.util.UUID import java.util.concurrent.ScheduledFuture import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/service/DiaconnG8Service.kt b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/service/DiaconnG8Service.kt index 24c0a03ffc..db79125487 100644 --- a/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/service/DiaconnG8Service.kt +++ b/pump/diaconn/src/main/java/info/nightscout/pump/diaconn/service/DiaconnG8Service.kt @@ -6,22 +6,34 @@ import android.content.Intent import android.os.Binder import android.os.IBinder import android.os.SystemClock +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.BolusProgressData +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventInitializationChanged +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.BolusProgressData -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.diaconn.DiaconnG8Plugin import info.nightscout.pump.diaconn.DiaconnG8Pump import info.nightscout.pump.diaconn.R @@ -58,18 +70,6 @@ import info.nightscout.pump.diaconn.packet.TempBasalSettingPacket import info.nightscout.pump.diaconn.packet.TimeInquirePacket import info.nightscout.pump.diaconn.packet.TimeSettingPacket import info.nightscout.pump.diaconn.pumplog.PumpLogUtil -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventInitializationChanged -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventProfileSwitchChanged -import info.nightscout.rx.events.EventPumpStatusChanged -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 io.reactivex.rxjava3.disposables.CompositeDisposable import org.joda.time.DateTime import org.joda.time.DateTimeZone @@ -509,7 +509,7 @@ class DiaconnG8Service : DaggerService() { if (diaconnG8Pump.isReadyToBolus) { var progressPecent = 0 while (!diaconnG8Pump.bolusDone) { - if(diaconnG8Pump.isPumpVersionGe3_53) { + if (diaconnG8Pump.isPumpVersionGe3_53) { progressPecent = diaconnG8Pump.bolusingInjProgress //bolusingEvent.status = String.format(rh.gs(R.string.waitingforestimatedbolusend), progressPecent) bolusingEvent.status = "볼러스 주입중 ${diaconnG8Pump.bolusingInjAmount}U / ${diaconnG8Pump.bolusingSetAmount}U (${progressPecent}%)" @@ -535,10 +535,10 @@ class DiaconnG8Service : DaggerService() { rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingbolusstatus))) sendMessage(InjectionSnackInquirePacket(injector), 2000) // last bolus // 볼러스 결과 보고패킷에서 처리함. - if(!diaconnG8Pump.isPumpVersionGe3_53) { + if (!diaconnG8Pump.isPumpVersionGe3_53) { bolusingEvent.percent = 100 } - rxBus.send(EventPumpStatusChanged(rh.gs(info.nightscout.interfaces.R.string.disconnecting))) + rxBus.send(EventPumpStatusChanged(rh.gs(app.aaps.interfaces.R.string.disconnecting))) } }) return !start.failed @@ -564,8 +564,8 @@ class DiaconnG8Service : DaggerService() { // temp state check sendMessage(TempBasalInquirePacket(injector)) - val result : DiaconnG8Packet - if(diaconnG8Pump.isPumpVersionGe3_53) { + val result: DiaconnG8Packet + if (diaconnG8Pump.isPumpVersionGe3_53) { val tbrPacket = TempBasalSettingPacket(injector, 3, ((durationInHours * 60) / 15).toInt(), ((absoluteRate * 100) + 1000).toInt()) sendMessage(tbrPacket, 100) result = tbrPacket @@ -606,13 +606,13 @@ class DiaconnG8Service : DaggerService() { } // temp state check - val result:DiaconnG8Packet + val result: DiaconnG8Packet sendMessage(TempBasalInquirePacket(injector)) - if(diaconnG8Pump.isPumpVersionGe3_53) { + if (diaconnG8Pump.isPumpVersionGe3_53) { rxBus.send(EventPumpStatusChanged(rh.gs(R.string.settingtempbasal))) val tbrSettingPacket = TempBasalSettingPacket(injector, 3, 2, ((absoluteRate * 100) + 1000).toInt()) sendMessage(tbrSettingPacket, 100) - result=tbrSettingPacket + result = tbrSettingPacket // otp process if (!processConfirm(tbrSettingPacket.msgType)) return false sendMessage(TempBasalInquirePacket(injector)) @@ -630,7 +630,7 @@ class DiaconnG8Service : DaggerService() { val tbInjectRate = absoluteRate * 100 + 1000 val msgTBR = TempBasalSettingPacket(injector, 1, 2, tbInjectRate.toInt()) sendMessage(msgTBR, 100) - result=msgTBR + result = msgTBR // otp process if (!processConfirm(msgTBR.msgType)) return false } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index de26362fbc..e18ad7de20 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -1,6 +1,36 @@ package info.nightscout.androidaps.plugins.pump.eopatch import android.os.SystemClock +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpPluginBase +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.actions.CustomAction +import app.aaps.interfaces.pump.actions.CustomActionType +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.queue.CustomCommand +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppInitialized +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.utils.TimeChangeType import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager @@ -10,36 +40,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.ui.EopatchOverviewFragment import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpPluginBase -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.Round -import info.nightscout.interfaces.utils.TimeChangeType -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppInitialized -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -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.functions.Consumer import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/RxAction.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/RxAction.kt index fded616a7f..8e798c6006 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/RxAction.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/RxAction.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.pump.eopatch import android.os.SystemClock -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.rx.AapsSchedulers import io.reactivex.rxjava3.core.Scheduler import io.reactivex.rxjava3.core.Single import java.util.concurrent.TimeUnit @@ -16,6 +16,7 @@ class RxAction @Inject constructor( private val aapsSchedulers: AapsSchedulers, private val aapsLogger: AAPSLogger ) { + enum class RxVoid { INSTANCE } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt index 8fddeb9418..b02a2750c7 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt @@ -2,6 +2,18 @@ package info.nightscout.androidaps.plugins.pump.eopatch.alarm import android.content.Context import android.content.Intent +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode.A005 @@ -18,18 +30,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.extension.takeOne import info.nightscout.androidaps.plugins.pump.eopatch.ui.AlarmHelperActivity import info.nightscout.androidaps.plugins.pump.eopatch.vo.Alarms import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.ui.UiInteraction -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 io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -42,12 +42,14 @@ import javax.inject.Singleton import kotlin.math.max interface IAlarmManager { + fun init() fun restartAll() } @Singleton class AlarmManager @Inject constructor() : IAlarmManager { + @Inject lateinit var patchManager: IPatchManager @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var aapsLogger: AAPSLogger @@ -75,17 +77,17 @@ class AlarmManager @Inject constructor() : IAlarmManager { mAlarmProcess = AlarmProcess(patchManager, rxBus) } - override fun init(){ + override fun init() { alarmDisposable = EoPatchRxBus.listen(EventEoPatchAlarm::class.java) .map { it.alarmCodes } - .doOnNext { aapsLogger.info(LTag.PUMP,"EventEoPatchAlarm Received") } + .doOnNext { aapsLogger.info(LTag.PUMP, "EventEoPatchAlarm Received") } .concatMap { Observable.fromArray(it) .observeOn(aapsSchedulers.io) .subscribeOn(aapsSchedulers.main) .doOnNext { alarmCodes -> alarmCodes.forEach { alarmCode -> - aapsLogger.info(LTag.PUMP,"alarmCode: ${alarmCode.name}") + aapsLogger.info(LTag.PUMP, "alarmCode: ${alarmCode.name}") val valid = isValid(alarmCode) if (valid) { if (alarmCode.alarmCategory == AlarmCategory.ALARM || alarmCode == B012) { @@ -95,7 +97,7 @@ class AlarmManager @Inject constructor() : IAlarmManager { } updateState(alarmCode, AlarmState.FIRED) - }else{ + } else { updateState(alarmCode, AlarmState.HANDLE) } } @@ -107,16 +109,18 @@ class AlarmManager @Inject constructor() : IAlarmManager { override fun restartAll() { val now = System.currentTimeMillis() + @Suppress("UNCHECKED_CAST") - val occurredAlarm= pm.getAlarms().occurred.clone() as HashMap + val occurredAlarm = pm.getAlarms().occurred.clone() as HashMap + @Suppress("UNCHECKED_CAST") val registeredAlarm = pm.getAlarms().registered.clone() as HashMap compositeDisposable.clear() - if(occurredAlarm.isNotEmpty()){ + if (occurredAlarm.isNotEmpty()) { EoPatchRxBus.publish(EventEoPatchAlarm(occurredAlarm.keys)) } - if(registeredAlarm.isNotEmpty()){ + if (registeredAlarm.isNotEmpty()) { registeredAlarm.forEach { raEntry -> compositeDisposable.add( mAlarmRegistry.add(raEntry.key, max(OS_REGISTER_GAP, raEntry.value.triggerTimeMilli - now)) @@ -126,20 +130,21 @@ class AlarmManager @Inject constructor() : IAlarmManager { } } - private fun isValid(code: AlarmCode): Boolean{ - return when(code){ + private fun isValid(code: AlarmCode): Boolean { + return when (code) { A005, A016, A020, B012 -> { - aapsLogger.info(LTag.PUMP,"Is $code valid? ${pm.getPatchConfig().hasMacAddress() && pm.getPatchConfig().lifecycleEvent.isSubStepRunning}") + aapsLogger.info(LTag.PUMP, "Is $code valid? ${pm.getPatchConfig().hasMacAddress() && pm.getPatchConfig().lifecycleEvent.isSubStepRunning}") pm.getPatchConfig().hasMacAddress() && pm.getPatchConfig().lifecycleEvent.isSubStepRunning } - else -> { - aapsLogger.info(LTag.PUMP,"Is $code valid? ${pm.getPatchConfig().isActivated}") + + else -> { + aapsLogger.info(LTag.PUMP, "Is $code valid? ${pm.getPatchConfig().isActivated}") pm.getPatchConfig().isActivated } } } - private fun showAlarmDialog(alarmCode: AlarmCode){ + private fun showAlarmDialog(alarmCode: AlarmCode) { val i = Intent(context, AlarmHelperActivity::class.java) i.putExtra("soundid", info.nightscout.core.ui.R.raw.error) i.putExtra("code", alarmCode.name) @@ -171,7 +176,7 @@ class AlarmManager @Inject constructor() : IAlarmManager { } .subscribe { ret -> when (ret) { - IAlarmProcess.ALARM_HANDLED -> { + IAlarmProcess.ALARM_HANDLED -> { if (alarmCode == B001) { pumpSync.syncStopTemporaryBasalWithPumpId( timestamp = dateUtil.now(), @@ -188,7 +193,7 @@ class AlarmManager @Inject constructor() : IAlarmManager { updateState(alarmCode, AlarmState.HANDLE) } - else -> showNotification(alarmCode) + else -> showNotification(alarmCode) } } ) @@ -199,8 +204,8 @@ class AlarmManager @Inject constructor() : IAlarmManager { } - private fun updateState(alarmCode: AlarmCode, state: AlarmState){ - when(state){ + private fun updateState(alarmCode: AlarmCode, state: AlarmState) { + when (state) { AlarmState.REGISTER -> pm.getAlarms().register(alarmCode, 0) AlarmState.FIRED -> pm.getAlarms().occurred(alarmCode) AlarmState.HANDLE -> pm.getAlarms().handle(alarmCode) diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmProcess.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmProcess.kt index 04b7e1e234..11c8f86d12 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmProcess.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmProcess.kt @@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch.alarm import android.content.Context import android.content.DialogInterface import android.content.Intent +import app.aaps.interfaces.rx.bus.RxBus import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode.A002 import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode.A003 @@ -45,14 +46,15 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ui.EopatchActivity.Compan import info.nightscout.androidaps.plugins.pump.eopatch.ui.EopatchActivity.Companion.createIntentForCheckConnection import info.nightscout.androidaps.plugins.pump.eopatch.ui.EopatchActivity.Companion.createIntentForDiscarded import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.CommonDialog -import info.nightscout.rx.bus.RxBus import io.reactivex.rxjava3.core.Single import java.util.concurrent.Callable interface IAlarmProcess { + fun doAction(context: Context, code: AlarmCode): Single companion object { + const val ALARM_UNHANDLED = 0 const val ALARM_PAUSE = 1 const val ALARM_HANDLED = 2 @@ -61,6 +63,7 @@ interface IAlarmProcess { } class AlarmProcess(val patchManager: IPatchManager, val rxBus: RxBus) : IAlarmProcess { + override fun doAction(context: Context, code: AlarmCode): Single { return when (code) { B001 -> resumeBasalAction(context) @@ -68,6 +71,7 @@ class AlarmProcess(val patchManager: IPatchManager, val rxBus: RxBus) : IAlarmPr A020, A022, A023, A034, A041, A042, A043, A044, A106, A107, A108, A116, A117, A118 -> patchDeactivationAction(context) + A007 -> inappropriateTemperatureAction(context) A016 -> needleInsertionErrorAction(context) B000 -> Single.just(IAlarmProcess.ALARM_HANDLED) @@ -83,13 +87,13 @@ class AlarmProcess(val patchManager: IPatchManager, val rxBus: RxBus) : IAlarmPr private fun showCommunicationFailedDialog(onConfirmed: Runnable) { val dialog = CommonDialog().apply { - title = R.string.patch_communication_failed - message = R.string.patch_communication_check_helper_1 - positiveBtn = R.string.string_communication_check - positiveListener = DialogInterface.OnClickListener { _, _ -> - onConfirmed.run() - dismiss() - } + title = R.string.patch_communication_failed + message = R.string.patch_communication_check_helper_1 + positiveBtn = R.string.string_communication_check + positiveListener = DialogInterface.OnClickListener { _, _ -> + onConfirmed.run() + dismiss() + } } rxBus.send(EventDialog(dialog, true)) @@ -105,8 +109,10 @@ class AlarmProcess(val patchManager: IPatchManager, val rxBus: RxBus) : IAlarmPr } else { Single.fromCallable { showCommunicationFailedDialog { - startActivityWithSingleTop(context, - createIntentForCheckConnection(context, goHomeAfterDiscard = true, forceDiscard = true, isAlarmHandling = true)) + startActivityWithSingleTop( + context, + createIntentForCheckConnection(context, goHomeAfterDiscard = true, forceDiscard = true, isAlarmHandling = true) + ) } IAlarmProcess.ALARM_PAUSE } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmRegistry.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmRegistry.kt index 9897559ff8..83a7bd7503 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmRegistry.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmRegistry.kt @@ -5,6 +5,12 @@ import android.app.AlarmManager.AlarmClockInfo import android.app.PendingIntent import android.content.Context import android.content.Intent +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.utils.DateUtil import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus import info.nightscout.androidaps.plugins.pump.eopatch.OsAlarmReceiver import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode.Companion.getUri @@ -12,12 +18,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager import info.nightscout.androidaps.plugins.pump.eopatch.code.PatchLifecycle import info.nightscout.androidaps.plugins.pump.eopatch.core.code.PatchAeCode import info.nightscout.androidaps.plugins.pump.eopatch.event.EventEoPatchAlarm -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/IPatchManager.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/IPatchManager.java index 9d5c5c8dbb..a5d1eaac24 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/IPatchManager.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/IPatchManager.java @@ -1,14 +1,10 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.BleConnectionState; -import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.PatchSelfTestResult; -import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.ScanList; +import app.aaps.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.plugins.pump.eopatch.code.BolusExDuration; import info.nightscout.androidaps.plugins.pump.eopatch.code.DeactivationStatus; import info.nightscout.androidaps.plugins.pump.eopatch.code.PatchLifecycle; - import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BasalScheduleSetResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BaseResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BolusResponse; @@ -17,6 +13,9 @@ import info.nightscout.androidaps.plugins.pump.eopatch.core.response.ComboBolusS import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.TempBasalScheduleSetResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.TemperatureResponse; +import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.BleConnectionState; +import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.PatchSelfTestResult; +import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.ScanList; import info.nightscout.androidaps.plugins.pump.eopatch.vo.BolusCurrent; import info.nightscout.androidaps.plugins.pump.eopatch.vo.NormalBasal; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java index 9330d2392b..b530c2fe64 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java @@ -8,6 +8,17 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventCustomActionsChanged; +import app.aaps.interfaces.rx.events.EventPumpStatusChanged; +import app.aaps.interfaces.rx.events.EventRefreshOverview; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.utils.DateUtil; import info.nightscout.androidaps.plugins.pump.eopatch.R; import info.nightscout.androidaps.plugins.pump.eopatch.RxAction; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; @@ -37,17 +48,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchLifecycleEvent; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventCustomActionsChanged; -import info.nightscout.rx.events.EventPumpStatusChanged; -import info.nightscout.rx.events.EventRefreshOverview; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.shared.sharedPreferences.SP; -import info.nightscout.shared.utils.DateUtil; import io.reactivex.rxjava3.core.Maybe; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.core.Single; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java index 7e1868506e..c43eed7be1 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java @@ -33,6 +33,11 @@ import javax.crypto.KeyAgreement; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.sharedPreferences.SP; import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.ble.task.ActivateTask; @@ -89,11 +94,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.vo.NormalBasal; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; -import info.nightscout.shared.sharedPreferences.SP; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.core.Scheduler; import io.reactivex.rxjava3.core.Single; @@ -250,7 +250,7 @@ public class PatchManagerImpl { return Single.just(true); }) .flatMap(ret -> { - if(!pm.getAlarms().getNeedToStopBeep().isEmpty()) { + if (!pm.getAlarms().getNeedToStopBeep().isEmpty()) { return Observable.fromStream(pm.getAlarms().getNeedToStopBeep().stream()) .flatMapSingle(alarmCode -> stopAeBeep(alarmCode.getAeCode()).doOnSuccess(patchBooleanResponse -> { pm.getAlarms().getNeedToStopBeep().remove(alarmCode); diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchStateManager.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchStateManager.java index 6931f5b1f9..8e8f7b34b3 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchStateManager.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchStateManager.java @@ -5,6 +5,10 @@ import java.util.stream.Stream; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.rx.AapsSchedulers; import info.nightscout.androidaps.plugins.pump.eopatch.ble.task.FetchAlarmTask; import info.nightscout.androidaps.plugins.pump.eopatch.ble.task.InternalSuspendedTask; import info.nightscout.androidaps.plugins.pump.eopatch.ble.task.ReadBolusFinishTimeTask; @@ -14,10 +18,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.vo.BolusCurrent; import info.nightscout.androidaps.plugins.pump.eopatch.vo.NormalBasal; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Maybe; import io.reactivex.rxjava3.schedulers.Schedulers; @@ -69,7 +69,7 @@ public class PatchStateManager { FETCH_ALARM.enqueue(); } - if (newState.isPatchInternalSuspended()){ + if (newState.isPatchInternalSuspended()) { onPatchInternalSuspended(newState); } @@ -208,7 +208,7 @@ public class PatchStateManager { } } - private void onTempBasalCancelState() { + private void onTempBasalCancelState() { TempBasal tempBasal = pm.getTempBasalManager().getStartedBasal(); if (tempBasal != null) { @@ -234,7 +234,7 @@ public class PatchStateManager { } } - void onNormalBasalResumed(boolean tempBasalFinished) { + void onNormalBasalResumed(boolean tempBasalFinished) { NormalBasal normalBasal = pm.getNormalBasalManager().getNormalBasal(); if (normalBasal != null) { pm.getNormalBasalManager().updateBasalStarted(); diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PreferenceManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PreferenceManager.kt index 28566d4e64..816bd533ce 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PreferenceManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PreferenceManager.kt @@ -1,5 +1,9 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.eopatch.GsonHelper import info.nightscout.androidaps.plugins.pump.eopatch.code.PatchLifecycle import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys @@ -10,15 +14,12 @@ import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchLifecycleEvent import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasalManager -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 io.reactivex.rxjava3.core.Observable import javax.inject.Inject import javax.inject.Singleton interface IPreferenceManager { + fun getPatchConfig(): PatchConfig fun getPatchState(): PatchState fun getBolusCurrent(): BolusCurrent @@ -52,12 +53,12 @@ interface IPreferenceManager { fun isInitDone(): Boolean } - /** * patch2 패키지에서 사용하는 프리퍼런스의 작업을 대신 처리하는 클래스 */ @Singleton -class PreferenceManager @Inject constructor(): IPreferenceManager { +class PreferenceManager @Inject constructor() : IPreferenceManager { + @Inject lateinit var sp: SP @Inject lateinit var rxBus: RxBus @Inject lateinit var aapsLogger: AAPSLogger @@ -110,7 +111,7 @@ class PreferenceManager @Inject constructor(): IPreferenceManager { mPatchState = savedState } catch (ex: Exception) { mPatchState = PatchState() - aapsLogger.error(LTag.PUMP, ex.message?:"PatchState load error") + aapsLogger.error(LTag.PUMP, ex.message ?: "PatchState load error") } try { @@ -119,7 +120,7 @@ class PreferenceManager @Inject constructor(): IPreferenceManager { mBolusCurrent = savedBolusCurrent } catch (ex: Exception) { mBolusCurrent = BolusCurrent() - aapsLogger.error(LTag.PUMP, ex.message?:"BolusCurrent load error") + aapsLogger.error(LTag.PUMP, ex.message ?: "BolusCurrent load error") } try { @@ -127,7 +128,7 @@ class PreferenceManager @Inject constructor(): IPreferenceManager { val savedConfig = GsonHelper.sharedGson().fromJson(jsonStr, PatchConfig::class.java) mPatchConfig.update(savedConfig) } catch (ex: Exception) { - aapsLogger.error(LTag.PUMP, ex.message?:"PatchConfig load error") + aapsLogger.error(LTag.PUMP, ex.message ?: "PatchConfig load error") } try { @@ -135,7 +136,7 @@ class PreferenceManager @Inject constructor(): IPreferenceManager { val normalBasalManager = GsonHelper.sharedGson().fromJson(jsonStr, NormalBasalManager::class.java) mNormalBasalMgr.update(normalBasalManager) } catch (ex: Exception) { - aapsLogger.error(LTag.PUMP, ex.message?:"NormalBasal load error") + aapsLogger.error(LTag.PUMP, ex.message ?: "NormalBasal load error") } try { @@ -143,7 +144,7 @@ class PreferenceManager @Inject constructor(): IPreferenceManager { val tempBasalManager = GsonHelper.sharedGson().fromJson(jsonStr, TempBasalManager::class.java) mTempBasalMgr.update(tempBasalManager) } catch (ex: Exception) { - aapsLogger.error(LTag.PUMP, ex.message?:"TempBasal load error") + aapsLogger.error(LTag.PUMP, ex.message ?: "TempBasal load error") } try { @@ -151,15 +152,15 @@ class PreferenceManager @Inject constructor(): IPreferenceManager { val alarms = GsonHelper.sharedGson().fromJson(jsonStr, Alarms::class.java) mAlarms.update(alarms) } catch (ex: Exception) { - aapsLogger.error(LTag.PUMP, ex.message?:"Alarms load error") + aapsLogger.error(LTag.PUMP, ex.message ?: "Alarms load error") } - aapsLogger.info(LTag.PUMP,"Load from PatchConfig preference: $mPatchConfig") - aapsLogger.info(LTag.PUMP,"Load from PatchState preference: $mPatchState") - aapsLogger.info(LTag.PUMP,"Load from BolusCurrent preference: $mBolusCurrent") - aapsLogger.info(LTag.PUMP,"Load from NormalBasal preference: $mNormalBasalMgr") - aapsLogger.info(LTag.PUMP,"Load from TempBasal preference: $mTempBasalMgr") - aapsLogger.info(LTag.PUMP,"Load from Alarms preference: $mAlarms") + aapsLogger.info(LTag.PUMP, "Load from PatchConfig preference: $mPatchConfig") + aapsLogger.info(LTag.PUMP, "Load from PatchState preference: $mPatchState") + aapsLogger.info(LTag.PUMP, "Load from BolusCurrent preference: $mBolusCurrent") + aapsLogger.info(LTag.PUMP, "Load from NormalBasal preference: $mNormalBasalMgr") + aapsLogger.info(LTag.PUMP, "Load from TempBasal preference: $mTempBasalMgr") + aapsLogger.info(LTag.PUMP, "Load from Alarms preference: $mAlarms") initialized = true } @@ -186,7 +187,8 @@ class PreferenceManager @Inject constructor(): IPreferenceManager { mTempBasalMgr.clear() flushTempBasalManager() } - else -> Unit + + else -> Unit } } @@ -249,7 +251,7 @@ class PreferenceManager @Inject constructor(): IPreferenceManager { return mPatchState.observe() } - override fun observeBolusCurrent(): Observable{ + override fun observeBolusCurrent(): Observable { return mBolusCurrent.observe() } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ActivateTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ActivateTask.java index cd36794939..90737f2e1f 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ActivateTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ActivateTask.java @@ -3,11 +3,11 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble.task; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.SetKey; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BaseResponse; import info.nightscout.androidaps.plugins.pump.eopatch.vo.NormalBasal; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchLifecycleEvent; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.schedulers.Schedulers; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/DeactivateTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/DeactivateTask.java index f16018c1b1..862ee6e099 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/DeactivateTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/DeactivateTask.java @@ -5,6 +5,8 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.rx.AapsSchedulers; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.code.DeactivationStatus; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.DeActivation; @@ -12,8 +14,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.core.code.BolusType; import info.nightscout.androidaps.plugins.pump.eopatch.vo.BolusCurrent; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchLifecycleEvent; import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.core.Single; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/FetchAlarmTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/FetchAlarmTask.java index 513ef4cc7e..4a8526ef62 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/FetchAlarmTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/FetchAlarmTask.java @@ -5,11 +5,11 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.rx.bus.RxBus; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmRegistry; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetErrorCodes; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.AeCodeResponse; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -39,8 +39,8 @@ public class FetchAlarmTask extends TaskBase { if (ready) { disposable = getPatchAlarm() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/GetPatchInfoTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/GetPatchInfoTask.java index 3d39730724..6048c9f8ac 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/GetPatchInfoTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/GetPatchInfoTask.java @@ -5,6 +5,7 @@ import java.util.Arrays; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetFirmwareVersion; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetLOT; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetModelName; @@ -19,7 +20,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.core.response.ModelNameRe import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PumpDurationResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.SerialNumberResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.WakeUpTimeResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.schedulers.Schedulers; @@ -50,13 +50,13 @@ public class GetPatchInfoTask extends TaskBase { public Single get() { Single tasks = Single.concat(Arrays.asList( - SET_GLOBAL_TIME.set(), - SERIAL_NUMBER_GET.get().doOnSuccess(this::onSerialNumberResponse), - LOT_NUMBER_GET.get().doOnSuccess(this::onLotNumberResponse), - FIRMWARE_VERSION_GET.get().doOnSuccess(this::onFirmwareResponse), - WAKE_UP_TIME_GET.get().doOnSuccess(this::onWakeupTimeResponse), - PUMP_DURATION_GET.get().doOnSuccess(this::onPumpDurationResponse), - GET_MODEL_NAME.get().doOnSuccess(this::onModelNameResponse))) + SET_GLOBAL_TIME.set(), + SERIAL_NUMBER_GET.get().doOnSuccess(this::onSerialNumberResponse), + LOT_NUMBER_GET.get().doOnSuccess(this::onLotNumberResponse), + FIRMWARE_VERSION_GET.get().doOnSuccess(this::onFirmwareResponse), + WAKE_UP_TIME_GET.get().doOnSuccess(this::onWakeupTimeResponse), + PUMP_DURATION_GET.get().doOnSuccess(this::onPumpDurationResponse), + GET_MODEL_NAME.get().doOnSuccess(this::onModelNameResponse))) .map(BaseResponse::isSuccess) .filter(v -> !v) .first(true); @@ -98,7 +98,7 @@ public class GetPatchInfoTask extends TaskBase { private void onPatchWakeupSuccess(Boolean result) { synchronized (lock) { - pm.flushPatchConfig(); + pm.flushPatchConfig(); } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InfoReminderTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InfoReminderTask.java index 5561812f95..5aa4a7fd2f 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InfoReminderTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InfoReminderTask.java @@ -5,10 +5,10 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.InfoReminderSet; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -38,8 +38,8 @@ public class InfoReminderTask extends TaskBase { if (ready) { disposable = set(pm.getPatchConfig().getInfoReminder()) - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java index 96f6673275..e2fcd6060e 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java @@ -7,16 +7,16 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.interfaces.logging.UserEntryLogger; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.logging.UserEntryLogger; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.queue.Callback; +import app.aaps.interfaces.queue.Command; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.userEntry.UserEntryMapper; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetInternalSuspendTime; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchInternalSuspendTimeResponse; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.queue.Callback; -import info.nightscout.interfaces.queue.Command; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.userEntry.UserEntryMapper; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.subjects.BehaviorSubject; @@ -27,7 +27,7 @@ public class InternalSuspendedTask extends BolusTask { @Inject AAPSLogger aapsLogger; @Inject PumpSync pumpSync; @Inject UserEntryLogger uel; - + private final GetInternalSuspendTime INTERNAL_SUSPEND_TIME_GET; private final BehaviorSubject bolusCheckSubject = BehaviorSubject.create(); private final BehaviorSubject extendedBolusCheckSubject = BehaviorSubject.create(); @@ -40,15 +40,15 @@ public class InternalSuspendedTask extends BolusTask { INTERNAL_SUSPEND_TIME_GET = new GetInternalSuspendTime(); } - private Observable getBolusSubject(){ + private Observable getBolusSubject() { return bolusCheckSubject.hide(); } - private Observable getExtendedBolusSubject(){ + private Observable getExtendedBolusSubject() { return extendedBolusCheckSubject.hide(); } - private Observable getBasalSubject(){ + private Observable getBasalSubject() { return basalCheckSubject.hide(); } @@ -76,7 +76,7 @@ public class InternalSuspendedTask extends BolusTask { extendedBolusCheckSubject.onNext(true); } }); - }else{ + } else { extendedBolusCheckSubject.onNext(true); } @@ -88,12 +88,12 @@ public class InternalSuspendedTask extends BolusTask { basalCheckSubject.onNext(true); } }); - }else{ + } else { basalCheckSubject.onNext(true); } return Observable.zip(getBolusSubject(), getExtendedBolusSubject(), getBasalSubject(), - (bolusReady, extendedBolusReady, basalReady) -> (bolusReady && extendedBolusReady && basalReady)) + (bolusReady, extendedBolusReady, basalReady) -> (bolusReady && extendedBolusReady && basalReady)) .filter(ready -> ready) .flatMap(v -> isReady()) .concatMapSingle(v -> getInternalSuspendTime()) @@ -112,12 +112,12 @@ public class InternalSuspendedTask extends BolusTask { if (ready) { disposable = start(isNowBolusActive, isExtBolusActive, isTempBasalActive) - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(v -> { - bolusCheckSubject.onNext(false); - extendedBolusCheckSubject.onNext(false); - basalCheckSubject.onNext(false); - }); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(v -> { + bolusCheckSubject.onNext(false); + extendedBolusCheckSubject.onNext(false); + basalCheckSubject.onNext(false); + }); } } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/NeedleSensingTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/NeedleSensingTask.java index 818932fed2..f85774a6e4 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/NeedleSensingTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/NeedleSensingTask.java @@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble.task; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmRegistry; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.StartNeedleCheck; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.UpdateConnection; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java index 5d4c5f20fc..ce33f770f3 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java @@ -9,20 +9,20 @@ import javax.annotation.Nullable; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.logging.UserEntryLogger; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.queue.Callback; +import app.aaps.interfaces.queue.Command; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.userEntry.UserEntryMapper; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmRegistry; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalPause; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; -import info.nightscout.interfaces.logging.UserEntryLogger; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.queue.Callback; -import info.nightscout.interfaces.queue.Command; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.userEntry.UserEntryMapper; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.subjects.BehaviorSubject; @@ -49,22 +49,22 @@ public class PauseBasalTask extends BolusTask { BASAL_PAUSE = new BasalPause(); } - private Observable getBolusSubject(){ + private Observable getBolusSubject() { return bolusCheckSubject.hide(); } - private Observable getExtendedBolusSubject(){ + private Observable getExtendedBolusSubject() { return extendedBolusCheckSubject.hide(); } - private Observable getBasalSubject(){ + private Observable getBasalSubject() { return basalCheckSubject.hide(); } public Single pause(float pauseDurationHour, long pausedTimestamp, @Nullable AlarmCode alarmCode) { PatchState patchState = pm.getPatchState(); - if(patchState.isNormalBasalPaused()) + if (patchState.isNormalBasalPaused()) return Single.just(new PatchBooleanResponse(true)); enqueue(TaskFunc.UPDATE_CONNECTION); @@ -84,7 +84,7 @@ public class PauseBasalTask extends BolusTask { extendedBolusCheckSubject.onNext(true); } }); - }else{ + } else { extendedBolusCheckSubject.onNext(true); } @@ -96,12 +96,12 @@ public class PauseBasalTask extends BolusTask { basalCheckSubject.onNext(true); } }); - }else{ + } else { basalCheckSubject.onNext(true); } return Observable.zip(getBolusSubject(), getExtendedBolusSubject(), getBasalSubject(), - (bolusReady, extendedBolusReady, basalReady) -> (bolusReady && extendedBolusReady && basalReady)) + (bolusReady, extendedBolusReady, basalReady) -> (bolusReady && extendedBolusReady && basalReady)) .filter(ready -> ready) .flatMap(v -> isReady()) .concatMapSingle(v -> getSuspendedTime(pausedTimestamp)) @@ -115,7 +115,7 @@ public class PauseBasalTask extends BolusTask { } private Single pauseBasal(float pauseDurationHour, @Nullable AlarmCode alarmCode) { - if(alarmCode == null) { + if (alarmCode == null) { return BASAL_PAUSE.pause(pauseDurationHour) .doOnSuccess(this::checkResponse) .doOnSuccess(v -> onBasalPaused(pauseDurationHour, null)); @@ -131,8 +131,7 @@ public class PauseBasalTask extends BolusTask { if (!pm.getNormalBasalManager().isSuspended()) { if (alarmCode != null) { pm.getPatchConfig().updateNormalBasalPausedSilently(); - } - else { + } else { pm.getPatchConfig().updateNormalBasalPaused(pauseDurationHour); } pm.getNormalBasalManager().updateBasalSuspended(); @@ -140,8 +139,8 @@ public class PauseBasalTask extends BolusTask { pm.flushNormalBasalManager(); pm.flushPatchConfig(); - if((alarmCode == null || alarmCode.getType() == AlarmCode.TYPE_ALERT) && pauseDurationHour != 0) - alarmRegistry.add(AlarmCode.B001, TimeUnit.MINUTES.toMillis((long)(pauseDurationHour * 60)), false).subscribe(); + if ((alarmCode == null || alarmCode.getType() == AlarmCode.TYPE_ALERT) && pauseDurationHour != 0) + alarmRegistry.add(AlarmCode.B001, TimeUnit.MINUTES.toMillis((long) (pauseDurationHour * 60)), false).subscribe(); } enqueue(TaskFunc.UPDATE_CONNECTION); @@ -152,12 +151,12 @@ public class PauseBasalTask extends BolusTask { if (ready) { disposable = pause(pauseDurationHour, pausedTime, alarmCode) - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(v -> { - bolusCheckSubject.onNext(false); - extendedBolusCheckSubject.onNext(false); - basalCheckSubject.onNext(false); - }); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(v -> { + bolusCheckSubject.onNext(false); + extendedBolusCheckSubject.onNext(false); + basalCheckSubject.onNext(false); + }); } } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PrimingTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PrimingTask.java index ae9a300e62..fe19f8899f 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PrimingTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PrimingTask.java @@ -6,10 +6,10 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.StartPriming; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.UpdateConnection; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Observable; @Singleton diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ReadBolusFinishTimeTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ReadBolusFinishTimeTask.java index 5c2a9d7640..0712bab5da 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ReadBolusFinishTimeTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ReadBolusFinishTimeTask.java @@ -5,12 +5,12 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BolusFinishTimeGet; import info.nightscout.androidaps.plugins.pump.eopatch.core.code.BolusType; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BolusFinishTimeResponse; import info.nightscout.androidaps.plugins.pump.eopatch.vo.BolusCurrent; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ReadTempBasalFinishTimeTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ReadTempBasalFinishTimeTask.java index bc9e238a28..3590ec2414 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ReadTempBasalFinishTimeTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ReadTempBasalFinishTimeTask.java @@ -6,9 +6,9 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.TempBasalFinishTimeGet; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.TempBasalFinishTimeResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -38,8 +38,8 @@ public class ReadTempBasalFinishTimeTask extends TaskBase { if (ready) { disposable = read() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ResumeBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ResumeBasalTask.java index 8b61473a8b..5c8e134e67 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ResumeBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/ResumeBasalTask.java @@ -3,13 +3,13 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble.task; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmRegistry; import info.nightscout.androidaps.plugins.pump.eopatch.ble.PatchStateManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalResume; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BaseResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SelfTestTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SelfTestTask.java index d74bb9f4b4..066080a717 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SelfTestTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SelfTestTask.java @@ -5,6 +5,7 @@ import java.util.Arrays; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetGlobalTime; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetTemperature; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetVoltageLevelB4Priming; @@ -12,7 +13,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BatteryVolt import info.nightscout.androidaps.plugins.pump.eopatch.core.response.GlobalTimeResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.TemperatureResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.PatchSelfTestResult; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -32,12 +32,12 @@ public class SelfTestTask extends TaskBase { public Single start() { Single tasks = Single.concat(Arrays.asList( - TEMPERATURE_GET.get() - .map(TemperatureResponse::getResult), - BATTERY_LEVEL_GET_BEFORE_PRIMING.get() - .map(BatteryVoltageLevelPairingResponse::getResult), - GET_GLOBAL_TIME.get(false) - .map(GlobalTimeResponse::getResult))) + TEMPERATURE_GET.get() + .map(TemperatureResponse::getResult), + BATTERY_LEVEL_GET_BEFORE_PRIMING.get() + .map(BatteryVoltageLevelPairingResponse::getResult), + GET_GLOBAL_TIME.get(false) + .map(GlobalTimeResponse::getResult))) .filter(result -> result != PatchSelfTestResult.TEST_SUCCESS) .first(PatchSelfTestResult.TEST_SUCCESS); diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SetGlobalTimeTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SetGlobalTimeTask.java index bda07a4160..a6c38345c2 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SetGlobalTimeTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SetGlobalTimeTask.java @@ -6,11 +6,11 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetGlobalTime; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.SetGlobalTime; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.GlobalTimeResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -62,8 +62,10 @@ public class SetGlobalTimeTask extends TaskBase { if (ready) { disposable = set() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(v -> {}, e -> {}); // Exception 을 사용하기에... + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(v -> { + }, e -> { + }); // Exception 을 사용하기에... } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SetLowReservoirTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SetLowReservoirTask.java index 4924054864..f4b1695e9a 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SetLowReservoirTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/SetLowReservoirTask.java @@ -5,10 +5,10 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.SetLowReservoirLevelAndExpireAlert; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -42,8 +42,8 @@ public class SetLowReservoirTask extends TaskBase { if (ready) { disposable = set(alertSetting, alertTime) - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartBondTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartBondTask.java index 2be183aaf6..978186e6de 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartBondTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartBondTask.java @@ -10,7 +10,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.StartBonding; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -32,7 +31,7 @@ public class StartBondTask extends TaskBase { .doOnNext(this::checkResponse) .concatMap(response -> patch.observeBondState()) .doOnNext(state -> { - if(state == BluetoothDevice.BOND_NONE) throw new Exception(); + if (state == BluetoothDevice.BOND_NONE) throw new Exception(); }) .filter(result -> result == BluetoothDevice.BOND_BONDED) .map(result -> true) diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartCalcBolusTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartCalcBolusTask.java index a6a5b58a14..fef331a872 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartCalcBolusTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartCalcBolusTask.java @@ -3,10 +3,10 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble.task; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BolusStart; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BolusResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -21,10 +21,10 @@ public class StartCalcBolusTask extends BolusTask { } public Single start(DetailedBolusInfo detailedBolusInfo) { - return isReady().concatMapSingle(v -> startBolusImpl((float)detailedBolusInfo.insulin)) + return isReady().concatMapSingle(v -> startBolusImpl((float) detailedBolusInfo.insulin)) .doOnNext(this::checkResponse) .firstOrError() - .doOnSuccess(v -> onSuccess((float)detailedBolusInfo.insulin)) + .doOnSuccess(v -> onSuccess((float) detailedBolusInfo.insulin)) .doOnError(e -> aapsLogger.error(LTag.PUMPCOMM, (e.getMessage() != null) ? e.getMessage() : "StartCalcBolusTask error")); } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartNormalBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartNormalBasalTask.java index ab3a1007ec..c0f4b5673f 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartNormalBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartNormalBasalTask.java @@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble.task; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.rx.AapsSchedulers; import info.nightscout.androidaps.plugins.pump.eopatch.ble.PatchStateManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalScheduleSetBig; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BasalScheduleSetResponse; import info.nightscout.androidaps.plugins.pump.eopatch.vo.NormalBasal; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -30,16 +30,16 @@ public class StartNormalBasalTask extends TaskBase { public Single startJob(NormalBasal basal) { return BASAL_SCHEDULE_SET_BIG.set(basal.getDoseUnitPerSegmentArray()) - .doOnSuccess(this::checkResponse) - .observeOn(aapsSchedulers.getIo()) - .doOnSuccess(v -> onStartNormalBasalResponse(v, basal)) - .doOnError(e -> aapsLogger.error(LTag.PUMPCOMM, (e.getMessage() != null) ? e.getMessage() : "StartNormalBasalTask error")); + .doOnSuccess(this::checkResponse) + .observeOn(aapsSchedulers.getIo()) + .doOnSuccess(v -> onStartNormalBasalResponse(v, basal)) + .doOnError(e -> aapsLogger.error(LTag.PUMPCOMM, (e.getMessage() != null) ? e.getMessage() : "StartNormalBasalTask error")); } private void onStartNormalBasalResponse(BasalScheduleSetResponse response, NormalBasal basal) { long timeStamp = response.getTimestamp(); - patchStateManager.onBasalStarted(basal, timeStamp+1000); + patchStateManager.onBasalStarted(basal, timeStamp + 1000); pm.getNormalBasalManager().setNormalBasal(basal); pm.flushNormalBasalManager(); diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartQuickBolusTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartQuickBolusTask.java index 483ef35cef..2ced516cbe 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartQuickBolusTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartQuickBolusTask.java @@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble.task; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.code.BolusExDuration; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BolusStart; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.ComboBolusStart; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.ExtBolusStart; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BolusResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartTempBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartTempBasalTask.java index a311f8294a..82e647c940 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartTempBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartTempBasalTask.java @@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble.task; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.rx.AapsSchedulers; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.TempBasalScheduleStart; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.TempBasalScheduleSetResponse; import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java index b7ed078622..bfe4efb0e2 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java @@ -7,17 +7,17 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.interfaces.logging.UserEntryLogger; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.logging.UserEntryLogger; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.queue.Callback; +import app.aaps.interfaces.queue.Command; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.userEntry.UserEntryMapper; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalStop; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BasalStopResponse; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.queue.Callback; -import info.nightscout.interfaces.queue.Command; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.userEntry.UserEntryMapper; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.subjects.BehaviorSubject; @@ -44,15 +44,15 @@ public class StopBasalTask extends TaskBase { BASAL_STOP = new BasalStop(); } - private Observable getBolusSebject(){ + private Observable getBolusSebject() { return bolusCheckSubject.hide(); } - private Observable getExbolusSebject(){ + private Observable getExbolusSebject() { return exbolusCheckSubject.hide(); } - private Observable getBasalSebject(){ + private Observable getBasalSebject() { return basalCheckSubject.hide(); } @@ -73,7 +73,7 @@ public class StopBasalTask extends TaskBase { exbolusCheckSubject.onNext(true); } }); - }else{ + } else { exbolusCheckSubject.onNext(true); } @@ -85,15 +85,15 @@ public class StopBasalTask extends TaskBase { basalCheckSubject.onNext(true); } }); - }else{ + } else { basalCheckSubject.onNext(true); } return Observable.zip(getBolusSebject(), getExbolusSebject(), getBasalSebject(), (bolusReady, exbolusReady, basalReady) - -> (bolusReady && exbolusReady && basalReady)) + -> (bolusReady && exbolusReady && basalReady)) .filter(ready -> ready) .flatMap(v -> isReady()) - .concatMapSingle(v -> BASAL_STOP.stop()) + .concatMapSingle(v -> BASAL_STOP.stop()) .doOnNext(this::checkResponse) .doOnNext(v -> updateConnectionTask.enqueue()) .firstOrError() @@ -105,12 +105,12 @@ public class StopBasalTask extends TaskBase { if (ready) { disposable = stop() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(v -> { - bolusCheckSubject.onNext(false); - exbolusCheckSubject.onNext(false); - basalCheckSubject.onNext(false); - }); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(v -> { + bolusCheckSubject.onNext(false); + exbolusCheckSubject.onNext(false); + basalCheckSubject.onNext(false); + }); } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopComboBolusTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopComboBolusTask.java index 86bd9f9c0d..02ad3fe059 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopComboBolusTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopComboBolusTask.java @@ -5,12 +5,12 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BolusStop; import info.nightscout.androidaps.plugins.pump.eopatch.core.code.PatchBleResultCode; import info.nightscout.androidaps.plugins.pump.eopatch.core.define.IPatchConstant; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BolusStopResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.ComboBolusStopResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -34,9 +34,9 @@ public class StopComboBolusTask extends BolusTask { public Single stopJob() { return Single.zip( - BOLUS_STOP.stop(IPatchConstant.EXT_BOLUS_ID), - BOLUS_STOP.stop(IPatchConstant.NOW_BOLUS_ID), - (ext, now) -> createStopComboBolusResponse(now, ext)); + BOLUS_STOP.stop(IPatchConstant.EXT_BOLUS_ID), + BOLUS_STOP.stop(IPatchConstant.NOW_BOLUS_ID), + (ext, now) -> createStopComboBolusResponse(now, ext)); } private ComboBolusStopResponse createStopComboBolusResponse(BolusStopResponse now, BolusStopResponse ext) { @@ -71,8 +71,8 @@ public class StopComboBolusTask extends BolusTask { if (ready) { disposable = stop() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopExtBolusTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopExtBolusTask.java index 28c714271a..40e9914cf5 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopExtBolusTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopExtBolusTask.java @@ -5,10 +5,10 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BolusStop; import info.nightscout.androidaps.plugins.pump.eopatch.core.define.IPatchConstant; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BolusStopResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -28,8 +28,8 @@ public class StopExtBolusTask extends BolusTask { public Single stopJob() { return BOLUS_STOP.stop(IPatchConstant.EXT_BOLUS_ID) - .doOnSuccess(this::checkResponse) - .doOnSuccess(this::onExtBolusStopped); + .doOnSuccess(this::checkResponse) + .doOnSuccess(this::onExtBolusStopped); } @@ -43,8 +43,8 @@ public class StopExtBolusTask extends BolusTask { if (ready) { disposable = stop() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopNowBolusTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopNowBolusTask.java index 9a9c719d69..3e4514b5a1 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopNowBolusTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopNowBolusTask.java @@ -5,11 +5,11 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.rx.AapsSchedulers; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BolusStop; import info.nightscout.androidaps.plugins.pump.eopatch.core.define.IPatchConstant; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BolusStopResponse; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -33,8 +33,8 @@ public class StopNowBolusTask extends BolusTask { public Single stopJob() { return BOLUS_STOP.stop(IPatchConstant.NOW_BOLUS_ID) - .doOnSuccess(this::checkResponse) - .doOnSuccess(this::onNowBolusStopped); + .doOnSuccess(this::checkResponse) + .doOnSuccess(this::onNowBolusStopped); } private void onNowBolusStopped(BolusStopResponse response) { @@ -47,8 +47,8 @@ public class StopNowBolusTask extends BolusTask { if (ready) { disposable = stop() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopTempBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopTempBasalTask.java index f19344de4b..528635d3a8 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopTempBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopTempBasalTask.java @@ -5,9 +5,9 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.TempBasalScheduleStop; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -28,8 +28,8 @@ public class StopTempBasalTask extends TaskBase { public Single stopJob() { return TEMP_BASAL_SCHEDULE_STOP.stop() - .doOnSuccess(this::checkResponse) - .doOnSuccess(v -> onTempBasalCanceled()); + .doOnSuccess(this::checkResponse) + .doOnSuccess(v -> onTempBasalCanceled()); } private void onTempBasalCanceled() { @@ -41,8 +41,8 @@ public class StopTempBasalTask extends TaskBase { if (ready) { disposable = stop() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/TaskBase.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/TaskBase.java index 0e18290e7f..90a3570328 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/TaskBase.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/TaskBase.java @@ -5,6 +5,7 @@ import java.util.HashMap; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.Patch; import info.nightscout.androidaps.plugins.pump.eopatch.core.exception.NoActivatedPatchException; @@ -12,7 +13,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.core.exception.PatchDisco import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BaseResponse; import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.BleConnectionState; import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.IBleDevice; -import info.nightscout.rx.logging.AAPSLogger; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.disposables.Disposable; @@ -53,7 +53,7 @@ public class TaskBase { protected void checkResponse(BaseResponse response) throws Exception { if (!response.isSuccess()) { - throw new Exception("Response failed! - "+response.resultCode.name()); + throw new Exception("Response failed! - " + response.resultCode.name()); } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/TaskQueue.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/TaskQueue.java index f11baed4bb..16fad1b83c 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/TaskQueue.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/TaskQueue.java @@ -7,9 +7,9 @@ import java.util.Queue; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.rx.AapsSchedulers; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.subjects.BehaviorSubject; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/UpdateConnectionTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/UpdateConnectionTask.java index c90abe5bd5..89eb09b008 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/UpdateConnectionTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/UpdateConnectionTask.java @@ -5,11 +5,11 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.eopatch.ble.PatchStateManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.UpdateConnection; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.UpdateConnectionResponse; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Single; @Singleton @@ -47,8 +47,8 @@ public class UpdateConnectionTask extends TaskBase { if (ready) { disposable = update() - .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) - .subscribe(); + .timeout(TASK_ENQUEUE_TIME_OUT, TimeUnit.SECONDS) + .subscribe(); } } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/event/EoPatchEvents.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/event/EoPatchEvents.kt index 428bba7075..027f13236f 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/event/EoPatchEvents.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/event/EoPatchEvents.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.eopatch.event import androidx.annotation.StringRes import androidx.fragment.app.DialogFragment +import app.aaps.interfaces.rx.events.Event import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode -import info.nightscout.rx.events.Event class EventEoPatchAlarm(var alarmCodes: Set, var isFirst: Boolean = false) : Event() class EventDialog(val dialog: DialogFragment, val show: Boolean) : Event() diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/extension/ObservableExtension.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/extension/ObservableExtension.kt index 56094cb569..e96722f237 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/extension/ObservableExtension.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/extension/ObservableExtension.kt @@ -1,33 +1,33 @@ package info.nightscout.androidaps.plugins.pump.eopatch.extension -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.disposables.Disposable import io.reactivex.rxjava3.schedulers.Schedulers -fun Observable.observeOnMainThread(): Observable = observeOn(AndroidSchedulers.mainThread()) +fun Observable.observeOnMainThread(): Observable = observeOn(AndroidSchedulers.mainThread()) -fun Observable.observeOnComputation(): Observable = observeOn(Schedulers.computation()) +fun Observable.observeOnComputation(): Observable = observeOn(Schedulers.computation()) -fun Observable.observeOnIo(): Observable = observeOn(Schedulers.io()) +fun Observable.observeOnIo(): Observable = observeOn(Schedulers.io()) -fun Observable.subscribeEmpty(): Disposable = subscribe({}, {}, {}) +fun Observable.subscribeEmpty(): Disposable = subscribe({}, {}, {}) -fun Observable.subscribeEmpty(onSuccess: (T) -> Unit): Disposable = subscribe(onSuccess, {}, {}) +fun Observable.subscribeEmpty(onSuccess: (T) -> Unit): Disposable = subscribe(onSuccess, {}, {}) -fun Observable.subscribeEmpty(onSuccess: (T) -> Unit, onError: (Throwable) -> Unit): Disposable = subscribe(onSuccess, onError, {}) +fun Observable.subscribeEmpty(onSuccess: (T) -> Unit, onError: (Throwable) -> Unit): Disposable = subscribe(onSuccess, onError, {}) -fun Observable.subscribeDefault(aapsLogger: AAPSLogger): Disposable = subscribe({ aapsLogger.debug(LTag.PUMP, "onSuccess") }, { aapsLogger.error(LTag.PUMP, "onError", it) }, { +fun Observable.subscribeDefault(aapsLogger: AAPSLogger): Disposable = subscribe({ aapsLogger.debug(LTag.PUMP, "onSuccess") }, { aapsLogger.error(LTag.PUMP, "onError", it) }, { aapsLogger.debug(LTag.PUMP, "onComplete") }) -fun Observable.subscribeDefault(aapsLogger: AAPSLogger, onSuccess: (T) -> Unit): Disposable = +fun Observable.subscribeDefault(aapsLogger: AAPSLogger, onSuccess: (T) -> Unit): Disposable = subscribe(onSuccess, { aapsLogger.error(LTag.PUMP, "onError", it) }, { aapsLogger.debug(LTag.PUMP, "onComplete") }) -fun Observable.subscribeDefault(aapsLogger: AAPSLogger, onSuccess: (T) -> Unit, onError: (Throwable) -> Unit): Disposable = +fun Observable.subscribeDefault(aapsLogger: AAPSLogger, onSuccess: (T) -> Unit, onError: (Throwable) -> Unit): Disposable = subscribe(onSuccess, onError, { aapsLogger.debug(LTag.PUMP, "onComplete") }) -fun Observable.with(): Observable = subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) \ No newline at end of file +fun Observable.with(): Observable = subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) \ No newline at end of file diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/extension/SingleExtension.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/extension/SingleExtension.kt index 305fd0982e..88d40adf47 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/extension/SingleExtension.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/extension/SingleExtension.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps.plugins.pump.eopatch.extension -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.Disposable import io.reactivex.rxjava3.schedulers.Schedulers -fun Single.subscribeDefault(aapsLogger: AAPSLogger, onSuccess: (T) -> Unit): Disposable = subscribe(onSuccess) { +fun Single.subscribeDefault(aapsLogger: AAPSLogger, onSuccess: (T) -> Unit): Disposable = subscribe(onSuccess) { aapsLogger.error(LTag.PUMP, "onError", it) } -fun Single.with(): Single = subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) +fun Single.with(): Single = subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt index f459b3e28a..5c14d97201 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt @@ -2,6 +2,9 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui import android.os.Bundle import androidx.appcompat.app.AlertDialog +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode import info.nightscout.androidaps.plugins.pump.eopatch.event.EventDialog import info.nightscout.androidaps.plugins.pump.eopatch.event.EventProgressDialog @@ -9,14 +12,12 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.AlarmDialog import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.ProgressDialogHelper import info.nightscout.core.ui.R import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject class AlarmHelperActivity : TranslatedDaggerAppCompatActivity() { - @Inject lateinit var sp : SP + + @Inject lateinit var sp: SP @Inject lateinit var rxBus: RxBus @Inject lateinit var aapsSchedulers: AapsSchedulers @@ -30,40 +31,41 @@ class AlarmHelperActivity : TranslatedDaggerAppCompatActivity() { val alarmDialog = AlarmDialog() alarmDialog.helperActivity = this - intent.getStringExtra("code")?.let{ + intent.getStringExtra("code")?.let { alarmDialog.code = it alarmDialog.alarmCode = AlarmCode.fromStringToCode(it) } - alarmDialog.status = intent.getStringExtra("status")?:"" + alarmDialog.status = intent.getStringExtra("status") ?: "" alarmDialog.sound = intent.getIntExtra("soundid", R.raw.error) - alarmDialog.title = intent.getStringExtra("title")?:"" - if(alarmDialog.code != null) + alarmDialog.title = intent.getStringExtra("title") ?: "" + if (alarmDialog.code != null) alarmDialog.show(supportFragmentManager, "Alarm") - disposable.add(rxBus - .toObservable(EventProgressDialog::class.java) - .observeOn(aapsSchedulers.main) - .subscribe({ - if(it.show){ - showProgressDialog(it.resId) - }else{ - dismissProgressDialog() - } - }, { }) + disposable.add( + rxBus + .toObservable(EventProgressDialog::class.java) + .observeOn(aapsSchedulers.main) + .subscribe({ + if (it.show) { + showProgressDialog(it.resId) + } else { + dismissProgressDialog() + } + }, { }) ) - disposable.add(rxBus - .toObservable(EventDialog::class.java) - .observeOn(aapsSchedulers.main) - .subscribe({ - if(it.show) it.dialog.show(supportFragmentManager, "") - }, { }) + disposable.add( + rxBus + .toObservable(EventDialog::class.java) + .observeOn(aapsSchedulers.main) + .subscribe({ + if (it.show) it.dialog.show(supportFragmentManager, "") + }, { }) ) } - - private fun showProgressDialog(resId: Int){ + private fun showProgressDialog(resId: Int) { if (mProgressDialog == null && resId != 0) { mProgressDialog = ProgressDialogHelper.get(this, getString(resId)).apply { setCancelable(false) @@ -72,7 +74,7 @@ class AlarmHelperActivity : TranslatedDaggerAppCompatActivity() { } } - private fun dismissProgressDialog(){ + private fun dismissProgressDialog() { mProgressDialog?.dismiss() mProgressDialog = null } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt index 06879a9cf7..70ff795754 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt @@ -7,9 +7,9 @@ import androidx.annotation.LayoutRes import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.rx.AapsSchedulers import info.nightscout.androidaps.plugins.pump.eopatch.dagger.EopatchPluginQualifier import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.rx.AapsSchedulers import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject @@ -35,7 +35,7 @@ abstract class EoBaseActivity : TranslatedDaggerAppCompatAc } override fun back() { - if(supportFragmentManager.backStackEntryCount == 0) { + if (supportFragmentManager.backStackEntryCount == 0) { finish() } else { supportFragmentManager.popBackStack() diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchOverviewFragment.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchOverviewFragment.kt index 9d07f0306f..ed745306c9 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchOverviewFragment.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EopatchOverviewFragment.kt @@ -6,6 +6,9 @@ import android.view.View import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.contract.ActivityResultContracts import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.code.EventType @@ -15,13 +18,11 @@ import info.nightscout.androidaps.plugins.pump.eopatch.databinding.FragmentEopat import info.nightscout.androidaps.plugins.pump.eopatch.extension.takeOne import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchOverviewViewModel import info.nightscout.core.ui.toast.ToastUtils -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject -class EopatchOverviewFragment: EoBaseFragment() { +class EopatchOverviewFragment : EoBaseFragment() { + @Inject lateinit var rxBus: RxBus @Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var aapsLogger: AAPSLogger @@ -49,30 +50,31 @@ class EopatchOverviewFragment: EoBaseFragment() EventType.ACTIVATION_CLICKED -> requireContext().apply { startActivity(EopatchActivity.createIntentFromMenu(this, PatchStep.WAKE_UP)) } EventType.DEACTIVATION_CLICKED -> requireContext().apply { startActivity(EopatchActivity.createIntentForChangePatch(this)) } EventType.SUSPEND_CLICKED -> suspend() - EventType.RESUME_CLICKED -> resume() - EventType.INVALID_BASAL_RATE -> ToastUtils.infoToast(requireContext(), R.string.invalid_basal_rate) - EventType.PROFILE_NOT_SET -> ToastUtils.infoToast(requireContext(), R.string.no_profile_selected) + EventType.RESUME_CLICKED -> resume() + EventType.INVALID_BASAL_RATE -> ToastUtils.infoToast(requireContext(), R.string.invalid_basal_rate) + EventType.PROFILE_NOT_SET -> ToastUtils.infoToast(requireContext(), R.string.no_profile_selected) EventType.PAUSE_BASAL_SUCCESS -> ToastUtils.infoToast(requireContext(), R.string.string_suspended_insulin_delivery_message) - EventType.PAUSE_BASAL_FAILED -> ToastUtils.errorToast(requireContext(), R.string.string_pause_failed) + EventType.PAUSE_BASAL_FAILED -> ToastUtils.errorToast(requireContext(), R.string.string_pause_failed) EventType.RESUME_BASAL_SUCCESS -> ToastUtils.infoToast(requireContext(), R.string.string_resumed_insulin_delivery_message) - EventType.RESUME_BASAL_FAILED -> ToastUtils.errorToast(requireContext(), R.string.string_resume_failed) - else -> Unit + EventType.RESUME_BASAL_FAILED -> ToastUtils.errorToast(requireContext(), R.string.string_resume_failed) + else -> Unit } } - resultLauncherForResume = registerForActivityResult(ActivityResultContracts.StartActivityForResult()){ + resultLauncherForResume = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { when (it.resultCode) { DaggerAppCompatActivity.RESULT_OK -> resumeBasal() DaggerAppCompatActivity.RESULT_CANCELED -> ToastUtils.errorToast(requireContext(), R.string.string_resume_failed) } } - resultLauncherForPause = registerForActivityResult(ActivityResultContracts.StartActivityForResult()){ + resultLauncherForPause = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { when (it.resultCode) { DaggerAppCompatActivity.RESULT_OK -> { pauseBasal(pauseDuration) pauseDuration = 0.5f } + DaggerAppCompatActivity.RESULT_CANCELED -> ToastUtils.errorToast(requireContext(), R.string.string_pause_failed) } } @@ -132,7 +134,7 @@ class EopatchOverviewFragment: EoBaseFragment() private fun openPauseTimePicker() { binding.viewmodel?.apply { - activity?.let{ + activity?.let { val builder = info.nightscout.core.ui.dialogs.AlertDialogHelper.Builder(it) val listArr = requireContext().resources.getStringArray(R.array.suspend_duration_array) var select = 0 @@ -156,7 +158,7 @@ class EopatchOverviewFragment: EoBaseFragment() } } - private fun getSuspendDialogText(): String{ + private fun getSuspendDialogText(): String { binding.viewmodel?.apply { val isBolusActive = patchManager.patchState.isBolusActive val isTempBasalActive = patchManager.patchState.isTempBasalActive diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/ActivationNotCompleteDialog.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/ActivationNotCompleteDialog.kt index 6af969105e..fc87d41acc 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/ActivationNotCompleteDialog.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/ActivationNotCompleteDialog.kt @@ -6,14 +6,14 @@ import android.view.View import android.view.ViewGroup import android.view.Window import android.view.WindowManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.plugins.pump.eopatch.bindingadapters.setOnSafeClickListener import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager import info.nightscout.androidaps.plugins.pump.eopatch.databinding.DialogCommonBinding import info.nightscout.androidaps.plugins.pump.eopatch.ui.DialogHelperActivity import info.nightscout.androidaps.plugins.pump.eopatch.ui.EopatchActivity -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject class ActivationNotCompleteDialog : DaggerDialogFragment() { @@ -29,8 +29,10 @@ class ActivationNotCompleteDialog : DaggerDialogFragment() { private var _binding: DialogCommonBinding? = null private val binding get() = _binding!! - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { dialog?.window?.requestFeature(Window.FEATURE_NO_TITLE) dialog?.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN) isCancelable = false diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt index d02bd53812..e0935b2ed9 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt @@ -8,6 +8,11 @@ import android.view.View import android.view.ViewGroup import android.view.Window import android.view.WindowManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmProcess @@ -18,11 +23,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager import info.nightscout.androidaps.plugins.pump.eopatch.databinding.DialogAlarmBinding import info.nightscout.androidaps.plugins.pump.eopatch.ui.AlarmHelperActivity import info.nightscout.core.ui.R -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.Disposable import javax.inject.Inject @@ -52,8 +52,10 @@ class AlarmDialog : DaggerDialogFragment() { private var isHolding = false private var isMute = false - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { mAlarmProcess = AlarmProcess(patchManager, rxBus) dialog?.window?.requestFeature(Window.FEATURE_NO_TITLE) @@ -84,25 +86,25 @@ class AlarmDialog : DaggerDialogFragment() { alarmCode?.let { ac -> mAlarmProcess.doAction(requireContext(), ac) .subscribeOn(aapsSchedulers.io) - .subscribe ({ ret -> - aapsLogger.debug("Alarm processing result :${ret}") - if (ret == IAlarmProcess.ALARM_HANDLED || ret == IAlarmProcess.ALARM_HANDLED_BUT_NEED_STOP_BEEP) { - if(ret == IAlarmProcess.ALARM_HANDLED_BUT_NEED_STOP_BEEP){ - pm.getAlarms().needToStopBeep.add(ac) - } - alarmCode?.let{ - patchManager.preferenceManager.getAlarms().handle(it) - patchManager.preferenceManager.flushAlarms() - } - dismiss() - }else if (ret == IAlarmProcess.ALARM_PAUSE) { - isHolding = true - }else if (ret == IAlarmProcess.ALARM_UNHANDLED) { - if(!isMute){ - startAlarm("ALARM_UNHANDLED") - } - } - }, { t -> aapsLogger.error("${t.printStackTrace()}") }) + .subscribe({ ret -> + aapsLogger.debug("Alarm processing result :${ret}") + if (ret == IAlarmProcess.ALARM_HANDLED || ret == IAlarmProcess.ALARM_HANDLED_BUT_NEED_STOP_BEEP) { + if (ret == IAlarmProcess.ALARM_HANDLED_BUT_NEED_STOP_BEEP) { + pm.getAlarms().needToStopBeep.add(ac) + } + alarmCode?.let { + patchManager.preferenceManager.getAlarms().handle(it) + patchManager.preferenceManager.flushAlarms() + } + dismiss() + } else if (ret == IAlarmProcess.ALARM_PAUSE) { + isHolding = true + } else if (ret == IAlarmProcess.ALARM_UNHANDLED) { + if (!isMute) { + startAlarm("ALARM_UNHANDLED") + } + } + }, { t -> aapsLogger.error("${t.printStackTrace()}") }) } stopAlarm("OK clicked") } @@ -122,7 +124,7 @@ class AlarmDialog : DaggerDialogFragment() { disposable = patchManager.observePatchLifeCycle() .observeOn(aapsSchedulers.main) .subscribe { - if(it.isShutdown) { + if (it.isShutdown) { activity?.finish() } } @@ -143,7 +145,7 @@ class AlarmDialog : DaggerDialogFragment() { override fun onResume() { super.onResume() - if(isHolding && !isMute){ + if (isHolding && !isMute) { startAlarm("onResume") } binding.status.text = status diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/CommonDialog.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/CommonDialog.kt index 7641a96226..26acf5623a 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/CommonDialog.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/CommonDialog.kt @@ -3,9 +3,9 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs import android.app.Dialog import android.content.DialogInterface import android.os.Bundle +import app.aaps.interfaces.logging.AAPSLogger import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.plugins.pump.eopatch.R -import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject class CommonDialog : DaggerDialogFragment() { @@ -21,19 +21,19 @@ class CommonDialog : DaggerDialogFragment() { var negativeListener: DialogInterface.OnClickListener? = null override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { - return activity?.let{ + return activity?.let { val builder = info.nightscout.core.ui.dialogs.AlertDialogHelper.Builder(it).apply { - if(title != 0) setTitle(title) - if(message != 0) setMessage(message) + if (title != 0) setTitle(title) + if (message != 0) setMessage(message) setPositiveButton(positiveBtn, - positiveListener?:DialogInterface.OnClickListener { _, _ -> - dismiss() - }) - if(negativeBtn != 0) { + positiveListener ?: DialogInterface.OnClickListener { _, _ -> + dismiss() + }) + if (negativeBtn != 0) { setNegativeButton(negativeBtn, - negativeListener ?: DialogInterface.OnClickListener { _, _ -> - dismiss() - }) + negativeListener ?: DialogInterface.OnClickListener { _, _ -> + dismiss() + }) } } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt index 4a49e46391..b2791410ee 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt @@ -3,6 +3,15 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.map +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager @@ -14,15 +23,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ui.event.UIEvent import info.nightscout.androidaps.plugins.pump.eopatch.vo.Alarms import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.disposables.Disposable import java.util.Calendar @@ -41,40 +41,41 @@ class EopatchOverviewViewModel @Inject constructor( private val dateUtil: DateUtil, private val pumpSync: PumpSync ) : EoBaseViewModel() { + private val _eventHandler = SingleLiveEvent>() - val eventHandler : LiveData> + val eventHandler: LiveData> get() = _eventHandler private val _patchConfig = SingleLiveEvent() - val patchConfig : LiveData + val patchConfig: LiveData get() = _patchConfig private val _patchState = SingleLiveEvent() - val patchState : LiveData + val patchState: LiveData get() = _patchState private val _normalBasal = SingleLiveEvent() - val normalBasal : LiveData + val normalBasal: LiveData get() = _normalBasal private val _tempBasal = SingleLiveEvent() - val tempBasal : LiveData + val tempBasal: LiveData get() = _tempBasal private val _bleStatus = SingleLiveEvent() - val bleStatus : LiveData + val bleStatus: LiveData get() = _bleStatus private val _status = SingleLiveEvent() - val status : LiveData + val status: LiveData get() = _status private val _pauseBtnStr = SingleLiveEvent() - val pauseBtnStr : LiveData + val pauseBtnStr: LiveData get() = _pauseBtnStr private val _alarms = SingleLiveEvent() - val alarms : LiveData + val alarms: LiveData get() = _alarms private val _patchRemainingInsulin = MutableLiveData(0f) @@ -86,8 +87,8 @@ class EopatchOverviewViewModel @Inject constructor( get() = _patchRemainingInsulin.map { insulin -> when { insulin > 50f -> "50+ U" - insulin < 1f -> "0 U" - else -> "${insulin.roundToInt()} U" + insulin < 1f -> "0 U" + else -> "${insulin.roundToInt()} U" } } @@ -113,10 +114,10 @@ class EopatchOverviewViewModel @Inject constructor( patchManager.observePatchConnectionState() .observeOn(aapsSchedulers.main) .subscribe { - _bleStatus.value = when(it){ - BleConnectionState.CONNECTED -> "{fa-bluetooth}" + _bleStatus.value = when (it) { + BleConnectionState.CONNECTED -> "{fa-bluetooth}" BleConnectionState.DISCONNECTED -> "{fa-bluetooth-b}" - else -> "{fa-bluetooth-b spin} ${rh.gs(R.string.string_connecting)}" + else -> "{fa-bluetooth-b spin} ${rh.gs(R.string.string_connecting)}" } } .addTo() @@ -135,62 +136,62 @@ class EopatchOverviewViewModel @Inject constructor( } .addTo() - if(preferenceManager.getPatchState().isNormalBasalPaused){ + if (preferenceManager.getPatchState().isNormalBasalPaused) { startPauseTimeUpdate() - }else { + } else { updateBasalInfo() } } - private fun updatePatchStatus(){ - if(patchManager.isActivated){ - val finishTimeMillis = patchConfig.value?.basalPauseFinishTimestamp?:System.currentTimeMillis() + private fun updatePatchStatus() { + if (patchManager.isActivated) { + val finishTimeMillis = patchConfig.value?.basalPauseFinishTimestamp ?: System.currentTimeMillis() val remainTimeMillis = max(finishTimeMillis - System.currentTimeMillis(), 0L) - val h = TimeUnit.MILLISECONDS.toHours(remainTimeMillis) - val m = TimeUnit.MILLISECONDS.toMinutes(remainTimeMillis - TimeUnit.HOURS.toMillis(h)) - _status.value = if(patchManager.patchState.isNormalBasalPaused) - "${rh.gs(R.string.string_suspended)}\n${rh.gs(R.string.string_temp_basal_remained_hhmm, h.toString(), m.toString())}" - else - rh.gs(R.string.string_running) - }else{ + val h = TimeUnit.MILLISECONDS.toHours(remainTimeMillis) + val m = TimeUnit.MILLISECONDS.toMinutes(remainTimeMillis - TimeUnit.HOURS.toMillis(h)) + _status.value = if (patchManager.patchState.isNormalBasalPaused) + "${rh.gs(R.string.string_suspended)}\n${rh.gs(R.string.string_temp_basal_remained_hhmm, h.toString(), m.toString())}" + else + rh.gs(R.string.string_running) + } else { _status.value = "" } - _pauseBtnStr.value = if(patchManager.patchState.isNormalBasalPaused) rh.gs(R.string.string_resume) else rh.gs(R.string.string_suspend) + _pauseBtnStr.value = if (patchManager.patchState.isNormalBasalPaused) rh.gs(R.string.string_resume) else rh.gs(R.string.string_suspend) } - private fun updateBasalInfo(){ - if(patchManager.isActivated){ - _normalBasal.value = if(patchManager.patchState.isNormalBasalRunning) + private fun updateBasalInfo() { + if (patchManager.isActivated) { + _normalBasal.value = if (patchManager.patchState.isNormalBasalRunning) "${preferenceManager.getNormalBasalManager().normalBasal.currentSegmentDoseUnitPerHour} U/hr" else "" - _tempBasal.value = if(patchManager.patchState.isTempBasalActive) + _tempBasal.value = if (patchManager.patchState.isTempBasalActive) "${preferenceManager.getTempBasalManager().startedBasal?.doseUnitPerHour} U/hr" else "" - }else{ + } else { _normalBasal.value = "" _tempBasal.value = "" } } - fun onClickActivation(){ + fun onClickActivation() { val profile = profileFunction.getProfile() - if(profile == null){ + if (profile == null) { _eventHandler.postValue(UIEvent(EventType.PROFILE_NOT_SET)) - }else{ + } else { val basalValues = profile.getBasalValues() var isValid = true - for(basalRate in basalValues){ - if(basalRate.value < 0.049999){ + for (basalRate in basalValues) { + if (basalRate.value < 0.049999) { _eventHandler.postValue(UIEvent(EventType.INVALID_BASAL_RATE)) isValid = false break } } - if(isValid) { + if (isValid) { patchManager.preferenceManager.getNormalBasalManager().setNormalBasal(profile) patchManager.preferenceManager.flushNormalBasalManager() @@ -199,44 +200,44 @@ class EopatchOverviewViewModel @Inject constructor( } } - fun onClickDeactivation(){ + fun onClickDeactivation() { _eventHandler.postValue(UIEvent(EventType.DEACTIVATION_CLICKED)) } - fun onClickSuspendOrResume(){ - if(patchManager.patchState.isNormalBasalPaused) { + fun onClickSuspendOrResume() { + if (patchManager.patchState.isNormalBasalPaused) { _eventHandler.postValue(UIEvent(EventType.RESUME_CLICKED)) - }else{ + } else { _eventHandler.postValue(UIEvent(EventType.SUSPEND_CLICKED)) } } - fun pauseBasal(pauseDurationHour: Float){ + fun pauseBasal(pauseDurationHour: Float) { patchManager.pauseBasal(pauseDurationHour) .subscribeOn(aapsSchedulers.io) .observeOn(aapsSchedulers.main) .subscribe({ response -> - if (response.isSuccess) { - val result = pumpSync.syncTemporaryBasalWithPumpId( - timestamp = dateUtil.now(), - rate = 0.0, - duration = T.mins((pauseDurationHour * 60).toLong()).msecs(), - isAbsolute = true, - type = PumpSync.TemporaryBasalType.PUMP_SUSPEND, - pumpId = dateUtil.now(), - pumpType = PumpType.EOFLOW_EOPATCH2, - pumpSerial = patchManager.patchConfig.patchSerialNumber - ) - aapsLogger.debug(LTag.PUMP, "syncTemporaryBasalWithPumpId: Result: $result") + if (response.isSuccess) { + val result = pumpSync.syncTemporaryBasalWithPumpId( + timestamp = dateUtil.now(), + rate = 0.0, + duration = T.mins((pauseDurationHour * 60).toLong()).msecs(), + isAbsolute = true, + type = PumpSync.TemporaryBasalType.PUMP_SUSPEND, + pumpId = dateUtil.now(), + pumpType = PumpType.EOFLOW_EOPATCH2, + pumpSerial = patchManager.patchConfig.patchSerialNumber + ) + aapsLogger.debug(LTag.PUMP, "syncTemporaryBasalWithPumpId: Result: $result") - UIEvent(EventType.PAUSE_BASAL_SUCCESS).let { _eventHandler.postValue(it) } - startPauseTimeUpdate() - } else { - UIEvent(EventType.PAUSE_BASAL_FAILED).apply { value = pauseDurationHour }.let { _eventHandler.postValue(it) } - } - }, { - UIEvent(EventType.PAUSE_BASAL_FAILED).apply { value = pauseDurationHour }.let { _eventHandler.postValue(it) } - }).addTo() + UIEvent(EventType.PAUSE_BASAL_SUCCESS).let { _eventHandler.postValue(it) } + startPauseTimeUpdate() + } else { + UIEvent(EventType.PAUSE_BASAL_FAILED).apply { value = pauseDurationHour }.let { _eventHandler.postValue(it) } + } + }, { + UIEvent(EventType.PAUSE_BASAL_FAILED).apply { value = pauseDurationHour }.let { _eventHandler.postValue(it) } + }).addTo() } fun resumeBasal() { @@ -244,41 +245,41 @@ class EopatchOverviewViewModel @Inject constructor( .subscribeOn(aapsSchedulers.io) .observeOn(aapsSchedulers.main) .subscribe({ - if (it.isSuccess) { - pumpSync.syncStopTemporaryBasalWithPumpId( - timestamp = dateUtil.now(), - endPumpId = dateUtil.now(), - pumpType = PumpType.EOFLOW_EOPATCH2, - pumpSerial = patchManager.patchConfig.patchSerialNumber - ) - UIEvent(EventType.RESUME_BASAL_SUCCESS).let { event -> _eventHandler.postValue(event) } - stopPauseTimeUpdate() - } else { - _eventHandler.postValue(UIEvent(EventType.RESUME_BASAL_FAILED)) - } - },{ - _eventHandler.postValue(UIEvent(EventType.RESUME_BASAL_FAILED)) - }).addTo() + if (it.isSuccess) { + pumpSync.syncStopTemporaryBasalWithPumpId( + timestamp = dateUtil.now(), + endPumpId = dateUtil.now(), + pumpType = PumpType.EOFLOW_EOPATCH2, + pumpSerial = patchManager.patchConfig.patchSerialNumber + ) + UIEvent(EventType.RESUME_BASAL_SUCCESS).let { event -> _eventHandler.postValue(event) } + stopPauseTimeUpdate() + } else { + _eventHandler.postValue(UIEvent(EventType.RESUME_BASAL_FAILED)) + } + }, { + _eventHandler.postValue(UIEvent(EventType.RESUME_BASAL_FAILED)) + }).addTo() } - private fun startPauseTimeUpdate(){ - if(mPauseTimeDisposable == null) { + private fun startPauseTimeUpdate() { + if (mPauseTimeDisposable == null) { mPauseTimeDisposable = Observable.interval(30, TimeUnit.SECONDS) .observeOn(aapsSchedulers.main) .subscribe { updatePatchStatus() } } } - private fun stopPauseTimeUpdate(){ + private fun stopPauseTimeUpdate() { mPauseTimeDisposable?.dispose() mPauseTimeDisposable = null } - fun startBasalRateUpdate(){ + fun startBasalRateUpdate() { val initialDelaySecs = Calendar.getInstance().let { c -> (60 - c.get(Calendar.MINUTE) - 1) * 60 + (60 - c.get(Calendar.SECOND)) } - if(mBasalRateDisposable == null) { + if (mBasalRateDisposable == null) { mBasalRateDisposable = Observable.interval(initialDelaySecs.toLong(), 3600L, TimeUnit.SECONDS) .observeOn(aapsSchedulers.main) .subscribe { updateBasalInfo() } @@ -286,7 +287,7 @@ class EopatchOverviewViewModel @Inject constructor( updateBasalInfo() } - fun stopBasalRateUpdate(){ + fun stopBasalRateUpdate() { mBasalRateDisposable?.dispose() mBasalRateDisposable = null } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchViewModel.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchViewModel.kt index 3f797be6e8..62538099f1 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchViewModel.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchViewModel.kt @@ -5,6 +5,11 @@ import androidx.annotation.StringRes import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.map +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.eopatch.CommonUtils import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.RxAction @@ -45,11 +50,6 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ui.viewmodel.EopatchViewM import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchLifecycleEvent import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState -import info.nightscout.rx.AapsSchedulers -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.core.Maybe import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.core.Single @@ -70,9 +70,12 @@ class EopatchViewModel @Inject constructor( private val rxAction: RxAction, private val sp: SP ) : EoBaseViewModel() { + companion object { + private const val MAX_ELAPSED_MILLIS_AFTER_EXPIRATION = -12L * 60 * 60 * 1000 } + var forceDiscard = false var isInAlarmHandling = false var connectionTryCnt = 0 @@ -83,7 +86,7 @@ class EopatchViewModel @Inject constructor( private val _isActivated = MutableLiveData(patchConfig.isActivated) private val _eventHandler = SingleLiveEvent>() - val eventHandler : LiveData> + val eventHandler: LiveData> get() = _eventHandler val patchStep = MutableLiveData() @@ -97,8 +100,8 @@ class EopatchViewModel @Inject constructor( it.takeOne(patchManager.patchState.remainedInsulin.let { insulin -> when { insulin > 50f -> 51 - insulin < 1f -> 0 - else -> insulin.roundToInt() + insulin < 1f -> 0 + else -> insulin.roundToInt() } }, 0) } @@ -132,17 +135,20 @@ class EopatchViewModel @Inject constructor( val commCheckCancelLabel: LiveData get() = patchStep.map { - rh.gs(when (it) { - PatchStep.CONNECT_NEW -> { - isBonded.takeOne(R.string.cancel, R.string.patch_cancel_pairing) + rh.gs( + when (it) { + PatchStep.CONNECT_NEW -> { + isBonded.takeOne(R.string.cancel, R.string.patch_cancel_pairing) + } + + PatchStep.SAFE_DEACTIVATION -> R.string.patch_forced_discard + else -> R.string.cancel } - PatchStep.SAFE_DEACTIVATION -> R.string.patch_forced_discard - else -> R.string.cancel - }) + ) } val programEnabledMessage: String - get() = rh.gs(R.string.patch_basal_schedule_desc_1,"기초1") + get() = rh.gs(R.string.patch_basal_schedule_desc_1, "기초1") private val _isDiscardedWithNotConn = MutableLiveData(false) val isDiscardedWithNotConn: LiveData @@ -200,13 +206,18 @@ class EopatchViewModel @Inject constructor( return abs((this - current).let { (it > maxElapsed).takeOne(it, maxElapsed) }).let { millis -> val hours = TimeUnit.MILLISECONDS.toHours(millis) - val minutes = TimeUnit.MILLISECONDS.toMinutes(millis - - TimeUnit.HOURS.toMillis(hours)) - val seconds = TimeUnit.MILLISECONDS.toSeconds(millis - - TimeUnit.HOURS.toMillis(hours) - TimeUnit.MINUTES.toMillis(minutes)) + val minutes = TimeUnit.MILLISECONDS.toMinutes( + millis + - TimeUnit.HOURS.toMillis(hours) + ) + val seconds = TimeUnit.MILLISECONDS.toSeconds( + millis + - TimeUnit.HOURS.toMillis(hours) - TimeUnit.MINUTES.toMillis(minutes) + ) - (this < current).takeOne("- ", "") +String.format( - "%02d:%02d:%02d", hours % 24, minutes, seconds) + (this < current).takeOne("- ", "") + String.format( + "%02d:%02d:%02d", hours % 24, minutes, seconds + ) } } @@ -214,16 +225,18 @@ class EopatchViewModel @Inject constructor( CommonUtils.dispose(mUpdateDisposable) mUpdateDisposable = Observable.interval(0, 1, TimeUnit.SECONDS) - .observeOn(aapsSchedulers.main) - .takeUntil { !patchConfig.isActivated } - .subscribeDefault(aapsLogger) { - _patchExpirationTimestamp.value = patchManager.patchExpiredTime - } + .observeOn(aapsSchedulers.main) + .takeUntil { !patchConfig.isActivated } + .subscribeDefault(aapsLogger) { + _patchExpirationTimestamp.value = patchManager.patchExpiredTime + } } @Synchronized - fun checkCommunication(onSuccessListener: () -> Unit, onCancelListener: (() -> Unit)? = null, - onDiscardListener: (() -> Unit)? = null, doPreCheck: Boolean = false) { + fun checkCommunication( + onSuccessListener: () -> Unit, onCancelListener: (() -> Unit)? = null, + onDiscardListener: (() -> Unit)? = null, doPreCheck: Boolean = false + ) { if (doPreCheck && patchManager.patchConnectionState.isConnected) { onSuccessListener.invoke() return @@ -243,35 +256,37 @@ class EopatchViewModel @Inject constructor( private fun checkCommunicationInternal(timeout: Long = 8000) { CommonUtils.dispose(mCommCheckDisposable) - if(forceDiscard) + if (forceDiscard) connectionTryCnt++ mCommCheckDisposable = if (isBonded) { patchManager.observePatchConnectionState() - .timeout(timeout, TimeUnit.MILLISECONDS, - Observable.just(BleConnectionState.DISCONNECTED)) - .takeUntil { it == BleConnectionState.CONNECTED } - .last(BleConnectionState.DISCONNECTED) - .map { it == BleConnectionState.CONNECTED } + .timeout( + timeout, TimeUnit.MILLISECONDS, + Observable.just(BleConnectionState.DISCONNECTED) + ) + .takeUntil { it == BleConnectionState.CONNECTED } + .last(BleConnectionState.DISCONNECTED) + .map { it == BleConnectionState.CONNECTED } } else { patchManager.scan(timeout) - .flatMap { - if (it.nearestDevice == null) - Single.error(Resources.NotFoundException()) - else - Single.just(true) - } - .retry(1) - } - .subscribeOn(aapsSchedulers.io) - .observeOn(aapsSchedulers.main) - .onErrorReturnItem(false) - .doOnSubscribe { showPatchCommCheckDialog() } - .doFinally { dismissPatchCommCheckDialog() } - .doOnError { aapsLogger.error(LTag.PUMP, it.message?:"Error") } - .subscribeDefault(aapsLogger) { - _isCommCheckFailed.value = !it + .flatMap { + if (it.nearestDevice == null) + Single.error(Resources.NotFoundException()) + else + Single.just(true) } + .retry(1) + } + .subscribeOn(aapsSchedulers.io) + .observeOn(aapsSchedulers.main) + .onErrorReturnItem(false) + .doOnSubscribe { showPatchCommCheckDialog() } + .doFinally { dismissPatchCommCheckDialog() } + .doOnError { aapsLogger.error(LTag.PUMP, it.message ?: "Error") } + .subscribeDefault(aapsLogger) { + _isCommCheckFailed.value = !it + } } private fun showPatchCommCheckDialog(defaultFailedCondition: Boolean = false, @StringRes title: Int = R.string.string_connecting) { @@ -350,7 +365,7 @@ class EopatchViewModel @Inject constructor( checkCommunication({ discardPatchInternal() }, doPreCheck = true) } - fun deactivatePatch(){ + fun deactivatePatch() { if (patchManager.patchConnectionState.isConnected) { deactivate(false) { try { @@ -367,10 +382,11 @@ class EopatchViewModel @Inject constructor( } showPatchCommCheckDialog(true) Single.timer(10, TimeUnit.SECONDS) - .doFinally{dismissPatchCommCheckDialog()} + .doFinally { dismissPatchCommCheckDialog() } .subscribe() } } + fun discardPatch() { updateIncompletePatchActivationReminder() discardPatchInternal() @@ -393,9 +409,10 @@ class EopatchViewModel @Inject constructor( fun onConfirm() { when (patchStep.value) { - PatchStep.DISCARDED_FOR_CHANGE -> PatchStep.WAKE_UP - PatchStep.DISCARDED_FROM_ALARM -> PatchStep.FINISH - PatchStep.DISCARDED -> { + PatchStep.DISCARDED_FOR_CHANGE -> PatchStep.WAKE_UP + PatchStep.DISCARDED_FROM_ALARM -> PatchStep.FINISH + + PatchStep.DISCARDED -> { if (initPatchStepIsCheckConnection) { mOnCommCheckDiscardListener?.invoke() /*?: navigator?.finish()*/ mOnCommCheckDiscardListener = null @@ -404,10 +421,12 @@ class EopatchViewModel @Inject constructor( PatchStep.BACK_TO_HOME } } + PatchStep.MANUALLY_TURNING_OFF_ALARM -> { initPatchStepIsSafeDeactivation.takeOne(PatchStep.DISCARDED_FOR_CHANGE, PatchStep.DISCARDED) } - PatchStep.BASAL_SCHEDULE -> { + + PatchStep.BASAL_SCHEDULE -> { if (!patchManager.patchConnectionState.isConnected) { checkCommunication({ moveStep(PatchStep.COMPLETE) }, { moveStep(PatchStep.BASAL_SCHEDULE) }) null @@ -415,7 +434,8 @@ class EopatchViewModel @Inject constructor( PatchStep.COMPLETE } } - else -> null + + else -> null }?.let { moveStep(it) } @@ -423,17 +443,20 @@ class EopatchViewModel @Inject constructor( fun initPatchStep() { when (patchStep.value) { - PatchStep.WAKE_UP -> { + PatchStep.WAKE_UP -> { setupStep.value = WAKE_UP_READY } - PatchStep.SAFETY_CHECK -> { + + PatchStep.SAFETY_CHECK -> { setupStep.value = SAFETY_CHECK_READY } + PatchStep.ROTATE_KNOB, PatchStep.ROTATE_KNOB_NEEDLE_INSERTION_ERROR -> { setupStep.value = NEEDLE_SENSING_READY } - else -> Unit + + else -> Unit } } @@ -442,24 +465,27 @@ class EopatchViewModel @Inject constructor( if (oldPatchStep != newPatchStep) { when (newPatchStep) { - PatchStep.REMOVE_NEEDLE_CAP -> PatchLifecycleEvent.createRemoveNeedleCap() + PatchStep.REMOVE_NEEDLE_CAP -> PatchLifecycleEvent.createRemoveNeedleCap() PatchStep.REMOVE_PROTECTION_TAPE -> PatchLifecycleEvent.createRemoveProtectionTape() - PatchStep.SAFETY_CHECK -> PatchLifecycleEvent.createSafetyCheck() - PatchStep.ROTATE_KNOB -> PatchLifecycleEvent.createRotateKnob() - PatchStep.WAKE_UP -> { + PatchStep.SAFETY_CHECK -> PatchLifecycleEvent.createSafetyCheck() + PatchStep.ROTATE_KNOB -> PatchLifecycleEvent.createRotateKnob() + + PatchStep.WAKE_UP -> { patchConfig.apply { rotateKnobNeedleSensingError = false } PatchLifecycleEvent.createShutdown() } - PatchStep.CANCEL -> { + + PatchStep.CANCEL -> { if (!patchConfig.isActivated) { PatchLifecycleEvent.createShutdown() } else { null } } - else -> null + + else -> null }?.let { patchManager.updatePatchLifeCycle(it) } @@ -479,10 +505,11 @@ class EopatchViewModel @Inject constructor( private fun prepareStep(step: PatchStep?, withAlarmHandle: Boolean = true): PatchStep { (step ?: convertToPatchStep(patchConfig.lifecycleEvent.lifeCycle)).let { newStep -> when (newStep) { - PatchStep.SAFE_DEACTIVATION -> R.string.string_discard_patch + PatchStep.SAFE_DEACTIVATION -> R.string.string_discard_patch PatchStep.DISCARDED, PatchStep.DISCARDED_FROM_ALARM, - PatchStep.DISCARDED_FOR_CHANGE -> R.string.patch_discard_complete_title + PatchStep.DISCARDED_FOR_CHANGE -> R.string.patch_discard_complete_title + PatchStep.MANUALLY_TURNING_OFF_ALARM -> R.string.patch_manually_turning_off_alarm_title PatchStep.WAKE_UP, PatchStep.CONNECT_NEW, @@ -491,9 +518,10 @@ class EopatchViewModel @Inject constructor( PatchStep.SAFETY_CHECK, PatchStep.ROTATE_KNOB, PatchStep.ROTATE_KNOB_NEEDLE_INSERTION_ERROR, - PatchStep.BASAL_SCHEDULE -> R.string.string_activate_patch - PatchStep.SETTING_REMINDER_TIME -> R.string.patch_expiration_reminder_setting_title - else -> _title.value + PatchStep.BASAL_SCHEDULE -> R.string.string_activate_patch + + PatchStep.SETTING_REMINDER_TIME -> R.string.patch_expiration_reminder_setting_title + else -> _title.value }.let { if (_title.value != it) { _title.postValue(it) @@ -509,7 +537,8 @@ class EopatchViewModel @Inject constructor( PatchStep.REMOVE_PROTECTION_TAPE, PatchStep.SAFETY_CHECK, PatchStep.ROTATE_KNOB -> { updateIncompletePatchActivationReminder(true) } - PatchStep.COMPLETE, PatchStep.BASAL_SCHEDULE -> { + + PatchStep.COMPLETE, PatchStep.BASAL_SCHEDULE -> { val now = System.currentTimeMillis() val expireTimeStamp = patchConfig.expireTimestamp val millisBeforeExpiration = TimeUnit.HOURS.toMillis(sp.getInt(EXPIRATION_REMINDERS, 0).toLong()) @@ -524,7 +553,7 @@ class EopatchViewModel @Inject constructor( .subscribe() } - PatchStep.ROTATE_KNOB_NEEDLE_INSERTION_ERROR -> { + PatchStep.ROTATE_KNOB_NEEDLE_INSERTION_ERROR -> { patchConfig.apply { rotateKnobNeedleSensingError = true } @@ -533,11 +562,11 @@ class EopatchViewModel @Inject constructor( } - PatchStep.CANCEL -> { + PatchStep.CANCEL -> { alarmRegistry.remove(AlarmCode.B012).subscribe() } - else -> { + else -> { } } } @@ -547,15 +576,17 @@ class EopatchViewModel @Inject constructor( } private fun convertToPatchStep(lifecycle: PatchLifecycle) = when (lifecycle) { - PatchLifecycle.SHUTDOWN -> patchConfig.isDeactivated.takeOne( - PatchStep.WAKE_UP, PatchStep.SAFE_DEACTIVATION) - PatchLifecycle.BONDED -> PatchStep.CONNECT_NEW - PatchLifecycle.REMOVE_NEEDLE_CAP -> PatchStep.REMOVE_NEEDLE_CAP + PatchLifecycle.SHUTDOWN -> patchConfig.isDeactivated.takeOne( + PatchStep.WAKE_UP, PatchStep.SAFE_DEACTIVATION + ) + + PatchLifecycle.BONDED -> PatchStep.CONNECT_NEW + PatchLifecycle.REMOVE_NEEDLE_CAP -> PatchStep.REMOVE_NEEDLE_CAP PatchLifecycle.REMOVE_PROTECTION_TAPE -> PatchStep.REMOVE_PROTECTION_TAPE - PatchLifecycle.SAFETY_CHECK -> PatchStep.SAFETY_CHECK - PatchLifecycle.ROTATE_KNOB -> PatchStep.ROTATE_KNOB - PatchLifecycle.BASAL_SETTING -> PatchStep.ROTATE_KNOB - PatchLifecycle.ACTIVATED -> PatchStep.SAFE_DEACTIVATION + PatchLifecycle.SAFETY_CHECK -> PatchStep.SAFETY_CHECK + PatchLifecycle.ROTATE_KNOB -> PatchStep.ROTATE_KNOB + PatchLifecycle.BASAL_SETTING -> PatchStep.ROTATE_KNOB + PatchLifecycle.ACTIVATED -> PatchStep.SAFE_DEACTIVATION } private fun onClear() { @@ -603,23 +634,23 @@ class EopatchViewModel @Inject constructor( @Synchronized fun deactivate(force: Boolean, onSuccessListener: () -> Unit) { patchManager.deactivate(6000, force) - .doOnSubscribe { - showProgressDialog(force.takeOne(R.string.string_in_progress, R.string.string_changing)) + .doOnSubscribe { + showProgressDialog(force.takeOne(R.string.string_in_progress, R.string.string_changing)) + } + .doFinally { + dismissProgressDialog() + } + .subscribeDefault(aapsLogger) { status -> + if (status.isDeactivated) { + onSuccessListener.invoke() + } else { + rxAction.runOnMainThread({ + checkCommunication({ deactivate(false, onSuccessListener) }, + { _eventHandler.postValue(UIEvent(EventType.FINISH_ACTIVITY)) }) + }, 100) } - .doFinally { - dismissProgressDialog() - } - .subscribeDefault(aapsLogger) { status -> - if (status.isDeactivated) { - onSuccessListener.invoke() - } else { - rxAction.runOnMainThread({ - checkCommunication({ deactivate(false, onSuccessListener) }, - { _eventHandler.postValue(UIEvent(EventType.FINISH_ACTIVITY)) }) - }, 100) - } - } - .addTo() + } + .addTo() } @Synchronized @@ -644,21 +675,21 @@ class EopatchViewModel @Inject constructor( private fun startScanInternal() { patchManager.scan(5000) - .flatMap { - if (it.nearestDevice == null) - Single.error(Resources.NotFoundException()) - else - Single.just(it.nearestDevice) + .flatMap { + if (it.nearestDevice == null) + Single.error(Resources.NotFoundException()) + else + Single.just(it.nearestDevice) + } + .onErrorReturnItem("") + .doOnSubscribe { updateSetupStep(SCAN_STARTED) } + .subscribeDefault(aapsLogger) { + if (it.isNotEmpty()) { + startBond(it) + } else { + updateSetupStep(SCAN_FAILED) } - .onErrorReturnItem("") - .doOnSubscribe { updateSetupStep(SCAN_STARTED) } - .subscribeDefault(aapsLogger) { - if (it.isNotEmpty()) { - startBond(it) - } else { - updateSetupStep(SCAN_FAILED) - } - }.addTo() + }.addTo() } @Synchronized @@ -703,18 +734,18 @@ class EopatchViewModel @Inject constructor( @Synchronized fun selfTest(timeout: Long = 20000, delayMs: Long = 0) { rxAction.runOnMainThread({ - patchManager.selfTest(timeout) - .doOnSubscribe { updateSetupStep(SELF_TEST_STARTED) } - .map { it == TEST_SUCCESS } - .onErrorReturnItem(false) - .subscribeDefault(aapsLogger) { - if (it) { - moveStep(PatchStep.REMOVE_NEEDLE_CAP) - } else if (!patchManager.patchConnectionState.isConnected) { - updateSetupStep(SELF_TEST_FAILED) - } - }.addTo() - }, delayMs) + patchManager.selfTest(timeout) + .doOnSubscribe { updateSetupStep(SELF_TEST_STARTED) } + .map { it == TEST_SUCCESS } + .onErrorReturnItem(false) + .subscribeDefault(aapsLogger) { + if (it) { + moveStep(PatchStep.REMOVE_NEEDLE_CAP) + } else if (!patchManager.patchConnectionState.isConnected) { + updateSetupStep(SELF_TEST_FAILED) + } + }.addTo() + }, delayMs) } @Synchronized @@ -735,15 +766,15 @@ class EopatchViewModel @Inject constructor( private fun startSafetyCheckInternal() { patchManager.startPriming(10000, 100) - .doOnSubscribe { - _safetyCheckProgress.postValue(0) - updateSetupStep(SAFETY_CHECK_STARTED) - } - .doOnNext { _safetyCheckProgress.postValue(it.toInt()) } - .doOnError { updateSetupStep(SAFETY_CHECK_FAILED) } - .doOnComplete { moveStep(PatchStep.ROTATE_KNOB) } - .subscribeEmpty() - .addTo() + .doOnSubscribe { + _safetyCheckProgress.postValue(0) + updateSetupStep(SAFETY_CHECK_STARTED) + } + .doOnNext { _safetyCheckProgress.postValue(it.toInt()) } + .doOnError { updateSetupStep(SAFETY_CHECK_FAILED) } + .doOnComplete { moveStep(PatchStep.ROTATE_KNOB) } + .subscribeEmpty() + .addTo() } @Synchronized @@ -771,19 +802,19 @@ class EopatchViewModel @Inject constructor( @Synchronized fun startActivation() { patchManager.patchActivation(20000) - .doOnSubscribe { - showProgressDialog(R.string.string_connecting) - updateSetupStep(ACTIVATION_STARTED) + .doOnSubscribe { + showProgressDialog(R.string.string_connecting) + updateSetupStep(ACTIVATION_STARTED) + } + .doFinally { dismissProgressDialog() } + .onErrorReturnItem(false) + .subscribeDefault(aapsLogger) { + if (it) { + moveStep(PatchStep.COMPLETE) + } else { + updateSetupStep(ACTIVATION_FAILED) } - .doFinally { dismissProgressDialog() } - .onErrorReturnItem(false) - .subscribeDefault(aapsLogger) { - if (it) { - moveStep(PatchStep.COMPLETE) - } else { - updateSetupStep(ACTIVATION_FAILED) - } - }.addTo() + }.addTo() } fun updateIncompletePatchActivationReminder(forced: Boolean = false) { diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/Alarms.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/Alarms.kt index 95670262c1..ea708b20dd 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/Alarms.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/Alarms.kt @@ -1,19 +1,19 @@ package info.nightscout.androidaps.plugins.pump.eopatch.vo +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.eopatch.GsonHelper import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.subjects.BehaviorSubject -import java.util.* -import kotlin.collections.HashSet -class Alarms: IPreference { +class Alarms : IPreference { + @Transient private val subject: BehaviorSubject = BehaviorSubject.create() class AlarmItem { + lateinit var alarmCode: AlarmCode var createTimestamp = 0L var triggerTimeMilli = 0L @@ -36,7 +36,7 @@ class Alarms: IPreference { fun initObject() { } - fun clear(){ + fun clear() { registered.clear() occurred.clear() needToStopBeep.clear() @@ -53,7 +53,7 @@ class Alarms: IPreference { createTimestamp = System.currentTimeMillis() triggerTimeMilli = createTimestamp + triggerAfter } - if (isRegistered(alarmCode)){ + if (isRegistered(alarmCode)) { registered.remove(alarmCode) } registered.put(alarmCode, item) @@ -61,7 +61,7 @@ class Alarms: IPreference { } fun unregister(alarmCode: AlarmCode) { - if (isRegistered(alarmCode)){ + if (isRegistered(alarmCode)) { registered.remove(alarmCode) } } @@ -79,18 +79,18 @@ class Alarms: IPreference { occurred.remove(alarmCode) } - fun getOccuredAlarmTimestamp(alarmCode: AlarmCode): Long{ - return if(occurred.containsKey(alarmCode)) + fun getOccuredAlarmTimestamp(alarmCode: AlarmCode): Long { + return if (occurred.containsKey(alarmCode)) occurred.getValue(alarmCode).triggerTimeMilli else System.currentTimeMillis() } - private fun isRegistered(alarmCode: AlarmCode): Boolean{ + private fun isRegistered(alarmCode: AlarmCode): Boolean { return registered.containsKey(alarmCode) } - fun isOccurring(alarmCode: AlarmCode): Boolean{ + fun isOccurring(alarmCode: AlarmCode): Boolean { return occurred.containsKey(alarmCode) } @@ -98,7 +98,7 @@ class Alarms: IPreference { return subject.hide() } - override fun flush(sp: SP){ + override fun flush(sp: SP) { val jsonStr = GsonHelper.sharedGson().toJson(this) sp.putString(SettingKeys.ALARMS, jsonStr) subject.onNext(this) diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/BolusCurrent.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/BolusCurrent.kt index 24f64b33e5..4168d58cb9 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/BolusCurrent.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/BolusCurrent.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.eopatch.vo +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.eopatch.AppConstant import info.nightscout.androidaps.plugins.pump.eopatch.GsonHelper +import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.core.code.BolusType import info.nightscout.androidaps.plugins.pump.eopatch.core.util.FloatAdjusters -import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.subjects.BehaviorSubject @@ -22,10 +22,12 @@ import io.reactivex.rxjava3.subjects.BehaviorSubject */ class BolusCurrent : IPreference { + @Transient private val subject: BehaviorSubject = BehaviorSubject.create() class Bolus { + var historyId: Long = 0L var injected = 0f @@ -85,8 +87,7 @@ class BolusCurrent : IPreference { if (remain != other.remain) return false if (startTimestamp != other.startTimestamp) return false if (endTimestamp != other.endTimestamp) return false - if (endTimeSynced != other.endTimeSynced) return false - return true + return endTimeSynced == other.endTimeSynced } override fun hashCode(): Int { @@ -101,7 +102,7 @@ class BolusCurrent : IPreference { override fun toString(): String = when (historyId) { - 0L -> "Bolus(NONE)" + 0L -> "Bolus(NONE)" else -> "Bolus(id=$historyId, i=$injected, r=$remain, start=$startTimestamp, end=$endTimestamp, synced=$endTimeSynced)" } } @@ -113,7 +114,7 @@ class BolusCurrent : IPreference { when (type) { BolusType.NOW -> nowBolus BolusType.EXT -> extBolus - else -> nowBolus + else -> nowBolus } fun historyId(t: BolusType) = getBolus(t).historyId @@ -155,15 +156,14 @@ class BolusCurrent : IPreference { other as BolusCurrent if (nowBolus != other.nowBolus) return false - if (extBolus != other.extBolus) return false - return true + return extBolus == other.extBolus } override fun observe(): Observable { return subject.hide() } - override fun flush(sp: SP){ + override fun flush(sp: SP) { val jsonStr = GsonHelper.sharedGson().toJson(this) sp.putString(SettingKeys.BOLUS_CURRENT, jsonStr) subject.onNext(this) diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/IPreference.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/IPreference.kt index ccb254b79f..9ecbbd527a 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/IPreference.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/IPreference.kt @@ -1,9 +1,10 @@ package info.nightscout.androidaps.plugins.pump.eopatch.vo -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.sharedPreferences.SP import io.reactivex.rxjava3.core.Observable -interface IPreference{ +interface IPreference { + fun flush(sp: SP) fun observe(): Observable } \ No newline at end of file diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/NormalBasalManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/NormalBasalManager.kt index 4cab76e286..7cf4bb812d 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/NormalBasalManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/NormalBasalManager.kt @@ -1,16 +1,17 @@ package info.nightscout.androidaps.plugins.pump.eopatch.vo +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.eopatch.CommonUtils import info.nightscout.androidaps.plugins.pump.eopatch.GsonHelper import info.nightscout.androidaps.plugins.pump.eopatch.code.BasalStatus import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys -import info.nightscout.interfaces.profile.Profile -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.subjects.BehaviorSubject import java.util.concurrent.TimeUnit class NormalBasalManager : IPreference { + @Transient private val subject: BehaviorSubject = BehaviorSubject.create() @@ -19,31 +20,32 @@ class NormalBasalManager : IPreference { val isStarted: Boolean get() = normalBasal.status.isStarted - init { initObject() } - fun initObject() { } - fun isEqual(profile: Profile?): Boolean{ - return profile?.let{ - if(it.getBasalValues().size != normalBasal.list.size) + fun isEqual(profile: Profile?): Boolean { + return profile?.let { + if (it.getBasalValues().size != normalBasal.list.size) return false - for(i in it.getBasalValues().indices){ - if(TimeUnit.SECONDS.toMinutes(it.getBasalValues()[i].timeAsSeconds.toLong()) != normalBasal.list.get(i).start){ + for (i in it.getBasalValues().indices) { + if (TimeUnit.SECONDS.toMinutes(it.getBasalValues()[i].timeAsSeconds.toLong()) != normalBasal.list.get(i).start) { return false } - if(!CommonUtils.nearlyEqual(it.getBasalValues()[i].value.toFloat(), normalBasal - .list.get(i).doseUnitPerHour, 0.0000001f)){ + if (!CommonUtils.nearlyEqual( + it.getBasalValues()[i].value.toFloat(), normalBasal + .list.get(i).doseUnitPerHour, 0.0000001f + ) + ) { return false } } return true - }?:false + } ?: false } fun convertProfileToNormalBasal(profile: Profile): NormalBasal { @@ -51,10 +53,10 @@ class NormalBasalManager : IPreference { tmpNormalBasal.list.clear() val size = profile.getBasalValues().size - for(idx in profile.getBasalValues().indices){ - val nextIdx = if(idx == (size - 1)) 0 else idx + 1 + for (idx in profile.getBasalValues().indices) { + val nextIdx = if (idx == (size - 1)) 0 else idx + 1 val startTimeMinutes = TimeUnit.SECONDS.toMinutes(profile.getBasalValues()[idx].timeAsSeconds.toLong()) - val endTimeMinutes = if(nextIdx == 0) 1440 else TimeUnit.SECONDS.toMinutes(profile.getBasalValues()[nextIdx].timeAsSeconds.toLong()) + val endTimeMinutes = if (nextIdx == 0) 1440 else TimeUnit.SECONDS.toMinutes(profile.getBasalValues()[nextIdx].timeAsSeconds.toLong()) tmpNormalBasal.list.add(BasalSegment(startTimeMinutes, endTimeMinutes, profile.getBasalValues()[idx].value.toFloat())) } @@ -66,10 +68,10 @@ class NormalBasalManager : IPreference { normalBasal.list.clear() val size = profile.getBasalValues().size - for(idx in profile.getBasalValues().indices){ - val nextIdx = if(idx == (size - 1)) 0 else idx + 1 + for (idx in profile.getBasalValues().indices) { + val nextIdx = if (idx == (size - 1)) 0 else idx + 1 val startTimeMinutes = TimeUnit.SECONDS.toMinutes(profile.getBasalValues()[idx].timeAsSeconds.toLong()) - val endTimeMinutes = if(nextIdx == 0) 1440 else TimeUnit.SECONDS.toMinutes(profile.getBasalValues()[nextIdx].timeAsSeconds.toLong()) + val endTimeMinutes = if (nextIdx == 0) 1440 else TimeUnit.SECONDS.toMinutes(profile.getBasalValues()[nextIdx].timeAsSeconds.toLong()) normalBasal.list.add(BasalSegment(startTimeMinutes, endTimeMinutes, profile.getBasalValues()[idx].value.toFloat())) } @@ -105,7 +107,7 @@ class NormalBasalManager : IPreference { updateBasalSelected() } - fun update(other: NormalBasalManager){ + fun update(other: NormalBasalManager) { normalBasal = other.normalBasal } @@ -113,13 +115,12 @@ class NormalBasalManager : IPreference { return subject.hide() } - override fun flush(sp: SP){ + override fun flush(sp: SP) { val jsonStr = GsonHelper.sharedGson().toJson(this) sp.putString(SettingKeys.NORMAL_BASAL, jsonStr) subject.onNext(this) } - override fun toString(): String { return "NormalBasalManager(normalBasal=$normalBasal)" } diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/PatchConfig.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/PatchConfig.kt index 6a38a1aa6c..01dcc4acd4 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/PatchConfig.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/PatchConfig.kt @@ -1,20 +1,21 @@ package info.nightscout.androidaps.plugins.pump.eopatch.vo +import app.aaps.interfaces.sharedPreferences.SP import com.google.android.gms.common.internal.Preconditions import info.nightscout.androidaps.plugins.pump.eopatch.AppConstant import info.nightscout.androidaps.plugins.pump.eopatch.CommonUtils import info.nightscout.androidaps.plugins.pump.eopatch.FloatFormatters import info.nightscout.androidaps.plugins.pump.eopatch.GsonHelper -import info.nightscout.androidaps.plugins.pump.eopatch.core.define.IPatchConstant.WARRANTY_OPERATING_LIFE_MILLI -import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.code.PatchLifecycle -import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys +import info.nightscout.androidaps.plugins.pump.eopatch.core.define.IPatchConstant.WARRANTY_OPERATING_LIFE_MILLI import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.subjects.BehaviorSubject import java.util.concurrent.TimeUnit // @Singleton -class PatchConfig: IPreference { +class PatchConfig : IPreference { + @Transient private val subject: BehaviorSubject = BehaviorSubject.create() var securityValue: ByteArray = byteArrayOf(0, 0) @@ -63,12 +64,13 @@ class PatchConfig: IPreference { var pumpDurationMediumMilli = 0L // medium get(): Long = if (field != 0L) field else AppConstant.PUMP_DURATION_MILLI var pumpDurationLargeMilli = 0L // large - get(): Long = if (field != 0L) field else AppConstant.PUMP_DURATION_MILLI + get(): Long = if (field != 0L) field else AppConstant.PUMP_DURATION_MILLI //var pumpDurationOcclusion = 0L // occul, 사용안함 - var isEnterPrimaryScreen =false + var isEnterPrimaryScreen = false + // 기초 프로그램 변경시 BLE로 패치에 보내야 하기 때문에 마크한다. - var needSetBasalSchedule =false + var needSetBasalSchedule = false var sharedKey: ByteArray? = null var seq15: Int = -1 @@ -76,6 +78,7 @@ class PatchConfig: IPreference { var rotateKnobNeedleSensingError = false var remainedInsulin = 0f + //wake-up 시간을 기준으로 3.5일 val expireTimestamp: Long get() = patchWakeupTimestamp + expireDurationMilli @@ -188,29 +191,29 @@ class PatchConfig: IPreference { this.lifecycleEvent = event when (event.lifeCycle) { - PatchLifecycle.SHUTDOWN -> { + PatchLifecycle.SHUTDOWN -> { updateDeactivated() } - PatchLifecycle.BONDED -> { + PatchLifecycle.BONDED -> { } - PatchLifecycle.SAFETY_CHECK -> { + PatchLifecycle.SAFETY_CHECK -> { } - PatchLifecycle.REMOVE_NEEDLE_CAP -> { + PatchLifecycle.REMOVE_NEEDLE_CAP -> { } PatchLifecycle.REMOVE_PROTECTION_TAPE -> { } - PatchLifecycle.ROTATE_KNOB -> { + PatchLifecycle.ROTATE_KNOB -> { } - PatchLifecycle.BASAL_SETTING -> { + PatchLifecycle.BASAL_SETTING -> { } - PatchLifecycle.ACTIVATED -> { + PatchLifecycle.ACTIVATED -> { // updateFirstConnected 이 부분으로 옮김. this.activatedTimestamp = System.currentTimeMillis() //this.expireDurationMilli = WARRANTY_OPERATING_LIFE_MILLI @@ -251,12 +254,11 @@ class PatchConfig: IPreference { return CommonUtils.hasText(macAddress) } - - fun updatetDisconnectedTime(){ + fun updatetDisconnectedTime() { this.lastDisconnectedTimestamp = System.currentTimeMillis() } - fun update(other: PatchConfig){ + fun update(other: PatchConfig) { macAddress = other.macAddress lifecycleEvent = other.lifecycleEvent bolusNormalStartTimestamp = other.bolusNormalStartTimestamp @@ -300,14 +302,12 @@ class PatchConfig: IPreference { return subject.hide() } - override fun flush(sp: SP){ + override fun flush(sp: SP) { val jsonStr = GsonHelper.sharedGson().toJson(this) sp.putString(SettingKeys.PATCH_CONFIG, jsonStr) subject.onNext(this) } - - override fun toString(): String { return "PatchConfig(securityValue=${securityValue.contentToString()}, macAddress=$macAddress, lifecycleEvent=$lifecycleEvent, bolusNormalStartTimestamp=$bolusNormalStartTimestamp, bolusNormalEndTimestamp=$bolusNormalEndTimestamp, bolusNormalDoseU=$bolusNormalDoseU, bolusExStartTimestamp=$bolusExStartTimestamp, bolusExEndTimestamp=$bolusExEndTimestamp, bolusExDoseU=$bolusExDoseU, injectCount=$injectCount, bgReminderMinute=$bgReminderMinute, lastIndex=$lastIndex, lastDisconnectedTimestamp=$lastDisconnectedTimestamp, standardBolusInjectCount=$standardBolusInjectCount, extendedBolusInjectCount=$extendedBolusInjectCount, basalInjectCount=$basalInjectCount, patchFirmwareVersion=$patchFirmwareVersion, patchSerialNumber='$patchSerialNumber', patchLotNumber=$patchLotNumber, patchModelName=$patchModelName, patchWakeupTimestamp=$patchWakeupTimestamp, activatedTimestamp=$activatedTimestamp, expireDurationMilli=$expireDurationMilli, basalPauseFinishTimestamp=$basalPauseFinishTimestamp, needleInsertionTryCount=$needleInsertionTryCount, LowReservoirAlertAmount=$lowReservoirAlertAmount, patchExpireAlertTime=$patchExpireAlertTime, isEnterPrimaryScreen=$isEnterPrimaryScreen, needSetBasalSchedule=$needSetBasalSchedule, sharedKey=${sharedKey?.contentToString()}, seq15=$seq15, rotateKnobNeedleSensingError=$rotateKnobNeedleSensingError, remainedInsulin=$remainedInsulin)" } @@ -353,9 +353,7 @@ class PatchConfig: IPreference { } else if (other.sharedKey != null) return false if (seq15 != other.seq15) return false if (rotateKnobNeedleSensingError != other.rotateKnobNeedleSensingError) return false - if (remainedInsulin != other.remainedInsulin) return false - - return true + return remainedInsulin == other.remainedInsulin } override fun hashCode(): Int { diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/PatchState.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/PatchState.kt index 8141d83553..f7a4cea114 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/PatchState.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/PatchState.kt @@ -1,28 +1,29 @@ package info.nightscout.androidaps.plugins.pump.eopatch.vo +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.eopatch.AppConstant import info.nightscout.androidaps.plugins.pump.eopatch.GsonHelper +import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.core.code.BolusType import info.nightscout.androidaps.plugins.pump.eopatch.core.util.FloatAdjusters -import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.subjects.BehaviorSubject import java.io.Serializable import java.text.SimpleDateFormat -import java.util.* +import java.util.Calendar import java.util.concurrent.TimeUnit import java.util.function.Consumer import java.util.stream.IntStream -class PatchState: IPreference { +class PatchState : IPreference { + @Transient private val subject: BehaviorSubject = BehaviorSubject.create() private val stateBytes: ByteArray var updatedTimestamp: Long = 0 - constructor(): this(ByteArray(SIZE), 0) + constructor() : this(ByteArray(SIZE), 0) constructor(stateBytes: ByteArray, updatedTimestamp: Long) { this.stateBytes = stateBytes @@ -42,7 +43,7 @@ class PatchState: IPreference { subject.onNext(this) } - fun clear(){ + fun clear() { update(ByteArray(SIZE), 0) } @@ -172,7 +173,8 @@ class PatchState: IPreference { val remainedPumpCycle = remainedPumpCycle() return if (remainedPumpCycle > 0) { FloatAdjusters.FLOOR2_INSULIN.apply( - remainedPumpCycle * AppConstant.INSULIN_UNIT_P) + remainedPumpCycle * AppConstant.INSULIN_UNIT_P + ) } else { remainedInsulin().toFloat() } @@ -212,8 +214,8 @@ class PatchState: IPreference { fun isBolusActive(type: BolusType?): Boolean { return when (type) { - BolusType.NOW -> isNowBolusRegAct - BolusType.EXT -> isExtBolusRegAct + BolusType.NOW -> isNowBolusRegAct + BolusType.EXT -> isExtBolusRegAct BolusType.COMBO -> isNowBolusRegAct && isExtBolusRegAct else -> isNowBolusRegAct && isExtBolusRegAct } @@ -221,8 +223,8 @@ class PatchState: IPreference { fun isBolusDone(type: BolusType?): Boolean { return when (type) { - BolusType.NOW -> isNowBolusDone - BolusType.EXT -> isExtBolusDone + BolusType.NOW -> isNowBolusDone + BolusType.EXT -> isExtBolusDone BolusType.COMBO -> isNowBolusDone || isExtBolusDone else -> isNowBolusDone || isExtBolusDone } @@ -270,8 +272,10 @@ class PatchState: IPreference { listOf(indent, "[TempBasal] Reg:", b(isTempBasalReg), " Act:", b(isTempBasalAct), " Done:", b(isTempBasalDone)) .forEach(Consumer { str: String? -> sb.append(str) }) } - listOf(indent, "[NormalBasal] Reg:", b(isNormalBasalReg), " Act:", b(isNormalBasalAct), " Paused:", b(isNormalBasalPaused), - indent, "remainedInsulin:", remainedInsulin(), " remainedPumpCycle:", remainedPumpCycle(), "(", remainedInsulin, ")", " battery:", battery()) + listOf( + indent, "[NormalBasal] Reg:", b(isNormalBasalReg), " Act:", b(isNormalBasalAct), " Paused:", b(isNormalBasalPaused), + indent, "remainedInsulin:", remainedInsulin(), " remainedPumpCycle:", remainedPumpCycle(), "(", remainedInsulin, ")", " battery:", battery() + ) .forEach(Consumer { obj: Serializable? -> sb.append(obj) }) return sb.toString() } @@ -303,7 +307,7 @@ class PatchState: IPreference { return subject.hide() } - override fun flush(sp: SP){ + override fun flush(sp: SP) { val jsonStr = GsonHelper.sharedGson().toJson(this) sp.putString(SettingKeys.PATCH_STATE, jsonStr) subject.onNext(this) @@ -314,6 +318,7 @@ class PatchState: IPreference { } companion object { + const val SIZE = 20 @JvmStatic fun create(bytes: ByteArray?, updatedTimestamp: Long): PatchState { var stateBytes = bytes diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/TempBasalManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/TempBasalManager.kt index 5cccec3270..e6bcdee171 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/TempBasalManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/TempBasalManager.kt @@ -1,15 +1,16 @@ package info.nightscout.androidaps.plugins.pump.eopatch.vo +import app.aaps.interfaces.sharedPreferences.SP import com.google.common.base.Preconditions import info.nightscout.androidaps.plugins.pump.eopatch.CommonUtils import info.nightscout.androidaps.plugins.pump.eopatch.GsonHelper import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.code.UnitOrPercent -import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.subjects.BehaviorSubject -class TempBasalManager : IPreference{ +class TempBasalManager : IPreference { + @Transient private val subject: BehaviorSubject = BehaviorSubject.create() @@ -21,7 +22,7 @@ class TempBasalManager : IPreference{ var unit = UnitOrPercent.P - fun clear(){ + fun clear() { startedBasal = null startTimestamp = 0L endTimestamp = 0L @@ -40,7 +41,7 @@ class TempBasalManager : IPreference{ this.startedBasal?.startTimestamp = 0 } - fun update(other: TempBasalManager){ + fun update(other: TempBasalManager) { this.startedBasal = other.startedBasal startTimestamp = other.startTimestamp endTimestamp = other.endTimestamp @@ -51,7 +52,7 @@ class TempBasalManager : IPreference{ return subject.hide() } - override fun flush(sp: SP){ + override fun flush(sp: SP) { val jsonStr = GsonHelper.sharedGson().toJson(this) sp.putString(SettingKeys.TEMP_BASAL, jsonStr) subject.onNext(this) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index ab2e7f182e..0ea8c27e36 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -8,6 +8,23 @@ import android.os.HandlerThread import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.WarnColors +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventExtendedBolusChange +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.rx.events.EventRefreshButtonState +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState @@ -24,24 +41,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPu import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.WarnColors -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue import info.nightscout.pump.common.defs.PumpDeviceState -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventExtendedBolusChange -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.rx.events.EventRefreshButtonState -import info.nightscout.rx.events.EventTempBasalChange -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -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 @@ -275,7 +275,7 @@ class MedtronicFragment : DaggerFragment() { } else if (medtronicPumpStatus.lastConnection + 30 * 60 * 1000 < System.currentTimeMillis()) { if (min < 60) { - binding.lastConnection.text = rh.gs(info.nightscout.interfaces.R.string.minago, min) + binding.lastConnection.text = rh.gs(app.aaps.interfaces.R.string.minago, min) } else if (min < 1440) { val h = (min / 60).toInt() binding.lastConnection.text = (rh.gq(info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R.plurals.duration_hours, h, h) + " " diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index 38b08f12eb..2ba7fd702e 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -6,6 +6,34 @@ import android.content.ServiceConnection import android.os.IBinder import android.os.SystemClock import androidx.preference.Preference +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.PumpSync.TemporaryBasalType +import app.aaps.interfaces.pump.actions.CustomAction +import app.aaps.interfaces.pump.actions.CustomActionType +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshButtonState +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.rx.events.EventSWRLStatus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.TimeChangeType import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst @@ -39,39 +67,11 @@ import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.isSame import info.nightscout.core.utils.DateTimeUtil import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.PumpSync.TemporaryBasalType -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.pump.common.data.PumpStatus import info.nightscout.pump.common.defs.PumpDriverState import info.nightscout.pump.common.sync.PumpDbEntryTBR import info.nightscout.pump.common.sync.PumpSyncStorage import info.nightscout.pump.common.utils.ProfileUtil -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshButtonState -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.events.EventSWRLStatus -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.joda.time.LocalDateTime import java.util.Calendar import java.util.GregorianCalendar diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt index d2f0b25939..e2dca53d55 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt @@ -1,6 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm import android.os.SystemClock +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException @@ -33,10 +35,8 @@ import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.createByteArray import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.getByteArrayFromUnsignedShort import info.nightscout.core.utils.DateTimeUtil -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.common.defs.PumpDeviceState import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.logging.LTag import org.joda.time.LocalDateTime import java.util.Calendar import java.util.GregorianCalendar @@ -387,9 +387,9 @@ class MedtronicCommunicationManager // This empty constructor must be kept, oth override fun createPumpMessageContent(type: RLMessageType): ByteArray { return when (type) { - RLMessageType.PowerOn -> medtronicUtil.buildCommandPayload(rileyLinkServiceData, MedtronicCommandType.RFPowerOn, byteArrayOf(2, 1, receiverDeviceAwakeForMinutes.toByte())) + RLMessageType.PowerOn -> medtronicUtil.buildCommandPayload(rileyLinkServiceData, MedtronicCommandType.RFPowerOn, byteArrayOf(2, 1, receiverDeviceAwakeForMinutes.toByte())) RLMessageType.ReadSimpleData -> medtronicUtil.buildCommandPayload(rileyLinkServiceData, MedtronicCommandType.PumpModel, null) - else -> ByteArray(0) + else -> ByteArray(0) } } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt index 53c4163d0f..3bb21b2a62 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt @@ -1,16 +1,16 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BasalProfile import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BatteryStatusDTO import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpConfigurationGroup import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.common.utils.ByteUtil import info.nightscout.pump.common.utils.StringUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.joda.time.IllegalFieldValueException import org.joda.time.LocalDateTime import java.util.Locale diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt index d300c11ae9..cd6ebd67a5 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.pump.common.utils.StringUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.apache.commons.lang3.StringUtils /** diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt index 984081be97..749b5733eb 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.common.utils.CRC import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.Arrays import java.util.Locale diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt index 1e1b7204b9..c237b914a4 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.cgms +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryDecoder import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RecordDecodeStatus import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.cgms.CGMSHistoryEntryType.Companion.getByCode import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.core.utils.DateTimeUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.joda.time.LocalDateTime import java.util.Arrays @@ -17,7 +17,7 @@ import java.util.Arrays * * Author: Andy {andy.rozman@gmail.com} */ -class MedtronicCGMSHistoryDecoder constructor( +class MedtronicCGMSHistoryDecoder( aapsLogger: AAPSLogger, medtronicUtil: MedtronicUtil ) : MedtronicHistoryDecoder(aapsLogger, medtronicUtil) { diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt index 8b481cb2ef..a16fa9618b 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt @@ -1,5 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryDecoder import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RecordDecodeStatus import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType.Companion.getByCode @@ -13,8 +15,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpBolusType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.core.utils.DateTimeUtil import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.Locale import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.kt index b53cb342e4..c282d2e342 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryResult.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.core.utils.DateTimeUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag /** * History page contains data, sorted from newest to oldest (0=newest..n=oldest) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt index f6a43af163..df351380ce 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.message +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import kotlin.math.min /** diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.kt index f89e52deeb..e15907a6f8 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIComm.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.ui +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject /** diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.kt index ffaeb7d22d..4ea293421f 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.kt @@ -1,5 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.ui +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BasalProfile import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BatteryStatusDTO @@ -11,9 +14,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicNotificat import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicUIResponseType import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.DateTimeZone import org.joda.time.Duration import java.util.Date diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt index accc1c892b..ff79855571 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt @@ -1,5 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.ui +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager @@ -12,9 +15,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.pump.common.defs.PumpDeviceState -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.joda.time.LocalDateTime import java.util.Locale import javax.inject.Inject diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index c2bf4a7295..7867f4ee22 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -1,5 +1,16 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction import com.google.gson.Gson import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector @@ -21,23 +32,12 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.core.utils.DateTimeUtil -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.common.sync.PumpDbEntry import info.nightscout.pump.common.sync.PumpDbEntryBolus import info.nightscout.pump.common.sync.PumpDbEntryCarbs import info.nightscout.pump.common.sync.PumpDbEntryTBR import info.nightscout.pump.common.sync.PumpSyncStorage import info.nightscout.pump.common.utils.StringUtil -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.apache.commons.lang3.StringUtils import org.joda.time.LocalDateTime import java.util.GregorianCalendar diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt index 4a06970e6c..7a74d85e95 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.defs.PumpType import com.google.gson.annotations.Expose import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.joda.time.Instant import java.util.Locale diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.kt index f94fa7bb4f..e6cb7f66e6 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfileEntry.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.joda.time.LocalTime import java.util.Locale @@ -17,7 +17,7 @@ class BasalProfileEntry { var rate = 0.0 var startTime_raw: Byte - var startTime : LocalTime? = null // Just a "time of day" + var startTime: LocalTime? = null // Just a "time of day" constructor() { rate = -9.999E6 @@ -49,8 +49,11 @@ class BasalProfileEntry { LocalTime(startTimeInterval / 2, startTimeInterval % 2 * 30) } catch (ex: Exception) { aapsLogger.error( - LTag.PUMPCOMM, String.format(Locale.ENGLISH, "Error creating BasalProfileEntry: startTimeInterval=%d, startTime_raw=%d, hours=%d, rateStrokes=%d", - startTimeInterval, startTime_raw, startTimeInterval / 2, rateStrokes)) + LTag.PUMPCOMM, String.format( + Locale.ENGLISH, "Error creating BasalProfileEntry: startTimeInterval=%d, startTime_raw=%d, hours=%d, rateStrokes=%d", + startTimeInterval, startTime_raw, startTimeInterval / 2, rateStrokes + ) + ) throw ex } } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.kt index e2664eec3d..40e1bfbfa1 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType -import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.LocalDateTime class RLHistoryItemMedtronic(private val medtronicCommandType: MedtronicCommandType) : diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt index 40e0172187..9476a44e83 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.pump.common.defs.TempBasalPair import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.Locale /** diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt index 7d0d299fbf..4edd974d3a 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalProcessDTO.kt @@ -1,19 +1,21 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto +import app.aaps.interfaces.logging.AAPSLogger import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType import info.nightscout.core.utils.DateTimeUtil -import info.nightscout.rx.logging.AAPSLogger -class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, - var aapsLogger: AAPSLogger, - var objectType: ObjectType = ObjectType.TemporaryBasal) { +class TempBasalProcessDTO( + var itemOne: PumpHistoryEntry, + var aapsLogger: AAPSLogger, + var objectType: ObjectType = ObjectType.TemporaryBasal +) { var itemTwo: PumpHistoryEntry? = null set(value) { field = value if (objectType == ObjectType.TemporaryBasal) { - if (value!=null) { + if (value != null) { if (value.entryType == PumpHistoryEntryType.TempBasalCombined) { itemTwoTbr = value.getDecodedDataEntry("Object") as TempBasalPair } else { @@ -47,7 +49,7 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, //aapsLogger.error("Couldn't find TempBasalPair in entry: $itemOne") return 0 } - } else if (itemTwoRewind!=null) { + } else if (itemTwoRewind != null) { val secondsDiff = DateTimeUtil.getATechDateDifferenceAsSeconds(itemOne.atechDateTime, DateTimeUtil.getATDWithAddedSeconds(itemTwo!!.atechDateTime, -2)) return secondsDiff } else { @@ -75,14 +77,14 @@ class TempBasalProcessDTO constructor(var itemOne: PumpHistoryEntry, stringBuilder.append(itemOne.dt) - if (itemTwo!=null) { + if (itemTwo != null) { stringBuilder.append(" - ") stringBuilder.append(itemTwo?.dt) } - stringBuilder.append(" " + durationAsSeconds + " s (" + durationAsSeconds/60 + ")") + stringBuilder.append(" " + durationAsSeconds + " s (" + durationAsSeconds / 60 + ")") - if (itemTwoTbr!=null) { + if (itemTwoTbr != null) { stringBuilder.append(" " + itemOneTbr?.insulinRate + " / " + itemTwoTbr?.insulinRate) } else { stringBuilder.append(" " + itemOneTbr?.insulinRate) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.kt index 210b4660d3..d0b59534b7 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicCustomActionType.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.defs -import info.nightscout.interfaces.pump.actions.CustomActionType +import app.aaps.interfaces.pump.actions.CustomActionType /** * Created by andy on 11/3/18. diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.kt index 4e5bb0ee79..1e6e5c89d2 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/defs/MedtronicNotificationType.kt @@ -1,14 +1,16 @@ package info.nightscout.androidaps.plugins.pump.medtronic.defs -import info.nightscout.interfaces.notifications.Notification +import app.aaps.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.medtronic.R /** * Created by andy on 10/15/18. */ -enum class MedtronicNotificationType(var notificationType: Int, - val resourceId: Int, - val notificationUrgency: Int) { +enum class MedtronicNotificationType( + var notificationType: Int, + val resourceId: Int, + val notificationUrgency: Int +) { PumpUnreachable(Notification.RILEYLINK_CONNECTION, R.string.medtronic_pump_status_pump_unreachable, Notification.NORMAL), // PumpTypeNotSame(R.string.medtronic_error_pump_type_set_differs_from_detected, Notification.NORMAL), // @@ -17,8 +19,11 @@ enum class MedtronicNotificationType(var notificationType: Int, PumpWrongTBRTypeSet(R.string.medtronic_error_pump_wrong_tbr_type_set, Notification.URGENT), // PumpWrongMaxBolusSet(R.string.medtronic_error_pump_wrong_max_bolus_set, Notification.NORMAL), // PumpWrongMaxBasalSet(R.string.medtronic_error_pump_wrong_max_basal_set, Notification.NORMAL), // - PumpWrongTimeUrgent(R.string.medtronic_notification_check_time_date, Notification.URGENT), PumpWrongTimeNormal(R.string.medtronic_notification_check_time_date, Notification.NORMAL), TimeChangeOver24h( - Notification.OVER_24H_TIME_CHANGE_REQUESTED, R.string.medtronic_error_pump_24h_time_change_requested, Notification.URGENT); + PumpWrongTimeUrgent(R.string.medtronic_notification_check_time_date, Notification.URGENT), + PumpWrongTimeNormal(R.string.medtronic_notification_check_time_date, Notification.NORMAL), + TimeChangeOver24h( + Notification.OVER_24H_TIME_CHANGE_REQUESTED, R.string.medtronic_error_pump_24h_time_change_requested, Notification.URGENT + ); constructor(resourceId: Int, notificationUrgency: Int) : this(Notification.MEDTRONIC_PUMP_ALARM, resourceId, notificationUrgency) } \ No newline at end of file diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.kt index b161e36fc0..4519abdefb 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.kt @@ -11,12 +11,12 @@ import android.widget.Spinner import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.DaggerActivity import info.nightscout.androidaps.plugins.pump.medtronic.R import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.data.MedtronicHistoryData import info.nightscout.pump.common.defs.PumpHistoryEntryGroup -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtronicHistoryActivity : DaggerActivity() { @@ -145,8 +145,10 @@ class MedtronicHistoryActivity : DaggerActivity() { } override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): HistoryViewHolder { - val v = LayoutInflater.from(viewGroup.context).inflate(R.layout.medtronic_history_item, // - viewGroup, false) + val v = LayoutInflater.from(viewGroup.context).inflate( + R.layout.medtronic_history_item, // + viewGroup, false + ) return HistoryViewHolder(v) } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt index 4161e34e41..025c9e802f 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt @@ -1,6 +1,10 @@ package info.nightscout.androidaps.plugins.pump.medtronic.driver import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem @@ -9,13 +13,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.BasalProfileStatus import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.common.data.PumpStatus import info.nightscout.pump.common.defs.PumpDeviceState import info.nightscout.pump.common.sync.PumpDbEntryTBR -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import java.util.Calendar import java.util.GregorianCalendar import javax.inject.Inject diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt index 3ecabd0c9a..0bd996f73d 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpConfigurationChanged.kt @@ -1,5 +1,5 @@ package info.nightscout.androidaps.plugins.pump.medtronic.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventMedtronicPumpConfigurationChanged : Event() diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt index ff3a44507c..8dc5581c69 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/events/EventMedtronicPumpValuesChanged.kt @@ -1,5 +1,5 @@ package info.nightscout.androidaps.plugins.pump.medtronic.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventMedtronicPumpValuesChanged : Event() diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt index 3579b8bf76..2cbfc1c450 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt @@ -4,6 +4,7 @@ import android.content.Intent import android.content.res.Configuration import android.os.Binder import android.os.IBinder +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkTargetFrequency @@ -19,7 +20,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.pump.common.defs.PumpDeviceState import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.logging.LTag import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt index d4512a000c..0bfbf0fb35 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt @@ -1,5 +1,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.util +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.ui.UiInteraction import com.google.gson.Gson import com.google.gson.GsonBuilder import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange @@ -12,13 +18,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandTy import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicNotificationType import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import java.nio.ByteBuffer import java.nio.ByteOrder import java.security.InvalidParameterException diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicTestBase.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicTestBase.kt index df9273df9e..99d2552564 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicTestBase.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicTestBase.kt @@ -1,5 +1,9 @@ package info.nightscout.androidaps.plugins.pump.medtronic +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector @@ -8,11 +12,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.Medtr import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.PumpSync import info.nightscout.pump.common.sync.PumpSyncStorage -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP import org.mockito.Answers import org.mockito.Mock diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt index 5a296ad572..af798675df 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt @@ -1,6 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm import android.util.Log +import app.aaps.interfaces.ui.UiInteraction import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicTestBase import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder @@ -12,7 +13,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceTyp import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.database.impl.serialisation.SealedClassHelper -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.common.utils.ByteUtil import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt index d729c328a0..8999bda475 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump +import app.aaps.interfaces.ui.UiInteraction import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicTestBase import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.common.utils.ByteUtil import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt index 142f56d3ee..8c6168ab4d 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryDataUTest.kt @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data +import app.aaps.interfaces.ui.UiInteraction import com.google.gson.Gson import com.google.gson.internal.LinkedTreeMap import com.google.gson.reflect.TypeToken @@ -9,7 +10,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpH import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalPair import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.interfaces.ui.UiInteraction import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPlugin.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPlugin.kt index 7d8e090bc9..8b95c129d4 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPlugin.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPlugin.kt @@ -11,49 +11,49 @@ import android.text.format.DateFormat import androidx.preference.EditTextPreference import androidx.preference.ListPreference import androidx.preference.PreferenceFragmentCompat +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.Medtrum +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpPluginBase +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.pump.actions.CustomAction +import app.aaps.interfaces.pump.actions.CustomActionType +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.queue.CustomCommand +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.utils.TimeChangeType import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.validators.ValidatingEditTextPreference -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.Medtrum -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpPluginBase -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState import info.nightscout.pump.medtrum.services.MedtrumService import info.nightscout.pump.medtrum.ui.MedtrumOverviewFragment import info.nightscout.pump.medtrum.util.MedtrumSnUtil -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventDismissNotification -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.utils.DateUtil -import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONException diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPump.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPump.kt index 795989b650..8942f2a611 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPump.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/MedtrumPump.kt @@ -1,11 +1,18 @@ package info.nightscout.pump.medtrum import android.util.Base64 -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.pump.defs.PumpType +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.pump.medtrum.code.ConnectionState import info.nightscout.pump.medtrum.comm.enums.AlarmSetting import info.nightscout.pump.medtrum.comm.enums.AlarmState @@ -14,16 +21,10 @@ import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState import info.nightscout.pump.medtrum.extension.toByteArray import info.nightscout.pump.medtrum.extension.toInt import info.nightscout.pump.medtrum.util.MedtrumSnUtil -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 kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow -import java.util.* +import java.util.EnumSet +import java.util.GregorianCalendar import javax.inject.Inject import javax.inject.Singleton import kotlin.math.round diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/ActivatePacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/ActivatePacket.kt index 44264e52ae..60be31597e 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/ActivatePacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/ActivatePacket.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.stats.TddCalculator import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.PumpSync import info.nightscout.pump.medtrum.MedtrumPump -import info.nightscout.pump.medtrum.comm.enums.CommandType.ACTIVATE import info.nightscout.pump.medtrum.comm.enums.BasalType -import info.nightscout.pump.medtrum.extension.toByteArray +import info.nightscout.pump.medtrum.comm.enums.CommandType.ACTIVATE import info.nightscout.pump.medtrum.extension.toByte -import info.nightscout.interfaces.stats.TddCalculator +import info.nightscout.pump.medtrum.extension.toByteArray import info.nightscout.pump.medtrum.extension.toInt import info.nightscout.pump.medtrum.extension.toLong import info.nightscout.pump.medtrum.util.MedtrumTimeUtil diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/AuthorizePacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/AuthorizePacket.kt index 9eef408215..9b41157610 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/AuthorizePacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/AuthorizePacket.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.MedtrumPump import info.nightscout.pump.medtrum.comm.enums.CommandType.AUTH_REQ import info.nightscout.pump.medtrum.encryption.Crypt import info.nightscout.pump.medtrum.extension.toByteArray import info.nightscout.pump.medtrum.extension.toInt -import info.nightscout.rx.logging.LTag import javax.inject.Inject class AuthorizePacket(injector: HasAndroidInjector) : MedtrumPacket(injector) { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/CancelTempBasalPacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/CancelTempBasalPacket.kt index e271d53db7..009b435ffa 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/CancelTempBasalPacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/CancelTempBasalPacket.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.MedtrumPump -import info.nightscout.pump.medtrum.comm.enums.CommandType.CANCEL_TEMP_BASAL import info.nightscout.pump.medtrum.comm.enums.BasalType +import info.nightscout.pump.medtrum.comm.enums.CommandType.CANCEL_TEMP_BASAL import info.nightscout.pump.medtrum.extension.toInt import info.nightscout.pump.medtrum.extension.toLong import info.nightscout.pump.medtrum.util.MedtrumTimeUtil -import info.nightscout.shared.utils.DateUtil import javax.inject.Inject class CancelTempBasalPacket(injector: HasAndroidInjector) : MedtrumPacket(injector) { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/GetRecordPacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/GetRecordPacket.kt index 477fa7ee7e..a5116f132c 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/GetRecordPacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/GetRecordPacket.kt @@ -1,22 +1,22 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage import info.nightscout.pump.medtrum.MedtrumPump import info.nightscout.pump.medtrum.comm.enums.BasalEndReason -import info.nightscout.pump.medtrum.comm.enums.CommandType.GET_RECORD import info.nightscout.pump.medtrum.comm.enums.BasalType import info.nightscout.pump.medtrum.comm.enums.BolusType +import info.nightscout.pump.medtrum.comm.enums.CommandType.GET_RECORD import info.nightscout.pump.medtrum.extension.toByteArray import info.nightscout.pump.medtrum.extension.toFloat import info.nightscout.pump.medtrum.extension.toInt import info.nightscout.pump.medtrum.extension.toLong import info.nightscout.pump.medtrum.util.MedtrumTimeUtil -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import javax.inject.Inject class GetRecordPacket(injector: HasAndroidInjector, private val recordIndex: Int) : MedtrumPacket(injector) { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/MedtrumPacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/MedtrumPacket.kt index cc6e7f5f77..37516b8434 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/MedtrumPacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/MedtrumPacket.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.extension.toInt -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject open class MedtrumPacket(protected var injector: HasAndroidInjector) { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/NotificationPacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/NotificationPacket.kt index f867adce1a..85c1a96e4a 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/NotificationPacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/NotificationPacket.kt @@ -1,5 +1,7 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.MedtrumPump import info.nightscout.pump.medtrum.comm.enums.AlarmState @@ -8,8 +10,6 @@ import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState import info.nightscout.pump.medtrum.extension.toInt import info.nightscout.pump.medtrum.extension.toLong import info.nightscout.pump.medtrum.util.MedtrumTimeUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject class NotificationPacket(val injector: HasAndroidInjector) { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SetTempBasalPacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SetTempBasalPacket.kt index 8e392d2ded..45611d8751 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SetTempBasalPacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SetTempBasalPacket.kt @@ -1,14 +1,14 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.MedtrumPump -import info.nightscout.pump.medtrum.comm.enums.CommandType.SET_TEMP_BASAL import info.nightscout.pump.medtrum.comm.enums.BasalType +import info.nightscout.pump.medtrum.comm.enums.CommandType.SET_TEMP_BASAL import info.nightscout.pump.medtrum.extension.toByteArray import info.nightscout.pump.medtrum.extension.toInt import info.nightscout.pump.medtrum.extension.toLong import info.nightscout.pump.medtrum.util.MedtrumTimeUtil -import info.nightscout.rx.logging.LTag import javax.inject.Inject import kotlin.math.round diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SetTimeZonePacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SetTimeZonePacket.kt index ccdf9d8d25..3a442f41f2 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SetTimeZonePacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SetTimeZonePacket.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.MedtrumPump import info.nightscout.pump.medtrum.comm.enums.CommandType.SET_TIME_ZONE import info.nightscout.pump.medtrum.extension.toByteArray import info.nightscout.pump.medtrum.util.MedtrumTimeUtil -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import javax.inject.Inject class SetTimeZonePacket(injector: HasAndroidInjector) : MedtrumPacket(injector) { @@ -27,8 +27,7 @@ class SetTimeZonePacket(injector: HasAndroidInjector) : MedtrumPacket(injector) aapsLogger.debug(LTag.PUMPCOMM, "Requested offset: $calcOffset minutes") // Workaround for bug where it fails to set timezone > GMT + 12 // if offset is > 12 hours, subtract 24 hours - if (calcOffset > T.hours(12).mins()) - { + if (calcOffset > T.hours(12).mins()) { calcOffset -= T.hours(24).mins().toInt() aapsLogger.debug(LTag.PUMPCOMM, "Modifying requested offset to: $calcOffset minutes") } diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SynchronizePacket.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SynchronizePacket.kt index f3c4dc60bd..09b752d9e8 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SynchronizePacket.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/comm/packets/SynchronizePacket.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.logging.LTag import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.MedtrumPump import info.nightscout.pump.medtrum.comm.enums.CommandType.SYNCHRONIZE import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState import info.nightscout.pump.medtrum.extension.toByteArray import info.nightscout.pump.medtrum.extension.toInt -import info.nightscout.rx.logging.LTag import javax.inject.Inject class SynchronizePacket(injector: HasAndroidInjector) : MedtrumPacket(injector) { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/BLEComm.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/BLEComm.kt index ff7a82a227..010dca674e 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/BLEComm.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/BLEComm.kt @@ -12,9 +12,9 @@ import android.bluetooth.BluetoothGattService import android.bluetooth.BluetoothManager import android.bluetooth.BluetoothProfile import android.bluetooth.le.ScanCallback +import android.bluetooth.le.ScanFilter import android.bluetooth.le.ScanResult import android.bluetooth.le.ScanSettings -import android.bluetooth.le.ScanFilter import android.content.Context import android.content.pm.PackageManager import android.os.Build @@ -22,15 +22,15 @@ import android.os.Handler import android.os.HandlerThread import android.os.SystemClock import androidx.core.app.ActivityCompat +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.core.ui.toast.ToastUtils -import info.nightscout.pump.medtrum.extension.toInt -import info.nightscout.pump.medtrum.comm.WriteCommandPackets import info.nightscout.pump.medtrum.comm.ManufacturerData import info.nightscout.pump.medtrum.comm.ReadDataPacket -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import java.util.UUID +import info.nightscout.pump.medtrum.comm.WriteCommandPackets +import info.nightscout.pump.medtrum.extension.toInt import java.util.Arrays +import java.util.UUID import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/MedtrumService.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/MedtrumService.kt index d4c57eb9c3..f2f6686bf7 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/MedtrumService.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/services/MedtrumService.kt @@ -6,21 +6,34 @@ import android.content.Intent import android.os.Binder import android.os.IBinder import android.os.SystemClock +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.BolusProgressData +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.BolusProgressData -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.medtrum.MedtrumPump import info.nightscout.pump.medtrum.R @@ -49,19 +62,6 @@ import info.nightscout.pump.medtrum.comm.packets.StopPatchPacket import info.nightscout.pump.medtrum.comm.packets.SubscribePacket import info.nightscout.pump.medtrum.comm.packets.SynchronizePacket import info.nightscout.pump.medtrum.util.MedtrumSnUtil -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventPumpStatusChanged -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 kotlinx.coroutines.CoroutineScope diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumActivateCompleteFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumActivateCompleteFragment.kt index b714622053..b3037db85a 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumActivateCompleteFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumActivateCompleteFragment.kt @@ -3,13 +3,13 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.databinding.FragmentMedtrumActivateCompleteBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumActivateCompleteFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumActivateFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumActivateFragment.kt index 0654dbfa64..4f44287b34 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumActivateFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumActivateFragment.kt @@ -3,15 +3,15 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumActivateBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumActivateFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumAttachPatchFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumAttachPatchFragment.kt index 524f6d8139..5b585f206f 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumAttachPatchFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumAttachPatchFragment.kt @@ -3,15 +3,15 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumAttachPatchBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumAttachPatchFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumBaseActivity.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumBaseActivity.kt index c4c1dda02c..a0b23c89a9 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumBaseActivity.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumBaseActivity.kt @@ -7,13 +7,14 @@ import androidx.annotation.LayoutRes import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.rx.AapsSchedulers import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.pump.medtrum.di.MedtrumPluginQualifier -import info.nightscout.rx.AapsSchedulers import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject abstract class MedtrumBaseActivity : TranslatedDaggerAppCompatActivity(), MedtrumBaseNavigator { + @Inject @MedtrumPluginQualifier lateinit var viewModelFactory: ViewModelProvider.Factory @@ -38,7 +39,7 @@ abstract class MedtrumBaseActivity : TranslatedDaggerAppCom } override fun back() { - if(supportFragmentManager.backStackEntryCount == 0) { + if (supportFragmentManager.backStackEntryCount == 0) { finish() } else { supportFragmentManager.popBackStack() @@ -46,7 +47,7 @@ abstract class MedtrumBaseActivity : TranslatedDaggerAppCom } override fun finish(finishAffinity: Boolean) { - if(finishAffinity) { + if (finishAffinity) { finishAffinity() } else { finish() diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumDeactivatePatchFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumDeactivatePatchFragment.kt index ec94ef89f1..b2f77d65c8 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumDeactivatePatchFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumDeactivatePatchFragment.kt @@ -3,14 +3,14 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumDeactivatePatchBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumDeactivatePatchFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumDeactivationCompleteFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumDeactivationCompleteFragment.kt index b0d72d2395..02ddd267ee 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumDeactivationCompleteFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumDeactivationCompleteFragment.kt @@ -3,11 +3,11 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.databinding.FragmentMedtrumDeactivationCompleteBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject class MedtrumDeactivationCompleteFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumOverviewFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumOverviewFragment.kt index 7f9d0d2962..5a9ad931c1 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumOverviewFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumOverviewFragment.kt @@ -3,18 +3,18 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers import info.nightscout.core.ui.dialogs.OKDialog -import info.nightscout.interfaces.protection.ProtectionCheck import info.nightscout.pump.medtrum.MedtrumPump -import info.nightscout.pump.medtrum.databinding.FragmentMedtrumOverviewBinding -import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumOverviewViewModel import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.EventType import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.pump.medtrum.databinding.FragmentMedtrumOverviewBinding +import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumOverviewViewModel import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPreparePatchConnectFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPreparePatchConnectFragment.kt index 57e05b2032..7c8b098fe8 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPreparePatchConnectFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPreparePatchConnectFragment.kt @@ -3,15 +3,15 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumPreparePatchConnectBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumPreparePatchConnectFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPreparePatchFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPreparePatchFragment.kt index 425f7fac3f..1c6d4a05b3 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPreparePatchFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPreparePatchFragment.kt @@ -3,11 +3,11 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.databinding.FragmentMedtrumPreparePatchBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject class MedtrumPreparePatchFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimeCompleteFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimeCompleteFragment.kt index f7e3c402d2..3977f038bb 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimeCompleteFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimeCompleteFragment.kt @@ -3,15 +3,15 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumPrimeCompleteBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumPrimeCompleteFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimeFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimeFragment.kt index 80020abe46..6beba5ce6d 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimeFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimeFragment.kt @@ -3,15 +3,15 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumPrimeBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumPrimeFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimingFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimingFragment.kt index eeee99aa71..0a0c5dced1 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimingFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumPrimingFragment.kt @@ -3,15 +3,15 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumPrimingBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumPrimingFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumRetryActivationConnectFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumRetryActivationConnectFragment.kt index 47de209db4..e3ccebe015 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumRetryActivationConnectFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumRetryActivationConnectFragment.kt @@ -3,14 +3,14 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumRetryActivationConnectBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumRetryActivationConnectFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumRetryActivationFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumRetryActivationFragment.kt index 829f80d217..129e11c441 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumRetryActivationFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumRetryActivationFragment.kt @@ -3,14 +3,14 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumRetryActivationBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumRetryActivationFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumStartDeactivationFragment.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumStartDeactivationFragment.kt index 1b047ac8cc..34961efeaa 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumStartDeactivationFragment.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/MedtrumStartDeactivationFragment.kt @@ -3,14 +3,14 @@ package info.nightscout.pump.medtrum.ui import android.os.Bundle import android.view.View import androidx.lifecycle.ViewModelProvider +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.databinding.FragmentMedtrumStartDeactivationBinding import info.nightscout.pump.medtrum.ui.viewmodel.MedtrumViewModel -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class MedtrumStartDeactivationFragment : MedtrumBaseFragment() { diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumOverviewViewModel.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumOverviewViewModel.kt index 13a6085b42..7a54152308 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumOverviewViewModel.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumOverviewViewModel.kt @@ -1,22 +1,22 @@ package info.nightscout.pump.medtrum.ui.viewmodel import androidx.lifecycle.LiveData -import info.nightscout.pump.medtrum.code.EventType -import info.nightscout.pump.medtrum.ui.MedtrumBaseNavigator -import info.nightscout.pump.medtrum.ui.event.SingleLiveEvent -import info.nightscout.pump.medtrum.ui.event.UIEvent -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.queue.CommandQueue +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.medtrum.MedtrumPump import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.ConnectionState +import info.nightscout.pump.medtrum.code.EventType import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.pump.medtrum.ui.MedtrumBaseNavigator +import info.nightscout.pump.medtrum.ui.event.SingleLiveEvent +import info.nightscout.pump.medtrum.ui.event.UIEvent import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel @@ -167,7 +167,7 @@ class MedtrumOverviewViewModel @Inject constructor( val profile = profileFunction.getProfile() if (profile == null) { _eventHandler.postValue(UIEvent(EventType.PROFILE_NOT_SET)) - } else if (medtrumPump.pumpSN == 0L){ + } else if (medtrumPump.pumpSN == 0L) { _eventHandler.postValue(UIEvent(EventType.SERIAL_NOT_SET)) } else { _eventHandler.postValue(UIEvent(EventType.CHANGE_PATCH_CLICKED)) @@ -179,7 +179,7 @@ class MedtrumOverviewViewModel @Inject constructor( if (medtrumPump.lastConnection != 0L) { val agoMilliseconds = System.currentTimeMillis() - medtrumPump.lastConnection val agoMinutes = agoMilliseconds / 1000 / 60 - _lastConnectionMinAgo.postValue(rh.gs(info.nightscout.interfaces.R.string.minago, agoMinutes)) + _lastConnectionMinAgo.postValue(rh.gs(app.aaps.interfaces.R.string.minago, agoMinutes)) } if (medtrumPump.lastBolusTime != 0L) { val agoMilliseconds = System.currentTimeMillis() - medtrumPump.lastBolusTime diff --git a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt index 3ba5be8011..d75839c2e1 100644 --- a/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt +++ b/pump/medtrum/src/main/java/info/nightscout/pump/medtrum/ui/viewmodel/MedtrumViewModel.kt @@ -3,19 +3,19 @@ package info.nightscout.pump.medtrum.ui.viewmodel import android.os.SystemClock import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue import info.nightscout.pump.medtrum.MedtrumPlugin import info.nightscout.pump.medtrum.MedtrumPump import info.nightscout.pump.medtrum.R import info.nightscout.pump.medtrum.code.ConnectionState -import info.nightscout.pump.medtrum.services.MedtrumService import info.nightscout.pump.medtrum.code.PatchStep import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState import info.nightscout.pump.medtrum.encryption.Crypt +import info.nightscout.pump.medtrum.services.MedtrumService import info.nightscout.pump.medtrum.ui.MedtrumBaseNavigator -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel diff --git a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/MedtrumPumpTest.kt b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/MedtrumPumpTest.kt index bc9e8e0952..e903183058 100644 --- a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/MedtrumPumpTest.kt +++ b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/MedtrumPumpTest.kt @@ -1,14 +1,14 @@ package info.nightscout.pump.medtrum +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.utils.T import info.nightscout.core.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileSealed -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.pump.medtrum.comm.enums.BasalType import info.nightscout.pump.medtrum.util.MedtrumSnUtil -import info.nightscout.shared.utils.T import org.json.JSONObject import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test @@ -118,7 +118,7 @@ class MedtrumPumpTest : MedtrumTestBase() { val bolusCompleted = false val amount = 1.4 - medtrumPump.bolusingTreatment = EventOverviewBolusProgress.Treatment(0.0, 0, true, 0); + medtrumPump.bolusingTreatment = EventOverviewBolusProgress.Treatment(0.0, 0, true, 0) // Call medtrumPump.handleBolusStatusUpdate(bolusType, bolusCompleted, amount) diff --git a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/MedtrumTestBase.kt b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/MedtrumTestBase.kt index d01b550d0d..f9fc59df69 100644 --- a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/MedtrumTestBase.kt +++ b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/MedtrumTestBase.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.medtrum +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.TemporaryBasalStorage +import app.aaps.interfaces.stats.TddCalculator import app.aaps.shared.tests.TestBaseWithProfile -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.TemporaryBasalStorage -import info.nightscout.interfaces.stats.TddCalculator import org.junit.jupiter.api.BeforeEach import org.mockito.Mock import org.mockito.Mockito diff --git a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/GetRecordPacketTest.kt b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/GetRecordPacketTest.kt index b6ee3914c4..b30c0adbce 100644 --- a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/GetRecordPacketTest.kt +++ b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/GetRecordPacketTest.kt @@ -1,12 +1,12 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.DetailedBolusInfoStorage +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.utils.T import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.DetailedBolusInfoStorage -import info.nightscout.interfaces.pump.PumpSync import info.nightscout.pump.medtrum.MedtrumTestBase -import info.nightscout.shared.utils.T import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/NotificationPacketTest.kt b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/NotificationPacketTest.kt index f26aca850b..374214d0cb 100644 --- a/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/NotificationPacketTest.kt +++ b/pump/medtrum/src/test/java/info/nightscout/pump/medtrum/comm/packets/NotificationPacketTest.kt @@ -1,11 +1,11 @@ package info.nightscout.pump.medtrum.comm.packets +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.pump.medtrum.MedtrumTestBase import info.nightscout.pump.medtrum.comm.enums.BasalType import info.nightscout.pump.medtrum.comm.enums.MedtrumPumpState -import info.nightscout.rx.events.EventOverviewBolusProgress import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java index 41d8559856..42bd94ca4c 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDeactivatePod.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public final class CommandDeactivatePod implements CustomCommand { @NotNull @Override public String getStatusDescription() { diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDisableSuspendAlerts.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDisableSuspendAlerts.kt index 1eca6de81e..f172687cfa 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDisableSuspendAlerts.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandDisableSuspendAlerts.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command -import info.nightscout.interfaces.queue.CustomCommand +import app.aaps.interfaces.queue.CustomCommand -class CommandDisableSuspendAlerts: CustomCommand { +class CommandDisableSuspendAlerts : CustomCommand { override val statusDescription: String get() = "DISABLE SUSPEND ALERTS" diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java index 8bc53bbafb..096e1b4970 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandHandleTimeChange.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public final class CommandHandleTimeChange implements CustomCommand { private final boolean requestedByUser; diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java index e1d0faf4d6..b9c3998bcd 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandPlayTestBeep.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public class CommandPlayTestBeep implements CustomCommand { @NotNull @Override public String getStatusDescription() { diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java index 111ab1ed9f..ca0c1cbfe7 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandResumeDelivery.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public final class CommandResumeDelivery implements CustomCommand { @NotNull @Override public String getStatusDescription() { diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSilenceAlerts.java b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSilenceAlerts.java index 3d018325fe..ab386416ac 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSilenceAlerts.java +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSilenceAlerts.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public final class CommandSilenceAlerts implements CustomCommand { @NotNull @Override public String getStatusDescription() { diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java index 25979ae779..ba90112e49 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandSuspendDelivery.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public final class CommandSuspendDelivery implements CustomCommand { @NotNull @Override public String getStatusDescription() { diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java index 4fce2f6962..c88fe2a406 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/queue/command/CommandUpdateAlertConfiguration.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public final class CommandUpdateAlertConfiguration implements CustomCommand { @NotNull @Override public String getStatusDescription() { diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/InitializePodViewModel.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/InitializePodViewModel.kt index 8556486e3e..0b60989e37 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/InitializePodViewModel.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/InitializePodViewModel.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.rx.AapsSchedulers import dagger.android.HasAndroidInjector -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger abstract class InitializePodViewModel( injector: HasAndroidInjector, diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/InsertCannulaViewModel.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/InsertCannulaViewModel.kt index 1d9bd6a383..b61f94c29a 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/InsertCannulaViewModel.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/InsertCannulaViewModel.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.rx.AapsSchedulers import dagger.android.HasAndroidInjector -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger abstract class InsertCannulaViewModel( injector: HasAndroidInjector, diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/PodActivationActionViewModelBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/PodActivationActionViewModelBase.kt index 35aa0de674..3a05842f28 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/PodActivationActionViewModelBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/activation/viewmodel/action/PodActivationActionViewModelBase.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.rx.AapsSchedulers import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger abstract class PodActivationActionViewModelBase( injector: HasAndroidInjector, diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt index bad933b22f..f35e7c28cf 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt @@ -8,9 +8,9 @@ import android.widget.ImageView import android.widget.ProgressBar import android.widget.TextView import androidx.annotation.LayoutRes +import app.aaps.interfaces.extensions.toVisibility import info.nightscout.androidaps.plugins.pump.omnipod.common.R import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase -import info.nightscout.shared.extensions.toVisibility abstract class ActionFragmentBase : WizardFragmentBase() { diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt index 9c699e8fb4..483a6ff541 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt @@ -9,13 +9,13 @@ import androidx.annotation.IdRes import androidx.annotation.LayoutRes import androidx.annotation.StringRes import androidx.navigation.fragment.findNavController +import app.aaps.interfaces.resources.ResourceHelper import dagger.android.support.DaggerFragment import info.nightscout.androidaps.plugins.pump.omnipod.common.R import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonWizardBaseFragmentBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonWizardProgressIndicationBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ViewModelBase -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import kotlin.math.roundToInt diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt index f6327e8ac2..15b3329a33 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common. import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.rx.AapsSchedulers import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/action/DeactivatePodViewModel.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/action/DeactivatePodViewModel.kt index e3d5af1e6b..9714577a9a 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/action/DeactivatePodViewModel.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/deactivation/viewmodel/action/DeactivatePodViewModel.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.action +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.rx.AapsSchedulers import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger abstract class DeactivatePodViewModel( injector: HasAndroidInjector, diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/EventOmnipodDashPumpValuesChanged.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/EventOmnipodDashPumpValuesChanged.kt index 8cf0e01c5a..2815daabf8 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/EventOmnipodDashPumpValuesChanged.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/EventOmnipodDashPumpValuesChanged.kt @@ -1,5 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventOmnipodDashPumpValuesChanged : Event() diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index ec854c0aaa..7a2531f710 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -3,6 +3,44 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash import android.os.Handler import android.os.HandlerThread import android.text.format.DateFormat +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.OwnDatabasePlugin +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.OmnipodDash +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpPluginBase +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.actions.CustomAction +import app.aaps.interfaces.pump.actions.CustomActionType +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.Command +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.queue.CustomCommand +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventRefreshOverview +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.Round +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.utils.TimeChangeType import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod @@ -36,44 +74,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.Constants import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.mapProfileToBasalProgram import info.nightscout.core.utils.DateTimeUtil import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.OwnDatabasePlugin -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.OmnipodDash -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpPluginBase -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.Command -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.Round -import info.nightscout.interfaces.utils.TimeChangeType -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventProfileSwitchChanged -import info.nightscout.rx.events.EventRefreshOverview -import info.nightscout.rx.events.EventTempBasalChange -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.core.Completable import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/di/OmnipodDashHistoryModule.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/di/OmnipodDashHistoryModule.kt index b2454347c4..67d8e223e0 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/di/OmnipodDashHistoryModule.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/di/OmnipodDashHistoryModule.kt @@ -1,6 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.di import android.content.Context +import app.aaps.interfaces.logging.AAPSLogger import dagger.Module import dagger.Provides import dagger.Reusable @@ -8,7 +9,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.DashHistory import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.DashHistoryDatabase import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.HistoryRecordDao import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.mapper.HistoryMapper -import info.nightscout.rx.logging.AAPSLogger import javax.inject.Singleton @Module diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt index b3080dd2b3..7c6db3d1cb 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt @@ -1,6 +1,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver import android.os.SystemClock +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.utils.Round import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.OmnipodDashBleManager import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event.PodEvent import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.DeactivateCommand @@ -36,10 +40,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.SetUniqueIdResponse import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.VersionResponse import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager -import info.nightscout.interfaces.utils.Round -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.functions.Action import io.reactivex.rxjava3.functions.Consumer diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt index 7cb156e673..59f5313021 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt @@ -3,6 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothManager import android.content.Context +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.BusyException import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.ConnectException import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.CouldNotSendCommandException @@ -29,9 +32,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.b import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.Response import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.Config -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import io.reactivex.rxjava3.core.Observable import java.util.concurrent.CountDownLatch import java.util.concurrent.atomic.AtomicBoolean @@ -61,22 +61,23 @@ class OmnipodDashBleManagerImpl @Inject constructor( val session = assertSessionEstablished() emitter.onNext(PodEvent.CommandSending(cmd)) - /* - if (Random.nextBoolean()) { - // XXX use this to test "failed to confirm" commands - emitter.onNext(PodEvent.CommandSendNotConfirmed(cmd)) - emitter.tryOnError(MessageIOException("XXX random failure to test unconfirmed commands")) - return@create - } -*/ + /* + if (Random.nextBoolean()) { + // XXX use this to test "failed to confirm" commands + emitter.onNext(PodEvent.CommandSendNotConfirmed(cmd)) + emitter.tryOnError(MessageIOException("XXX random failure to test unconfirmed commands")) + return@create + } + */ when (session.sendCommand(cmd)) { - is CommandSendErrorSending -> { + is CommandSendErrorSending -> { emitter.tryOnError(CouldNotSendCommandException()) return@create } - is CommandSendSuccess -> + is CommandSendSuccess -> emitter.onNext(PodEvent.CommandSent(cmd)) + is CommandSendErrorConfirming -> emitter.onNext(PodEvent.CommandSendNotConfirmed(cmd)) } @@ -90,10 +91,10 @@ class OmnipodDashBleManagerImpl @Inject constructor( is CommandReceiveSuccess -> emitter.onNext(PodEvent.ResponseReceived(cmd, readResult.result)) - is CommandAckError -> + is CommandAckError -> emitter.onNext(PodEvent.ResponseReceived(cmd, readResult.result)) - is CommandReceiveError -> { + is CommandReceiveError -> { emitter.tryOnError(MessageIOException("Could not read response: $readResult")) return@create } @@ -117,6 +118,7 @@ class OmnipodDashBleManagerImpl @Inject constructor( return connection?.connectionState() ?: NotConnected } + // used for sync connections override fun connect(timeoutMs: Long): Observable { return connect(ConnectionWaitCondition(timeoutMs = timeoutMs)) @@ -128,8 +130,7 @@ class OmnipodDashBleManagerImpl @Inject constructor( } private fun connect(connectionWaitCond: ConnectionWaitCondition): Observable = Observable - .create { - emitter -> + .create { emitter -> if (!busy.compareAndSet(false, true)) { throw BusyException() } @@ -259,6 +260,7 @@ class OmnipodDashBleManagerImpl @Inject constructor( } companion object { + const val CONTROLLER_ID = 4242 // TODO read from preferences or somewhere else. } } diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt index f2d98ad24d..3a896f11da 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/ServiceDiscoverer.kt @@ -2,6 +2,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm import android.bluetooth.BluetoothGatt import android.bluetooth.BluetoothGattCharacteristic +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.BleCommCallbacks import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.ConnectException import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.CharacteristicType @@ -9,8 +11,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session.Connection import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session.Connection.Companion.STOP_CONNECTING_CHECK_INTERVAL_MS import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session.ConnectionWaitCondition -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.math.BigInteger import java.util.UUID diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt index d7a288809e..b90a8a18e4 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/callbacks/BleCommCallbacks.kt @@ -5,12 +5,12 @@ import android.bluetooth.BluetoothGattCallback import android.bluetooth.BluetoothGattCharacteristic import android.bluetooth.BluetoothGattDescriptor import android.bluetooth.BluetoothProfile +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.CharacteristicType.Companion.byValue import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.IncomingPackets import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session.DisconnectHandler import info.nightscout.core.utils.toHex -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.UUID import java.util.concurrent.BlockingQueue import java.util.concurrent.CountDownLatch @@ -81,7 +81,7 @@ class BleCommCallbacks( fun confirmWrite(expectedPayload: ByteArray, expectedUUID: String, timeoutMs: Long): WriteConfirmation { try { return when (val received = writeQueue.poll(timeoutMs, TimeUnit.MILLISECONDS)) { - null -> WriteConfirmationError("Timeout waiting for writeConfirmation") + null -> WriteConfirmationError("Timeout waiting for writeConfirmation") is WriteConfirmationSuccess -> if (expectedPayload.contentEquals(received.payload) && expectedUUID == received.uuid @@ -95,7 +95,8 @@ class BleCommCallbacks( ) WriteConfirmationError("Received incorrect writeConfirmation") } - is WriteConfirmationError -> + + is WriteConfirmationError -> received } } catch (e: InterruptedException) { @@ -176,7 +177,7 @@ class BleCommCallbacks( private fun onWrite(status: Int, uuid: UUID?, value: ByteArray?) { val writeConfirmation = when { - uuid == null || value == null -> + uuid == null || value == null -> WriteConfirmationError("onWrite received Null: UUID=$uuid, value=${value?.toHex()} status=$status") status == BluetoothGatt.GATT_SUCCESS -> { @@ -184,7 +185,7 @@ class BleCommCallbacks( WriteConfirmationSuccess(uuid.toString(), value) } - else -> WriteConfirmationError("onDescriptorWrite status is not success: $status") + else -> WriteConfirmationError("onDescriptorWrite status is not success: $status") } try { diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/endecrypt/EnDecrypt.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/endecrypt/EnDecrypt.kt index 0942dbdd36..0246b443e0 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/endecrypt/EnDecrypt.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/endecrypt/EnDecrypt.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.endecrypt +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessagePacket import info.nightscout.core.utils.toHex -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.spongycastle.crypto.engines.AESEngine import org.spongycastle.crypto.modes.CCMBlockCipher import org.spongycastle.crypto.params.AEADParameters diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/BleIO.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/BleIO.kt index c3d0fb3988..ef1464b334 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/BleIO.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/BleIO.kt @@ -5,14 +5,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io import android.bluetooth.BluetoothGatt import android.bluetooth.BluetoothGattCharacteristic import android.bluetooth.BluetoothGattDescriptor +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.BleCommCallbacks import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.WriteConfirmationError import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.WriteConfirmationSuccess import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.command.BleCommandRTS import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.ConnectException import info.nightscout.core.utils.toHex -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.concurrent.BlockingQueue import java.util.concurrent.TimeUnit @@ -72,8 +72,9 @@ open class BleIO( DEFAULT_IO_TIMEOUT_MS ) ) { - is WriteConfirmationError -> + is WriteConfirmationError -> BleSendErrorConfirming(confirmation.msg) + is WriteConfirmationSuccess -> BleSendSuccess } @@ -121,8 +122,9 @@ open class BleIO( DEFAULT_IO_TIMEOUT_MS ) return when (confirmation) { - is WriteConfirmationError -> + is WriteConfirmationError -> throw ConnectException(confirmation.msg) + is WriteConfirmationSuccess -> BleSendSuccess } diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/CmdBleIO.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/CmdBleIO.kt index 908ca6d8d6..69181543e0 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/CmdBleIO.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/CmdBleIO.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io import android.bluetooth.BluetoothGatt import android.bluetooth.BluetoothGattCharacteristic +import app.aaps.interfaces.logging.AAPSLogger import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.OmnipodDashBleManagerImpl import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.BleCommCallbacks import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.command.BleCommand import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.command.BleCommandHello -import info.nightscout.rx.logging.AAPSLogger import java.util.concurrent.BlockingQueue sealed class BleConfirmResult diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/DataBleIO.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/DataBleIO.kt index 01ad81375c..5c0363ea38 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/DataBleIO.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/io/DataBleIO.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io import android.bluetooth.BluetoothGatt import android.bluetooth.BluetoothGattCharacteristic +import app.aaps.interfaces.logging.AAPSLogger import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.BleCommCallbacks -import info.nightscout.rx.logging.AAPSLogger import java.util.concurrent.BlockingQueue class DataBleIO( diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/message/MessageIO.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/message/MessageIO.kt index 2fe4308b04..0a41ab1d01 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/message/MessageIO.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/message/MessageIO.kt @@ -1,5 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.command.BleCommand import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.command.BleCommandAbort import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.command.BleCommandCTS @@ -20,8 +22,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.B import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadJoiner import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.packet.PayloadSplitter import info.nightscout.core.utils.toHex -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag sealed class MessageSendResult object MessageSendSuccess : MessageSendResult() @@ -88,16 +88,19 @@ class MessageIO( } return when (val expectSuccess = cmdBleIO.expectCommandType(BleCommandSuccess)) { - is BleConfirmSuccess -> + is BleConfirmSuccess -> MessageSendSuccess - is BleConfirmError -> + + is BleConfirmError -> MessageSendErrorConfirming("Error reading message confirmation: $expectSuccess") + is BleConfirmIncorrectData -> when (val received = (BleCommand.parse((expectSuccess.payload)))) { is BleCommandFail -> // this can happen if CRC does not match MessageSendErrorSending("Received FAIL after sending message") - else -> + + else -> MessageSendErrorConfirming("Received confirmation message: $received") } } @@ -165,11 +168,13 @@ class MessageIO( private fun handleSendResult(sendResult: BleSendResult, index: Int, packets: List): MessageSendResult { return when { - sendResult is BleSendSuccess -> + sendResult is BleSendSuccess -> MessageSendSuccess + index == packets.size - 1 && sendResult is BleSendErrorConfirming -> MessageSendErrorConfirming("Error confirming last DATA packet $sendResult") - else -> + + else -> MessageSendErrorSending("Error sending DATA: $sendResult") } } @@ -197,7 +202,7 @@ class MessageIO( MessageSendErrorSending("Received SUCCESS before sending all the data. $index") } - else -> + else -> MessageSendErrorSending("Received unexpected command: ${peekCmd.toHex()}") } } diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/KeyExchange.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/KeyExchange.kt index 0260c9ee08..86ba723fe1 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/KeyExchange.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/KeyExchange.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.MessageIOException import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.RandomByteGenerator import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.X25519KeyGenerator import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.Config -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.spongycastle.crypto.engines.AESEngine import org.spongycastle.crypto.macs.CMac import org.spongycastle.crypto.params.KeyParameter diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/LTKExchanger.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/LTKExchanger.kt index 72e0781181..2dbe06c220 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/LTKExchanger.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/LTKExchanger.kt @@ -1,5 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Ids import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.MessageIOException import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.PairingException @@ -11,9 +14,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.Rand import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.X25519KeyGenerator import info.nightscout.core.utils.hexStringToByteArray import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.Config -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag internal class LTKExchanger( private val aapsLogger: AAPSLogger, @@ -21,6 +21,7 @@ internal class LTKExchanger( private val msgIO: MessageIO, private val ids: Ids, ) { + private val podAddress = Ids.notActivated() private val keyExchange = KeyExchange(aapsLogger, config, X25519KeyGenerator(), RandomByteGenerator()) private var seq: Byte = 1 diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/PodScanner.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/PodScanner.kt index 854e514f2e..7c6a2c4c19 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/PodScanner.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/PodScanner.kt @@ -4,10 +4,10 @@ import android.bluetooth.BluetoothAdapter import android.bluetooth.le.ScanFilter import android.bluetooth.le.ScanSettings import android.os.ParcelUuid +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.ScanException import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.ScanFailFoundTooManyException -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.Arrays class PodScanner(private val logger: AAPSLogger, private val bluetoothAdapter: BluetoothAdapter) { diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/ScanCollector.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/ScanCollector.kt index 7bbb617967..0e646ff1ae 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/ScanCollector.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/ScanCollector.kt @@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.scan import android.bluetooth.le.ScanCallback import android.bluetooth.le.ScanResult +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.ScanException -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.Collections import java.util.concurrent.ConcurrentHashMap diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Connection.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Connection.kt index 9116b72c87..fcabe4c310 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Connection.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Connection.kt @@ -6,6 +6,10 @@ import android.bluetooth.BluetoothManager import android.bluetooth.BluetoothProfile import android.content.Context import android.os.SystemClock +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Ids import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.ServiceDiscoverer import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.callbacks.BleCommCallbacks @@ -19,10 +23,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.io.Incom import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageIO import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.concurrent.CountDownLatch sealed class ConnectionState @@ -136,8 +136,8 @@ class Connection( bleCommCallbacks.resetConnection() gattConnection = null session = null - msgIO = null - podState.bluetoothConnectionState = OmnipodDashPodStateManager.BluetoothConnectionState.DISCONNECTED + msgIO = null + podState.bluetoothConnectionState = OmnipodDashPodStateManager.BluetoothConnectionState.DISCONNECTED } } @@ -187,7 +187,7 @@ class Connection( keys.synchronizedEapSqn } - is SessionKeys -> { + is SessionKeys -> { if (config.DEBUG) { aapsLogger.info(LTag.PUMPCOMM, "CK: ${keys.ck.toHex()}") aapsLogger.info(LTag.PUMPCOMM, "msgSequenceNumber: ${keys.msgSequenceNumber}") @@ -218,6 +218,7 @@ class Connection( } companion object { + const val BASE_CONNECT_TIMEOUT_MS = 10000L const val MIN_DISCOVERY_TIMEOUT_MS = 10000L const val STOP_CONNECTING_CHECK_INTERVAL_MS = 500L diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/EapMessage.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/EapMessage.kt index 784b91f3c7..59ea99b842 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/EapMessage.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/EapMessage.kt @@ -1,13 +1,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.MessageIOException import info.nightscout.core.utils.toHex -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.nio.ByteBuffer @Suppress("unused") enum class EapCode(val code: Byte) { + REQUEST(1), RESPONSE(2), SUCCESS(3), diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Milenage.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Milenage.kt index 15e6477d15..6c03ae2d81 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Milenage.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Milenage.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session import android.annotation.SuppressLint +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.Config -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import org.spongycastle.util.encoders.Hex import java.security.SecureRandom import javax.crypto.Cipher @@ -31,6 +31,7 @@ class Milenage( } private val secretKeySpec = SecretKeySpec(k, "AES") + @SuppressLint("GetInstance") private val cipher: Cipher = Cipher.getInstance("AES/ECB/NoPadding") diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Session.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Session.kt index 91e1fb036d..4afb6efb2d 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Session.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/Session.kt @@ -1,5 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Ids import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.endecrypt.EnDecrypt import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.CouldNotParseResponseException @@ -14,8 +16,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.Command import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.Response import info.nightscout.core.utils.toHex -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag sealed class CommandSendResult object CommandSendSuccess : CommandSendResult() @@ -46,7 +46,7 @@ class Session( aapsLogger.debug(LTag.PUMPBTCOMM, "Sending command(wrapped): ${msg.payload.toHex()}") when (val sendResult = msgIO.sendMessage(msg)) { - is MessageSendSuccess -> + is MessageSendSuccess -> return CommandSendSuccess is MessageSendErrorConfirming -> { @@ -54,7 +54,7 @@ class Session( return CommandSendErrorConfirming(sendResult.msg) } - is MessageSendErrorSending -> + is MessageSendErrorSending -> aapsLogger.debug(LTag.PUMPBTCOMM, "Error sending command: $sendResult") } } diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/SessionEstablisher.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/SessionEstablisher.kt index 74467cd16b..b30fad4cdd 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/SessionEstablisher.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/SessionEstablisher.kt @@ -1,5 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Ids import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.endecrypt.Nonce import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.SessionEstablishmentException @@ -8,9 +11,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageSendSuccess import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.message.MessageType import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.Config -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.security.SecureRandom class SessionEstablisher( @@ -114,7 +114,7 @@ class SessionEstablisher( for (attr in eapMsg.attributes) { when (attr) { - is EapAkaAttributeRes -> + is EapAkaAttributeRes -> if (!milenage.res.contentEquals(attr.payload)) { throw SessionEstablishmentException( "RES mismatch." + @@ -122,9 +122,11 @@ class SessionEstablisher( "Actual: ${attr.payload.toHex()}." ) } + is EapAkaAttributeCustomIV -> nodeIV = attr.payload.copyOfRange(0, IV_SIZE) - else -> + + else -> throw SessionEstablishmentException("Unknown attribute received: $attr") } } @@ -137,7 +139,7 @@ class SessionEstablisher( if (eapMsg.attributes.size == 1 && eapMsg.attributes[0] is EapAkaAttributeClientErrorCode) { throw SessionEstablishmentException( "Received CLIENT_ERROR_CODE for EAP-AKA challenge: ${ - eapMsg.attributes[0].toByteArray().toHex() + eapMsg.attributes[0].toByteArray().toHex() }" ) } diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt index 36b66c433b..17950b493d 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt @@ -1,9 +1,15 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state -import info.nightscout.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Id import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair.PairResult -import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.* +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.ActivationProgress +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.AlarmType +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.AlertType +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.DeliveryStatus +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodStatus +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.SoftwareVersion import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.AlarmStatusResponse import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.DefaultStatusResponse import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.SetUniqueIdResponse @@ -13,7 +19,7 @@ import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single import java.io.Serializable import java.time.ZonedDateTime -import java.util.* +import java.util.EnumSet sealed class CommandConfirmationFromState object CommandSendingFailure : CommandConfirmationFromState() @@ -99,6 +105,7 @@ interface OmnipodDashPodStateManager { tempBasal: TempBasal? = null, requestedBolus: Double? = null ): Single + fun updateActiveCommand(): Maybe fun observeNoActiveCommand(): Completable fun getCommandConfirmationFromState(): CommandConfirmationFromState @@ -106,6 +113,7 @@ interface OmnipodDashPodStateManager { fun createLastBolus(requestedUnits: Double, historyId: Long, bolusType: DetailedBolusInfo.BolusType) fun markLastBolusComplete(): LastBolus? fun onStart() + /* This is called only:. It overwrites activationStatus - when activation was interrupted(application crash, killed, etc) @@ -120,12 +128,14 @@ interface OmnipodDashPodStateManager { lowReservoirAlertEnabled: Boolean, lowReservoirAlertUnits: Int ): Boolean + fun updateExpirationAlertSettings( expirationReminderEnabled: Boolean, expirationReminderHours: Int, expirationAlarmEnabled: Boolean, expirationAlarmHours: Int ): Completable + fun updateLowReservoirAlertSettings(lowReservoirAlertEnabled: Boolean, lowReservoirAlertUnits: Int): Completable data class ActiveCommand( diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt index 6b58c193bc..45b18162f3 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt @@ -1,6 +1,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state import android.os.SystemClock +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.Round import com.google.gson.Gson import info.nightscout.androidaps.plugins.pump.omnipod.dash.EventOmnipodDashPumpValuesChanged import info.nightscout.androidaps.plugins.pump.omnipod.dash.R @@ -19,12 +25,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.DefaultStatusResponse import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.SetUniqueIdResponse import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.VersionResponse -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.utils.Round -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 io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistory.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistory.kt index 9fe594192b..6f3537d1fb 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistory.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistory.kt @@ -1,5 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.history +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType.SET_BOLUS import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType.SET_TEMPORARY_BASAL @@ -19,8 +21,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.TempBas import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.HistoryRecordDao import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.HistoryRecordEntity import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.mapper.HistoryMapper -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Single import java.lang.System.currentTimeMillis @@ -67,11 +67,13 @@ class DashHistory @Inject constructor( id = currentTimeMillis() } when { - commandType == SET_BOLUS && bolusRecord == null -> + commandType == SET_BOLUS && bolusRecord == null -> Single.error(IllegalArgumentException("bolusRecord missing on SET_BOLUS")) + commandType == SET_TEMPORARY_BASAL && tempBasalRecord == null -> Single.error(IllegalArgumentException("tempBasalRecord missing on SET_TEMPORARY_BASAL")) - else -> + + else -> dao.save( HistoryRecordEntity( id = id, @@ -108,13 +110,17 @@ class DashHistory @Inject constructor( val commandConfirmation = when (podState.getCommandConfirmationFromState()) { CommandSendingFailure -> dao.setInitialResult(historyId, InitialResult.FAILURE_SENDING) + CommandSendingNotConfirmed -> dao.setInitialResult(historyId, InitialResult.SENT) + CommandConfirmationDenied -> markFailure(historyId) + CommandConfirmationSuccess -> dao.setInitialResult(historyId, InitialResult.SENT) .andThen(markSuccess(historyId)) + NoActiveCommand -> Completable.complete() } diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt index 7ccd408b1b..3595967b70 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo sealed class Record @@ -17,11 +17,12 @@ enum class BolusType { fun toBolusInfoBolusType(): DetailedBolusInfo.BolusType { return when (this) { DEFAULT -> DetailedBolusInfo.BolusType.NORMAL - SMB -> DetailedBolusInfo.BolusType.SMB + SMB -> DetailedBolusInfo.BolusType.SMB } } companion object { + fun fromBolusInfoBolusType(type: DetailedBolusInfo.BolusType): BolusType { return when (type) { DetailedBolusInfo.BolusType.SMB -> SMB diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/Converters.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/Converters.kt index 7c984afab4..844a41c027 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/Converters.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/Converters.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database import androidx.room.TypeConverter +import app.aaps.interfaces.profile.Profile import com.google.gson.GsonBuilder import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.BolusType import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.InitialResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.ResolvedResult -import info.nightscout.interfaces.profile.Profile class Converters { diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt index 67568e4cf6..2270179773 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt @@ -11,6 +11,11 @@ import android.widget.Spinner import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.dash.R import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.DashHistory @@ -22,13 +27,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.Resolve import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.TempBasalRecord import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.DateTimeUtil -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.common.defs.PumpHistoryEntryGroup import info.nightscout.pump.common.utils.ProfileUtil -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import java.util.Calendar import java.util.GregorianCalendar import javax.inject.Inject @@ -64,44 +64,55 @@ class DashPodHistoryActivity : TranslatedDaggerAppCompatActivity() { private fun groupForCommandType(type: OmnipodCommandType): PumpHistoryEntryGroup { return when (type) { - OmnipodCommandType.INITIALIZE_POD -> + OmnipodCommandType.INITIALIZE_POD -> PumpHistoryEntryGroup.Prime - OmnipodCommandType.INSERT_CANNULA -> + + OmnipodCommandType.INSERT_CANNULA -> PumpHistoryEntryGroup.Prime - OmnipodCommandType.DEACTIVATE_POD -> + + OmnipodCommandType.DEACTIVATE_POD -> PumpHistoryEntryGroup.Prime - OmnipodCommandType.DISCARD_POD -> + + OmnipodCommandType.DISCARD_POD -> PumpHistoryEntryGroup.Prime OmnipodCommandType.CANCEL_TEMPORARY_BASAL -> PumpHistoryEntryGroup.Basal - OmnipodCommandType.SET_BASAL_PROFILE -> - PumpHistoryEntryGroup.Basal - OmnipodCommandType.SET_TEMPORARY_BASAL -> - PumpHistoryEntryGroup.Basal - OmnipodCommandType.RESUME_DELIVERY -> - PumpHistoryEntryGroup.Basal - OmnipodCommandType.SUSPEND_DELIVERY -> + + OmnipodCommandType.SET_BASAL_PROFILE -> PumpHistoryEntryGroup.Basal - OmnipodCommandType.SET_BOLUS -> - PumpHistoryEntryGroup.Bolus - OmnipodCommandType.CANCEL_BOLUS -> + OmnipodCommandType.SET_TEMPORARY_BASAL -> + PumpHistoryEntryGroup.Basal + + OmnipodCommandType.RESUME_DELIVERY -> + PumpHistoryEntryGroup.Basal + + OmnipodCommandType.SUSPEND_DELIVERY -> + PumpHistoryEntryGroup.Basal + + OmnipodCommandType.SET_BOLUS -> PumpHistoryEntryGroup.Bolus - OmnipodCommandType.ACKNOWLEDGE_ALERTS -> - PumpHistoryEntryGroup.Alarm - OmnipodCommandType.CONFIGURE_ALERTS -> - PumpHistoryEntryGroup.Alarm - OmnipodCommandType.PLAY_TEST_BEEP -> + OmnipodCommandType.CANCEL_BOLUS -> + PumpHistoryEntryGroup.Bolus + + OmnipodCommandType.ACKNOWLEDGE_ALERTS -> PumpHistoryEntryGroup.Alarm - OmnipodCommandType.GET_POD_STATUS -> - PumpHistoryEntryGroup.Configuration - OmnipodCommandType.SET_TIME -> + OmnipodCommandType.CONFIGURE_ALERTS -> + PumpHistoryEntryGroup.Alarm + + OmnipodCommandType.PLAY_TEST_BEEP -> + PumpHistoryEntryGroup.Alarm + + OmnipodCommandType.GET_POD_STATUS -> PumpHistoryEntryGroup.Configuration - OmnipodCommandType.READ_POD_PULSE_LOG -> + OmnipodCommandType.SET_TIME -> + PumpHistoryEntryGroup.Configuration + + OmnipodCommandType.READ_POD_PULSE_LOG -> PumpHistoryEntryGroup.Unknown } } @@ -238,13 +249,13 @@ class DashPodHistoryActivity : TranslatedDaggerAppCompatActivity() { OmnipodCommandType.DISCARD_POD, OmnipodCommandType.SUSPEND_DELIVERY, OmnipodCommandType.RESUME_DELIVERY, - OmnipodCommandType.SET_BASAL_PROFILE -> { + OmnipodCommandType.SET_BASAL_PROFILE -> { info.nightscout.core.ui.R.attr.omniCyanColor } // User action OmnipodCommandType.PLAY_TEST_BEEP, OmnipodCommandType.ACKNOWLEDGE_ALERTS, - OmnipodCommandType.CANCEL_BOLUS -> { + OmnipodCommandType.CANCEL_BOLUS -> { info.nightscout.core.ui.R.attr.omniCyanColor } // Insulin treatment @@ -253,7 +264,7 @@ class DashPodHistoryActivity : TranslatedDaggerAppCompatActivity() { info.nightscout.core.ui.R.attr.defaultTextColor } - else -> + else -> // Other info.nightscout.core.ui.R.attr.omniGrayColor } @@ -281,7 +292,7 @@ class DashPodHistoryActivity : TranslatedDaggerAppCompatActivity() { } } - OmnipodCommandType.SET_BOLUS -> { + OmnipodCommandType.SET_BOLUS -> { val bolus = historyEntry.record as BolusRecord bolus.let { rh.gs(R.string.omnipod_common_history_bolus_value, it.amout) @@ -291,12 +302,12 @@ class DashPodHistoryActivity : TranslatedDaggerAppCompatActivity() { OmnipodCommandType.SET_BASAL_PROFILE, OmnipodCommandType.SET_TIME, OmnipodCommandType.INSERT_CANNULA, - OmnipodCommandType.RESUME_DELIVERY -> { + OmnipodCommandType.RESUME_DELIVERY -> { val basal = historyEntry.record as BasalValuesRecord ProfileUtil.getBasalProfilesDisplayable(basal.segments.toTypedArray(), PumpType.OMNIPOD_DASH) } - else -> + else -> "" } // Set some color @@ -326,12 +337,15 @@ class DashPodHistoryActivity : TranslatedDaggerAppCompatActivity() { return when { historyEntry.initialResult == InitialResult.FAILURE_SENDING -> R.string.omnipod_dash_failed_to_send - historyEntry.initialResult == InitialResult.NOT_SENT -> + + historyEntry.initialResult == InitialResult.NOT_SENT -> R.string.omnipod_dash_command_not_sent + historyEntry.initialResult == InitialResult.SENT && - historyEntry.resolvedResult == ResolvedResult.FAILURE -> + historyEntry.resolvedResult == ResolvedResult.FAILURE -> R.string.omnipod_dash_command_not_received_by_the_pod - else -> + + else -> R.string.omnipod_dash_unknown } } diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt index 2c205c502f..ff150b2e33 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt @@ -3,6 +3,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui import android.content.Context import android.content.Intent import android.os.Bundle +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandPlayTestBeep import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity @@ -14,14 +22,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivati import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt index 37dedaa608..f845dfaffe 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt @@ -8,6 +8,22 @@ import android.os.SystemClock import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewButtonsBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewPodInfoBinding @@ -27,22 +43,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.Omn import info.nightscout.core.ui.UIRunnable import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.apache.commons.lang3.StringUtils @@ -271,8 +271,10 @@ class OmnipodDashOverviewFragment : DaggerFragment() { when { connectionSuccessPercentage < 70 && podStateManager.successfulConnectionAttemptsAfterRetries > 50 -> info.nightscout.core.ui.R.attr.warningColor + connectionSuccessPercentage < 90 && podStateManager.successfulConnectionAttemptsAfterRetries > 50 -> info.nightscout.core.ui.R.attr.omniYellowColor + else -> info.nightscout.core.ui.R.attr.defaultTextColor } @@ -342,8 +344,10 @@ class OmnipodDashOverviewFragment : DaggerFragment() { when { !podStateManager.sameTimeZone -> info.nightscout.core.ui.R.attr.omniMagentaColor + timeDeviationTooBig -> info.nightscout.core.ui.R.attr.omniYellowColor + else -> info.nightscout.core.ui.R.attr.defaultTextColor } @@ -362,8 +366,10 @@ class OmnipodDashOverviewFragment : DaggerFragment() { when { expiresAt != null && ZonedDateTime.now().isAfter(expiresAt) -> info.nightscout.core.ui.R.attr.warningColor + expiresAt != null && ZonedDateTime.now().isAfter(expiresAt.minusHours(4)) -> info.nightscout.core.ui.R.attr.omniYellowColor + else -> info.nightscout.core.ui.R.attr.defaultTextColor } @@ -448,18 +454,25 @@ class OmnipodDashOverviewFragment : DaggerFragment() { val id = when (alert) { AlertType.LOW_RESERVOIR -> info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_alert_low_reservoir + AlertType.EXPIRATION -> info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_alert_expiration_advisory + AlertType.EXPIRATION_IMMINENT -> info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_alert_expiration + AlertType.USER_SET_EXPIRATION -> info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_alert_expiration_advisory + AlertType.AUTO_OFF -> info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_alert_shutdown_imminent + AlertType.SUSPEND_IN_PROGRESS -> R.string.omnipod_common_alert_delivery_suspended + AlertType.SUSPEND_ENDED -> R.string.omnipod_common_alert_delivery_suspended + else -> info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_alert_unknown_alert } @@ -527,8 +540,10 @@ class OmnipodDashOverviewFragment : DaggerFragment() { when { !podStateManager.isActivationCompleted || podStateManager.isPodKaput || podStateManager.isSuspended -> info.nightscout.core.ui.R.attr.warningColor + podStateManager.activeCommand != null -> info.nightscout.core.ui.R.attr.omniYellowColor + else -> info.nightscout.core.ui.R.attr.defaultTextColor } @@ -676,7 +691,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() { } private fun displayErrorDialog(title: String, message: String, withSound: Boolean) { - uiInteraction.runAlarm(message, title, if (withSound) info.nightscout.core.ui.R.raw.boluserror else 0) + uiInteraction.runAlarm(message, title, if (withSound) info.nightscout.core.ui.R.raw.boluserror else 0) } private fun displayOkDialog(title: String, message: String) { diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/DashPodActivationWizardActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/DashPodActivationWizardActivity.kt index 686e334c7d..072c486083 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/DashPodActivationWizardActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/DashPodActivationWizardActivity.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation import android.os.Bundle +import app.aaps.interfaces.pump.BlePreCheck import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity -import info.nightscout.interfaces.pump.BlePreCheck import javax.inject.Inject class DashPodActivationWizardActivity : PodActivationWizardActivity() { diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt index 003dbbbbf3..09b1930969 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt @@ -1,6 +1,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.action import androidx.annotation.StringRes +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InitializePodViewModel @@ -12,12 +18,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.DashHistory import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.InitialResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.ResolvedResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.I8n -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.rx.AapsSchedulers -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.core.Single import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.subscribeBy diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index 18c4767350..a0d74fd3a1 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -1,6 +1,19 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.viewmodel.action import androidx.annotation.StringRes +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InsertCannulaViewModel @@ -14,19 +27,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.Constants import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.I8n import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.mapProfileToBasalProgram import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -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.core.Single import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.subscribeBy diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt index 072a4c020d..73c2582a15 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt @@ -1,19 +1,19 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.viewmodel.action import androidx.annotation.StringRes +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.R import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.action.DeactivatePodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.logging.AAPSLogger import io.reactivex.rxjava3.core.Single import javax.inject.Inject diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt index f601c63c51..cc9105523b 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.util +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.defs.PumpType import kotlin.math.roundToInt fun mapProfileToBasalProgram(profile: Profile): BasalProgram { diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/I8n.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/I8n.kt index 08722c212f..c0a371c7d3 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/I8n.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/I8n.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.util -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.androidaps.plugins.pump.omnipod.dash.R import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.FailedToConnectException import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.NotConnectedException @@ -9,13 +9,14 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptio class I8n { companion object { + fun textFromException(exception: Throwable, rs: ResourceHelper): String { return when (exception) { - is FailedToConnectException -> rs.gs(R.string.omnipod_dash_failed_to_connect) + is FailedToConnectException -> rs.gs(R.string.omnipod_dash_failed_to_connect) is ScanFailFoundTooManyException -> rs.gs(R.string.omnipod_dash_found_too_many_pods) - is ScanException -> rs.gs(R.string.omnipod_dash_scan_failed) - is NotConnectedException -> rs.gs(R.string.omnipod_dash_connection_lost) - else -> + is ScanException -> rs.gs(R.string.omnipod_dash_scan_failed) + is NotConnectedException -> rs.gs(R.string.omnipod_dash_connection_lost) + else -> rs.gs(R.string.omnipod_dash_generic_error, exception.toString()) } } diff --git a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/KeyExchangeTest.kt b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/KeyExchangeTest.kt index 1d444e1f5c..5bc89fc2cd 100644 --- a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/KeyExchangeTest.kt +++ b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/pair/KeyExchangeTest.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair +import app.aaps.interfaces.configuration.Config import app.aaps.shared.tests.AAPSLoggerTest import app.aaps.shared.tests.TestBase import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.RandomByteGenerator import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util.X25519KeyGenerator import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.Config import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers.anyInt diff --git a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/MilenageTest.kt b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/MilenageTest.kt index b0671f0157..013b1de8d0 100644 --- a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/MilenageTest.kt +++ b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/session/MilenageTest.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session +import app.aaps.interfaces.configuration.Config import app.aaps.shared.tests.AAPSLoggerTest import app.aaps.shared.tests.TestBase import info.nightscout.core.utils.toHex -import info.nightscout.interfaces.Config import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mock diff --git a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/FunctionsTest.kt b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/FunctionsTest.kt index 5f4e57f9c3..427ff9acdc 100644 --- a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/FunctionsTest.kt +++ b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/FunctionsTest.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.util +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.Profile.ProfileValue import com.google.common.truth.Truth.assertThat import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.Profile.ProfileValue -import kotlin.test.assertFailsWith import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mockito import org.mockito.Mockito.`when` +import kotlin.test.assertFailsWith class FunctionsTest { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index 51086f1582..11d453edfd 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -30,6 +30,43 @@ import java.util.function.Supplier; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.plugin.OwnDatabasePlugin; +import app.aaps.interfaces.plugin.PluginDescription; +import app.aaps.interfaces.plugin.PluginType; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.profile.ProfileFunction; +import app.aaps.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.pump.OmnipodEros; +import app.aaps.interfaces.pump.Pump; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpPluginBase; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.actions.CustomActionType; +import app.aaps.interfaces.pump.defs.ManufacturerType; +import app.aaps.interfaces.pump.defs.PumpDescription; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.queue.Callback; +import app.aaps.interfaces.queue.CommandQueue; +import app.aaps.interfaces.queue.CustomCommand; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventAppExit; +import app.aaps.interfaces.rx.events.EventAppInitialized; +import app.aaps.interfaces.rx.events.EventDismissNotification; +import app.aaps.interfaces.rx.events.EventPreferenceChange; +import app.aaps.interfaces.rx.events.EventRefreshOverview; +import app.aaps.interfaces.rx.events.EventSWRLStatus; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.DateUtil; +import app.aaps.interfaces.utils.DecimalFormatter; +import app.aaps.interfaces.utils.Round; +import app.aaps.interfaces.utils.T; +import app.aaps.interfaces.utils.TimeChangeType; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; @@ -73,44 +110,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; import info.nightscout.core.utils.DateTimeUtil; import info.nightscout.core.utils.fabric.FabricPrivacy; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.plugin.OwnDatabasePlugin; -import info.nightscout.interfaces.plugin.PluginDescription; -import info.nightscout.interfaces.plugin.PluginType; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.profile.ProfileFunction; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.interfaces.pump.OmnipodEros; -import info.nightscout.interfaces.pump.Pump; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpPluginBase; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.actions.CustomActionType; -import info.nightscout.interfaces.pump.defs.ManufacturerType; -import info.nightscout.interfaces.pump.defs.PumpDescription; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.queue.Callback; -import info.nightscout.interfaces.queue.CommandQueue; -import info.nightscout.interfaces.queue.CustomCommand; -import info.nightscout.interfaces.ui.UiInteraction; -import info.nightscout.interfaces.utils.DecimalFormatter; -import info.nightscout.interfaces.utils.Round; -import info.nightscout.interfaces.utils.TimeChangeType; import info.nightscout.pump.common.defs.TempBasalPair; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventAppExit; -import info.nightscout.rx.events.EventAppInitialized; -import info.nightscout.rx.events.EventDismissNotification; -import info.nightscout.rx.events.EventPreferenceChange; -import info.nightscout.rx.events.EventRefreshOverview; -import info.nightscout.rx.events.EventSWRLStatus; -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; /** diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java index 2ab8d95822..2dc8b5fff8 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java @@ -4,11 +4,11 @@ import org.joda.time.LocalDateTime; import javax.inject.Inject; +import app.aaps.interfaces.resources.ResourceHelper; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType; -import info.nightscout.shared.interfaces.ResourceHelper; public class RLHistoryItemOmnipod extends RLHistoryItem { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/action/AssignAddressAction.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/action/AssignAddressAction.kt index ecab63605e..e903b923fb 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/action/AssignAddressAction.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/action/AssignAddressAction.kt @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action +import app.aaps.interfaces.logging.AAPSLogger import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.OmnipodMessage import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.AssignAddressCommand @@ -11,7 +12,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Ill import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalVersionResponseTypeException import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager -import info.nightscout.rx.logging.AAPSLogger import org.joda.time.DateTimeZone import java.security.SecureRandom import java.util.Random diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/action/SetupPodAction.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/action/SetupPodAction.java index 9b1feeb80c..7cceecb705 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/action/SetupPodAction.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/action/SetupPodAction.java @@ -4,6 +4,7 @@ import org.joda.time.DateTime; import java.util.Collections; +import app.aaps.interfaces.logging.AAPSLogger; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.OmnipodMessage; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.SetupPodCommand; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.VersionResponse; @@ -17,7 +18,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Ill import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalVersionResponseTypeException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager; import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; -import info.nightscout.rx.logging.AAPSLogger; public class SetupPodAction implements OmnipodAction { private final ErosPodStateManager podStateManager; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java index 964bd45555..504fa0c983 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java @@ -6,6 +6,8 @@ import java.util.ArrayList; import java.util.EnumSet; import java.util.List; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.CancelDeliveryCommand; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.GetStatusCommand; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType; @@ -17,8 +19,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Crc import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.MessageDecodingException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.NotEnoughDataException; import info.nightscout.pump.common.utils.ByteUtil; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; public class OmnipodMessage { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/ErosPodStateManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/ErosPodStateManager.java index d49c868cc3..796a44b270 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/ErosPodStateManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/ErosPodStateManager.java @@ -19,6 +19,8 @@ import java.util.Objects; import java.util.Optional; import java.util.function.Supplier; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.OmnipodMessage; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusUpdatableResponse; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo.PodInfoDetailedStatus; @@ -34,8 +36,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Om import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.TimeUtil; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; // TODO add nullchecks on some setters public abstract class ErosPodStateManager { @@ -62,6 +62,7 @@ public abstract class ErosPodStateManager { /** * Init Pod state but only if it has valid state. + * * @param address New Pod address */ public final void initState(int address) { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/OmnipodManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/OmnipodManager.java index 145184c2c5..0f0931f3bd 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/OmnipodManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/OmnipodManager.java @@ -11,6 +11,9 @@ import java.util.concurrent.TimeUnit; import java.util.function.BiConsumer; import java.util.function.Supplier; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.rx.AapsSchedulers; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action.AcknowledgeAlertsAction; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action.AssignAddressAction; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action.BolusAction; @@ -50,9 +53,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Pod import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.PodProgressStatusVerificationFailedException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.PrecedingCommandFailedUncertainlyException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Completable; import io.reactivex.rxjava3.core.Flowable; import io.reactivex.rxjava3.core.Single; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosActiveAlertsChanged.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosActiveAlertsChanged.kt index 0737d65302..a70c64b913 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosActiveAlertsChanged.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosActiveAlertsChanged.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.event -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event /** * Created by andy on 04.06.2018. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosFaultEventChanged.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosFaultEventChanged.kt index 3d6d93488c..be816d5c6e 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosFaultEventChanged.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosFaultEventChanged.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.event -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event /** * Created by andy on 04.06.2018. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosPumpValuesChanged.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosPumpValuesChanged.kt index a61256b424..89d8e6d862 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosPumpValuesChanged.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosPumpValuesChanged.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.event -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event /** * Created by andy on 04.06.2018. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosTbrChanged.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosTbrChanged.kt index c2c58ad4d1..7566ff27da 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosTbrChanged.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosTbrChanged.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.event -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event /** * Created by andy on 04.06.2018. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosUncertainTbrRecovered.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosUncertainTbrRecovered.kt index 1fb54c13be..bda0484cde 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosUncertainTbrRecovered.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/event/EventOmnipodErosUncertainTbrRecovered.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.event -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event /** * Created by andy on 04.06.2018. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/extensions/DetailedBolusInfoExtension.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/extensions/DetailedBolusInfoExtension.kt index cbe8fd4c9b..d51dfa4cdf 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/extensions/DetailedBolusInfoExtension.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/extensions/DetailedBolusInfoExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.extensions +import app.aaps.interfaces.pump.DetailedBolusInfo import com.google.gson.Gson -import info.nightscout.interfaces.pump.DetailedBolusInfo fun DetailedBolusInfo.toJsonString(): String = Gson().toJson(this) diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/extensions/PumpStateExtension.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/extensions/PumpStateExtension.kt index 001440a4f4..6d89a2d92a 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/extensions/PumpStateExtension.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/extensions/PumpStateExtension.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.extensions -import info.nightscout.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.PumpSync import kotlin.math.ceil import kotlin.math.max diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManager.java index 54b5ef3953..65d12b0847 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManager.java @@ -3,17 +3,17 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.manager; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventDismissNotification; +import app.aaps.interfaces.sharedPreferences.SP; import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager; import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosActiveAlertsChanged; import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosFaultEventChanged; import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosTbrChanged; import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosUncertainTbrRecovered; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventDismissNotification; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.shared.sharedPreferences.SP; @Singleton public class AapsErosPodStateManager extends ErosPodStateManager { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index b4e28fa8be..688ae7d323 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -13,6 +13,24 @@ import java.util.function.Supplier; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.notifications.Notification; +import app.aaps.interfaces.profile.Profile; +import app.aaps.interfaces.pump.DetailedBolusInfo; +import app.aaps.interfaces.pump.PumpEnactResult; +import app.aaps.interfaces.pump.PumpSync; +import app.aaps.interfaces.pump.defs.PumpType; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.AapsSchedulers; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.Event; +import app.aaps.interfaces.rx.events.EventDismissNotification; +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress; +import app.aaps.interfaces.rx.events.EventRefreshOverview; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.ui.UiInteraction; +import app.aaps.interfaces.utils.T; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; @@ -62,26 +80,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.Ero import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.profile.Profile; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.interfaces.pump.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpSync; -import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.ui.UiInteraction; import info.nightscout.pump.common.defs.TempBasalPair; import info.nightscout.pump.common.utils.ByteUtil; -import info.nightscout.rx.AapsSchedulers; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.Event; -import info.nightscout.rx.events.EventDismissNotification; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.rx.events.EventRefreshOverview; -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.subjects.SingleSubject; @Singleton diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandGetPodStatus.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandGetPodStatus.java index d8af4314aa..48e7660fc3 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandGetPodStatus.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandGetPodStatus.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public final class CommandGetPodStatus implements CustomCommand { @NotNull @Override public String getStatusDescription() { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandReadPulseLog.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandReadPulseLog.java index f7e2fcd1ec..11517a8f3a 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandReadPulseLog.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/queue/command/CommandReadPulseLog.java @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command; import org.jetbrains.annotations.NotNull; -import info.nightscout.interfaces.queue.CustomCommand; +import app.aaps.interfaces.queue.CustomCommand; public final class CommandReadPulseLog implements CustomCommand { @NotNull @Override public String getStatusDescription() { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java index 7b86ae2ca0..cc0f9a3c8a 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java @@ -8,6 +8,7 @@ import java.util.List; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType; @@ -43,7 +44,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Ril import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager; import info.nightscout.pump.common.defs.PumpDeviceState; import info.nightscout.pump.common.utils.ByteUtil; -import info.nightscout.rx.logging.LTag; /** * Created by andy on 6/29/18. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java index ffb03211bb..bfc284e9f8 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java @@ -9,6 +9,7 @@ import org.apache.commons.lang3.StringUtils; import javax.inject.Inject; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType; @@ -20,7 +21,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; import info.nightscout.pump.common.defs.PumpDeviceState; -import info.nightscout.rx.logging.LTag; /** diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.kt index 3d57a5855a..e5f9f08c1d 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.kt @@ -12,21 +12,21 @@ import android.widget.Spinner import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.profile.Profile.ProfileValue +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.PodHistoryEntryType import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.ErosHistory import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryRecordEntity import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.interfaces.profile.Profile.ProfileValue -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.common.defs.PumpHistoryEntryGroup import info.nightscout.pump.common.defs.PumpHistoryEntryGroup.Companion.getTranslatedList import info.nightscout.pump.common.defs.TempBasalPair import info.nightscout.pump.common.utils.ProfileUtil.getBasalProfilesDisplayable -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import java.util.Calendar import java.util.GregorianCalendar import javax.inject.Inject diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt index 8ec8aeaa40..4f790c148e 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt @@ -5,6 +5,15 @@ import android.content.Intent import android.os.Bundle import android.os.Handler import android.os.HandlerThread +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.ui.UiInteraction import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity @@ -26,15 +35,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivati import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -121,7 +121,11 @@ class ErosPodManagementActivity : TranslatedDaggerAppCompatActivity() { if (!result.success) { displayErrorDialog( rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_warning), - rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_two_strings_concatenated_by_colon, rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_error_failed_to_play_test_beep), result.comment), + rh.gs( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_two_strings_concatenated_by_colon, + rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_error_failed_to_play_test_beep), + result.comment + ), false ) } @@ -138,7 +142,11 @@ class ErosPodManagementActivity : TranslatedDaggerAppCompatActivity() { if (!result.success) { displayErrorDialog( rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_warning), - rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_two_strings_concatenated_by_colon, rh.gs(R.string.omnipod_eros_error_failed_to_read_pulse_log), result.comment), + rh.gs( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_two_strings_concatenated_by_colon, + rh.gs(R.string.omnipod_eros_error_failed_to_read_pulse_log), + result.comment + ), false ) } diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt index 6af36a391a..fd74b90735 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt @@ -8,6 +8,21 @@ import android.text.TextUtils import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.configuration.Constants +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissNotification +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.rx.events.EventQueueChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState @@ -35,21 +50,6 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissNotification -import info.nightscout.rx.events.EventPreferenceChange -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.apache.commons.lang3.StringUtils @@ -136,7 +136,10 @@ class OmnipodErosOverviewFragment : DaggerFragment() { disablePodActionButtons() commandQueue.customCommand( CommandResumeDelivery(), - DisplayResultDialogCallback(rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_error_failed_to_resume_delivery), true).messageOnSuccess(rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_confirmation_delivery_resumed)) + DisplayResultDialogCallback( + rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_error_failed_to_resume_delivery), + true + ).messageOnSuccess(rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_confirmation_delivery_resumed)) ) } @@ -243,7 +246,12 @@ class OmnipodErosOverviewFragment : DaggerFragment() { rileyLinkServiceState.isError && rileyLinkError != null -> "{fa-bluetooth-b} " + rh.gs(rileyLinkError.getResourceId(RileyLinkTargetDevice.Omnipod)) else -> "{fa-bluetooth-b} " + rh.gs(resourceId) } - rileyLinkStatusBinding.rileyLinkStatus.setTextColor(rh.gac(context, if (rileyLinkServiceState.isError || rileyLinkError != null) info.nightscout.core.ui.R.attr.warningColor else info.nightscout.core.ui.R.attr.defaultTextColor)) + rileyLinkStatusBinding.rileyLinkStatus.setTextColor( + rh.gac( + context, + if (rileyLinkServiceState.isError || rileyLinkError != null) info.nightscout.core.ui.R.attr.warningColor else info.nightscout.core.ui.R.attr.defaultTextColor + ) + ) } private fun updateOmnipodStatus() { @@ -320,14 +328,20 @@ class OmnipodErosOverviewFragment : DaggerFragment() { // base basal rate podInfoBinding.baseBasalRate.text = if (podStateManager.isPodActivationCompleted) { - rh.gs(info.nightscout.core.ui.R.string.pump_base_basal_rate, omnipodErosPumpPlugin.model().determineCorrectBasalSize(podStateManager.basalSchedule.rateAt(TimeUtil.toDuration(DateTime.now())))) + rh.gs( + info.nightscout.core.ui.R.string.pump_base_basal_rate, + omnipodErosPumpPlugin.model().determineCorrectBasalSize(podStateManager.basalSchedule.rateAt(TimeUtil.toDuration(DateTime.now()))) + ) } else { PLACEHOLDER } // total delivered podInfoBinding.totalDelivered.text = if (podStateManager.isPodActivationCompleted && podStateManager.totalInsulinDelivered != null) { - rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_overview_total_delivered_value, podStateManager.totalInsulinDelivered - OmnipodConstants.POD_SETUP_UNITS) + rh.gs( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_overview_total_delivered_value, + podStateManager.totalInsulinDelivered - OmnipodConstants.POD_SETUP_UNITS + ) } else { PLACEHOLDER } @@ -481,7 +495,14 @@ class OmnipodErosOverviewFragment : DaggerFragment() { var text: String val textColor: Int - text = rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_overview_temp_basal_value, amount, dateUtil.timeString(startTime.millis), minutesRunning, duration.standardMinutes) + text = + rh.gs( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_overview_temp_basal_value, + amount, + dateUtil.timeString(startTime.millis), + minutesRunning, + duration.standardMinutes + ) if (podStateManager.isTempBasalCertain) { textColor = rh.gac(context, info.nightscout.core.ui.R.attr.defaultTextColor) } else { @@ -629,7 +650,10 @@ class OmnipodErosOverviewFragment : DaggerFragment() { } seconds < 60 * 60 -> { // < 1 hour - return rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_time_ago, rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_minutes, minutes, minutes)) + return rh.gs( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_time_ago, + rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_minutes, minutes, minutes) + ) } seconds < 24 * 60 * 60 -> { // < 1 day @@ -638,10 +662,17 @@ class OmnipodErosOverviewFragment : DaggerFragment() { return rh.gs( info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_time_ago, rh.gs( - info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_composite_time, rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_hours, hours, hours), rh.gq( - info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_minutes, minutesLeft, minutesLeft)) + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_composite_time, + rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_hours, hours, hours), + rh.gq( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_minutes, minutesLeft, minutesLeft + ) + ) ) - return rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_time_ago, rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_hours, hours, hours)) + return rh.gs( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_time_ago, + rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_hours, hours, hours) + ) } else -> { @@ -651,10 +682,17 @@ class OmnipodErosOverviewFragment : DaggerFragment() { return rh.gs( info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_time_ago, rh.gs( - info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_composite_time, rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_days, days, days), rh.gq( - info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_hours, hoursLeft, hoursLeft)) + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_composite_time, + rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_days, days, days), + rh.gq( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_hours, hoursLeft, hoursLeft + ) + ) ) - return rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_time_ago, rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_days, days, days)) + return rh.gs( + info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_time_ago, + rh.gq(info.nightscout.androidaps.plugins.pump.omnipod.common.R.plurals.omnipod_common_days, days, days) + ) } } } @@ -681,7 +719,11 @@ class OmnipodErosOverviewFragment : DaggerFragment() { } actionOnSuccess?.run() } else { - displayErrorDialog(rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_warning), rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_two_strings_concatenated_by_colon, errorMessagePrefix, result.comment), withSoundOnError) + displayErrorDialog( + rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_warning), + rh.gs(info.nightscout.androidaps.plugins.pump.omnipod.common.R.string.omnipod_common_two_strings_concatenated_by_colon, errorMessagePrefix, result.comment), + withSoundOnError + ) } } diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt index 2a96bf63ee..089f23a763 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.action import androidx.annotation.StringRes +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.rx.AapsSchedulers import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InitializePodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger import io.reactivex.rxjava3.core.Single import javax.inject.Inject diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt index 74e9c53d4b..ced7b3dd11 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.viewmodel.action import androidx.annotation.StringRes +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.rx.AapsSchedulers import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InsertCannulaViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger import io.reactivex.rxjava3.core.Single import javax.inject.Inject diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt index 2047bb511e..d5b183c680 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt @@ -1,16 +1,16 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.viewmodel.action import androidx.annotation.StringRes +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.rx.AapsSchedulers import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.omnipod.common.R import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.action.DeactivatePodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.logging.AAPSLogger import io.reactivex.rxjava3.core.Single import javax.inject.Inject diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java index 91a3dea451..66a7552bb9 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java @@ -16,11 +16,11 @@ import java.util.List; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.resources.ResourceHelper; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager; -import info.nightscout.shared.interfaces.ResourceHelper; /** * Created by andy on 4/8/19. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/OmnipodAlertUtil.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/OmnipodAlertUtil.java index 02ef384686..d6c07dad45 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/OmnipodAlertUtil.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/OmnipodAlertUtil.java @@ -5,9 +5,9 @@ import org.joda.time.Duration; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.sharedPreferences.SP; import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; -import info.nightscout.shared.sharedPreferences.SP; @Singleton public class OmnipodAlertUtil { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt index 61738697fa..bc61e9afde 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt @@ -1,5 +1,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DecimalFormatter import app.aaps.shared.tests.TestBase import app.aaps.shared.tests.rx.TestAapsSchedulers import dagger.android.AndroidInjector @@ -8,15 +16,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryDatabase import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager import info.nightscout.implementation.utils.DecimalFormatterImpl -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.pump.common.defs.TempBasalPair -import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.DateTimeZone import org.joda.time.tz.UTCProvider import org.junit.jupiter.api.Assertions diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.kt index 486dab6a55..9d128d86d1 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.kt @@ -1,13 +1,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.Profile.ProfileValue import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.Profile.ProfileValue -import kotlin.test.assertFailsWith import org.joda.time.Duration import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mockito +import kotlin.test.assertFailsWith internal class AapsOmnipodErosManagerTest { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManagerTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManagerTest.kt index e159fb8005..5e981086ed 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManagerTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsErosPodStateManagerTest.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.manager +import app.aaps.interfaces.sharedPreferences.SP import app.aaps.shared.tests.TestBase import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FirmwareVersion import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus -import info.nightscout.shared.sharedPreferences.SP import org.joda.time.DateTime import org.joda.time.DateTimeUtils import org.joda.time.DateTimeZone diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/PumpPluginAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/PumpPluginAbstract.kt index fbf9738856..0a7eba89ac 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/PumpPluginAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/PumpPluginAbstract.kt @@ -4,40 +4,40 @@ import android.content.Context import android.content.Intent import android.content.ServiceConnection import android.text.format.DateFormat +import app.aaps.interfaces.constraints.PluginConstraints +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpPluginBase +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.PumpSync.TemporaryBasalType +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventAppExit +import app.aaps.interfaces.rx.events.EventCustomActionsChanged +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter import com.google.gson.Gson import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.constraints.PluginConstraints -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpPluginBase -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.PumpSync.TemporaryBasalType -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.pump.common.data.PumpStatus import info.nightscout.pump.common.defs.PumpDriverState import info.nightscout.pump.common.sync.PumpDbEntryCarbs import info.nightscout.pump.common.sync.PumpSyncEntriesCreator import info.nightscout.pump.common.sync.PumpSyncStorage -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventAppExit -import info.nightscout.rx.events.EventCustomActionsChanged -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 io.reactivex.rxjava3.disposables.CompositeDisposable import org.json.JSONException import org.json.JSONObject diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/ble/BondStateReceiver.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/ble/BondStateReceiver.kt index 480de2adb1..73e51ad17a 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/ble/BondStateReceiver.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/ble/BondStateReceiver.kt @@ -4,15 +4,15 @@ import android.bluetooth.BluetoothDevice import android.content.Context import android.content.Intent import androidx.annotation.StringRes +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import com.google.gson.Gson import dagger.android.DaggerBroadcastReceiver import info.nightscout.core.utils.extensions.safeGetParcelableExtra import info.nightscout.pump.common.events.EventPumpConnectionParametersChanged -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 javax.inject.Inject class BondStateReceiver( diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/data/PumpStatus.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/data/PumpStatus.kt index 311522e5db..553eadcf01 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/data/PumpStatus.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/data/PumpStatus.kt @@ -1,6 +1,6 @@ package info.nightscout.pump.common.data -import info.nightscout.interfaces.pump.defs.PumpType +import app.aaps.interfaces.pump.defs.PumpType import info.nightscout.pump.common.defs.PumpRunningState import java.util.Date diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/defs/PumpDriverState.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/defs/PumpDriverState.kt index 601a0db542..933f52166a 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/defs/PumpDriverState.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/defs/PumpDriverState.kt @@ -9,14 +9,14 @@ enum class PumpDriverState(var resourceId: Int) { NotInitialized(R.string.pump_status_not_initialized), // this state should be set only when driver is created Connecting(info.nightscout.core.ui.R.string.connecting), // - Connected(info.nightscout.interfaces.R.string.connected), // + Connected(app.aaps.interfaces.R.string.connected), // Initialized(R.string.pump_status_initialized), // this is weird state that probably won't be used, since its more driver centric that communication centric EncryptCommunication(R.string.pump_status_encrypt), // Ready(R.string.pump_status_ready), Busy(R.string.pump_status_busy), // Suspended(R.string.pump_status_suspended), // ExecutingCommand(R.string.pump_status_executing_command), - Disconnecting(info.nightscout.interfaces.R.string.disconnecting), + Disconnecting(app.aaps.interfaces.R.string.disconnecting), Disconnected(info.nightscout.core.ui.R.string.disconnected); fun isConnected(): Boolean = this == Connected || this == Initialized || this == Busy || this == Suspended diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/defs/PumpHistoryEntryGroup.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/defs/PumpHistoryEntryGroup.kt index d87afc8b35..0c1782d3cb 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/defs/PumpHistoryEntryGroup.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/defs/PumpHistoryEntryGroup.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.common.defs +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.pump.common.R -import info.nightscout.shared.interfaces.ResourceHelper import kotlin.streams.toList /** diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/di/PumpCommonModule.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/di/PumpCommonModule.kt index 196295cbeb..1cdcf65a25 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/di/PumpCommonModule.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/di/PumpCommonModule.kt @@ -1,11 +1,11 @@ package info.nightscout.pump.common.di +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.sharedPreferences.SP import dagger.Module import dagger.Provides -import info.nightscout.interfaces.pump.PumpSync import info.nightscout.pump.common.sync.PumpSyncStorage -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Singleton @Module diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/driver/ble/PumpBLESelectorAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/driver/ble/PumpBLESelectorAbstract.kt index 4d1ae9412f..8c4e44c5e2 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/driver/ble/PumpBLESelectorAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/driver/ble/PumpBLESelectorAbstract.kt @@ -5,14 +5,14 @@ import android.bluetooth.le.ScanFilter import android.bluetooth.le.ScanSettings import android.content.Context import android.widget.Toast +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.pump.common.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 -abstract class PumpBLESelectorAbstract constructor( +abstract class PumpBLESelectorAbstract( var resourceHelper: ResourceHelper, var aapsLogger: AAPSLogger, var sp: SP, diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/driver/history/PumpHistoryEntry.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/driver/history/PumpHistoryEntry.kt index a0b45c0acd..fb0f6cb08d 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/driver/history/PumpHistoryEntry.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/driver/history/PumpHistoryEntry.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.common.driver.history +import app.aaps.interfaces.resources.ResourceHelper import info.nightscout.pump.common.defs.PumpHistoryEntryGroup -import info.nightscout.shared.interfaces.ResourceHelper interface PumpHistoryEntry { diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventBondChanged.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventBondChanged.kt index 65c02b013c..5d14e0a90b 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventBondChanged.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventBondChanged.kt @@ -1,6 +1,6 @@ package info.nightscout.pump.common.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventBondChanged( var connectionAddress: String, diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpChanged.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpChanged.kt index 4a2b93cc7f..b437f40c34 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpChanged.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpChanged.kt @@ -1,7 +1,9 @@ package info.nightscout.pump.common.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event -class EventPumpChanged(var serialNumber: String, - var connectionAddress: String, - var parameters: MutableMap? = null) : Event() \ No newline at end of file +class EventPumpChanged( + var serialNumber: String, + var connectionAddress: String, + var parameters: MutableMap? = null +) : Event() \ No newline at end of file diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpConnectionParametersChanged.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpConnectionParametersChanged.kt index 6c588af1df..cbfeba1eb9 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpConnectionParametersChanged.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpConnectionParametersChanged.kt @@ -1,5 +1,5 @@ package info.nightscout.pump.common.events -import info.nightscout.rx.events.Event +import app.aaps.interfaces.rx.events.Event class EventPumpConnectionParametersChanged : Event() \ No newline at end of file diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpFragmentValuesChanged.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpFragmentValuesChanged.kt index d3a96037f3..6b1496da0b 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpFragmentValuesChanged.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/events/EventPumpFragmentValuesChanged.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.common.events +import app.aaps.interfaces.rx.events.Event import info.nightscout.pump.common.defs.PumpUpdateFragmentType -import info.nightscout.rx.events.Event class EventPumpFragmentValuesChanged : Event { diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpDbEntry.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpDbEntry.kt index 98c6d1c021..80a3b8e6a1 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpDbEntry.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpDbEntry.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.common.sync -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType // data class PumpDbEntry constructor(var temporaryId: Long, // var date: Long, @@ -41,6 +41,7 @@ import info.nightscout.interfaces.pump.defs.PumpType // } interface PumpDbEntry { + var temporaryId: Long var date: Long var pumpType: PumpType @@ -48,65 +49,83 @@ interface PumpDbEntry { var pumpId: Long? } +data class PumpDbEntryBolus( + override var temporaryId: Long, + override var date: Long, + override var pumpType: PumpType, + override var serialNumber: String, + override var pumpId: Long? = null, + var insulin: Double, + var carbs: Double, + var bolusType: DetailedBolusInfo.BolusType +) : PumpDbEntry { -data class PumpDbEntryBolus(override var temporaryId: Long, - override var date: Long, - override var pumpType: PumpType, - override var serialNumber: String, - override var pumpId: Long? = null, - var insulin: Double, - var carbs: Double, - var bolusType: DetailedBolusInfo.BolusType) : PumpDbEntry { - - constructor(temporaryId: Long, - date: Long, - pumpType: PumpType, - serialNumber: String, - detailedBolusInfo: DetailedBolusInfo - ) : this(temporaryId, date, pumpType, serialNumber, null, - detailedBolusInfo.insulin, - detailedBolusInfo.carbs, - detailedBolusInfo.bolusType) + constructor( + temporaryId: Long, + date: Long, + pumpType: PumpType, + serialNumber: String, + detailedBolusInfo: DetailedBolusInfo + ) : this( + temporaryId, date, pumpType, serialNumber, null, + detailedBolusInfo.insulin, + detailedBolusInfo.carbs, + detailedBolusInfo.bolusType + ) } -data class PumpDbEntryCarbs(var date: Long, - var carbs: Double, - var pumpType: PumpType, - var serialNumber: String, - var pumpId: Long? = null) { +data class PumpDbEntryCarbs( + var date: Long, + var carbs: Double, + var pumpType: PumpType, + var serialNumber: String, + var pumpId: Long? = null +) { - constructor(detailedBolusInfo: DetailedBolusInfo, - creator: PumpSyncEntriesCreator - ) : this(detailedBolusInfo.timestamp, - detailedBolusInfo.carbs, - creator.model(), - creator.serialNumber()) + constructor( + detailedBolusInfo: DetailedBolusInfo, + creator: PumpSyncEntriesCreator + ) : this( + detailedBolusInfo.timestamp, + detailedBolusInfo.carbs, + creator.model(), + creator.serialNumber() + ) } -data class PumpDbEntryTBR(override var temporaryId: Long, - override var date: Long, - override var pumpType: PumpType, - override var serialNumber: String, - override var pumpId: Long? = null, - var rate: Double, - var isAbsolute: Boolean, - var durationInSeconds: Int, - var tbrType: PumpSync.TemporaryBasalType) : PumpDbEntry { +data class PumpDbEntryTBR( + override var temporaryId: Long, + override var date: Long, + override var pumpType: PumpType, + override var serialNumber: String, + override var pumpId: Long? = null, + var rate: Double, + var isAbsolute: Boolean, + var durationInSeconds: Int, + var tbrType: PumpSync.TemporaryBasalType +) : PumpDbEntry { - constructor(rate: Double, - isAbsolute: Boolean, - durationInSeconds: Int, - tbrType: PumpSync.TemporaryBasalType) : this(0, 0, PumpType.GENERIC_AAPS, "", null, - rate, isAbsolute, durationInSeconds, tbrType) + constructor( + rate: Double, + isAbsolute: Boolean, + durationInSeconds: Int, + tbrType: PumpSync.TemporaryBasalType + ) : this( + 0, 0, PumpType.GENERIC_AAPS, "", null, + rate, isAbsolute, durationInSeconds, tbrType + ) - constructor(temporaryId: Long, - date: Long, - pumpType: PumpType, - serialNumber: String, - entry: PumpDbEntryTBR, - pumpId: Long? - ) : this(temporaryId, date, pumpType, serialNumber, pumpId, - entry.rate, entry.isAbsolute, entry.durationInSeconds, entry.tbrType) + constructor( + temporaryId: Long, + date: Long, + pumpType: PumpType, + serialNumber: String, + entry: PumpDbEntryTBR, + pumpId: Long? + ) : this( + temporaryId, date, pumpType, serialNumber, pumpId, + entry.rate, entry.isAbsolute, entry.durationInSeconds, entry.tbrType + ) } diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncEntriesCreator.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncEntriesCreator.kt index 629a955c78..1c133e50fa 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncEntriesCreator.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncEntriesCreator.kt @@ -1,6 +1,6 @@ package info.nightscout.pump.common.sync -import info.nightscout.interfaces.pump.defs.PumpType +import app.aaps.interfaces.pump.defs.PumpType interface PumpSyncEntriesCreator { diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncStorage.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncStorage.kt index a5868066bf..b7ad416e71 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncStorage.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/sync/PumpSyncStorage.kt @@ -1,13 +1,13 @@ package info.nightscout.pump.common.sync import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.sharedPreferences.SP import com.thoughtworks.xstream.XStream import com.thoughtworks.xstream.security.AnyTypePermission -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpBLEConfigActivity.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpBLEConfigActivity.kt index 4be0fe78e6..3c287034c0 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpBLEConfigActivity.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpBLEConfigActivity.kt @@ -19,19 +19,19 @@ import android.widget.AdapterView import android.widget.AdapterView.OnItemClickListener import android.widget.BaseAdapter import android.widget.TextView +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.BlePreCheck +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.BlePreCheck import info.nightscout.pump.common.R import info.nightscout.pump.common.databinding.PumpBleConfigActivityBinding import info.nightscout.pump.common.driver.PumpDriverConfigurationCapable import info.nightscout.pump.common.driver.ble.PumpBLESelector import info.nightscout.pump.common.driver.ble.PumpBLESelectorText -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 org.apache.commons.lang3.StringUtils import javax.inject.Inject @@ -314,11 +314,13 @@ class PumpBLEConfigActivity : TranslatedDaggerAppCompatActivity() { } internal class ViewHolder { + var deviceName: TextView? = null var deviceAddress: TextView? = null } companion object { + private val TAG = LTag.PUMPBTCOMM private const val SCAN_PERIOD_MILLIS: Long = 15000 } diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpHistoryActivity.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpHistoryActivity.kt index ab4f66d5cc..701519734b 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpHistoryActivity.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/ui/PumpHistoryActivity.kt @@ -11,8 +11,10 @@ import android.widget.ArrayAdapter import android.widget.TextView import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.pump.common.R import info.nightscout.pump.common.databinding.PumpHistoryActivityBinding import info.nightscout.pump.common.defs.PumpHistoryEntryGroup @@ -20,8 +22,6 @@ import info.nightscout.pump.common.driver.PumpDriverConfigurationCapable import info.nightscout.pump.common.driver.history.PumpHistoryDataProvider import info.nightscout.pump.common.driver.history.PumpHistoryEntry import info.nightscout.pump.common.driver.history.PumpHistoryText -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import javax.inject.Inject class PumpHistoryActivity : TranslatedDaggerAppCompatActivity() { @@ -201,6 +201,7 @@ class PumpHistoryActivity : TranslatedDaggerAppCompatActivity() { } companion object { + var showingType: TypeList? = null var selectedGroup = PumpHistoryEntryGroup.All } diff --git a/pump/pump-common/src/main/java/info/nightscout/pump/common/utils/ProfileUtil.kt b/pump/pump-common/src/main/java/info/nightscout/pump/common/utils/ProfileUtil.kt index 5442213f9d..89a1571208 100644 --- a/pump/pump-common/src/main/java/info/nightscout/pump/common/utils/ProfileUtil.kt +++ b/pump/pump-common/src/main/java/info/nightscout/pump/common/utils/ProfileUtil.kt @@ -1,8 +1,8 @@ package info.nightscout.pump.common.utils -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.Profile.ProfileValue -import info.nightscout.interfaces.pump.defs.PumpType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.Profile.ProfileValue +import app.aaps.interfaces.pump.defs.PumpType import java.util.Locale object ProfileUtil { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt index 25967a61f5..02915d4486 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt @@ -25,6 +25,12 @@ import android.widget.BaseAdapter import android.widget.TextView import android.widget.Toast import androidx.core.app.ActivityCompat +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.pump.BlePreCheck +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil @@ -33,12 +39,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.pump.BlePreCheck -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.apache.commons.lang3.StringUtils import java.util.Locale import javax.inject.Inject diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt index 4af55d38f2..35e22732a9 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.common.events import android.content.Context +import app.aaps.interfaces.rx.events.EventStatus import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.pump.common.defs.PumpDeviceState -import info.nightscout.rx.events.EventStatus open class EventRileyLinkDeviceStatusChange : EventStatus { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java index 4d8b633f9b..bce34d333f 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java @@ -4,6 +4,11 @@ import java.util.Locale; import javax.inject.Inject; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.plugin.ActivePlugin; +import app.aaps.interfaces.sharedPreferences.SP; +import app.aaps.interfaces.utils.Round; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; @@ -19,13 +24,8 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask; -import info.nightscout.interfaces.plugin.ActivePlugin; -import info.nightscout.interfaces.utils.Round; import info.nightscout.pump.common.defs.PumpDeviceState; import info.nightscout.pump.common.utils.ByteUtil; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; -import info.nightscout.shared.sharedPreferences.SP; /** * This is abstract class for RileyLink Communication, this one needs to be extended by specific "Pump" class. @@ -275,8 +275,7 @@ public abstract class RileyLinkCommunicationManager { for (int k = 0; k < results.trials.size(); k++) { FrequencyTrial one = results.trials.get(k); - stringBuilder.append(String.format("Scan Result[%s]: Freq=%s, avg RSSI = %s\n", "" + k, "" - + one.frequencyMHz, "" + one.averageRSSI + ", RSSIs =" + one.rssiList)); + stringBuilder.append(String.format("Scan Result[%s]: Freq=%s, avg RSSI = %s\n", String.valueOf(k), String.valueOf(one.frequencyMHz), one.averageRSSI + ", RSSIs =" + one.rssiList)); } aapsLogger.info(LTag.PUMPBTCOMM, stringBuilder.toString()); diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java index 22d4e26f04..22fd2ebacb 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkUtil.java @@ -15,12 +15,12 @@ import java.util.UUID; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.encoding.Encoding4b6b; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.encoding.Encoding4b6bGeoff; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.BleAdvertisedData; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; -import info.nightscout.rx.logging.AAPSLogger; /** * Created by andy on 17/05/2018. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java index fb3b92cec1..846740b502 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java @@ -11,6 +11,12 @@ import java.util.UUID; import javax.inject.Inject; import javax.inject.Singleton; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; +import app.aaps.interfaces.resources.ResourceHelper; +import app.aaps.interfaces.rx.bus.RxBus; +import app.aaps.interfaces.rx.events.EventRefreshOverview; +import app.aaps.interfaces.sharedPreferences.SP; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; @@ -34,12 +40,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.Riley import info.nightscout.pump.common.utils.ByteUtil; import info.nightscout.pump.common.utils.StringUtil; import info.nightscout.pump.common.utils.ThreadUtil; -import info.nightscout.rx.bus.RxBus; -import info.nightscout.rx.events.EventRefreshOverview; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.shared.sharedPreferences.SP; /** * Created by geoff on 5/26/16. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt index da287bf9c3..ea80548f71 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt @@ -1,13 +1,13 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble import android.os.SystemClock +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operations.BLECommOperationResult import info.nightscout.pump.common.utils.ByteUtil import info.nightscout.pump.common.utils.ThreadUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.UUID import java.util.concurrent.Executors import java.util.concurrent.LinkedBlockingQueue diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt index 30dae13705..924ce82e0f 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt @@ -15,6 +15,10 @@ import android.content.pm.PackageManager import android.os.Build import android.os.SystemClock import androidx.core.content.ContextCompat +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes @@ -27,12 +31,8 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operation import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData -import info.nightscout.interfaces.Config import info.nightscout.pump.common.utils.ByteUtil import info.nightscout.pump.common.utils.ThreadUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import org.apache.commons.lang3.StringUtils import java.util.Locale import java.util.UUID diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java index 2db619d85e..be43360c1a 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java @@ -4,6 +4,8 @@ import org.apache.commons.lang3.NotImplementedException; import javax.inject.Inject; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; @@ -14,8 +16,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.Rile import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; import info.nightscout.androidaps.plugins.pump.common.utils.CRC; import info.nightscout.pump.common.utils.ByteUtil; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; /** * Created by geoff on 5/30/16. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java index c07b7fd75f..3619f0bb81 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.encoding; +import app.aaps.interfaces.logging.AAPSLogger; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; import info.nightscout.pump.common.utils.ByteUtil; -import info.nightscout.rx.logging.AAPSLogger; /** diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java index 58141884f9..ff37096e46 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java @@ -4,10 +4,10 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; +import app.aaps.interfaces.logging.AAPSLogger; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkBLEError; import info.nightscout.pump.common.utils.ByteUtil; -import info.nightscout.rx.logging.AAPSLogger; /** * Created by andy on 11/24/18. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java index 6d8fdb163a..23c39f3c09 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java @@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs; import java.util.HashMap; import java.util.Map; +import app.aaps.interfaces.resources.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R; -import info.nightscout.shared.interfaces.ResourceHelper; public enum RileyLinkEncodingType { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt index 71eb82a68c..ed8a1470df 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt @@ -9,15 +9,15 @@ import android.bluetooth.le.ScanSettings import android.os.Handler import android.os.HandlerThread import android.os.Message +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operations.BLECommOperationResult import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData import info.nightscout.pump.common.utils.ByteUtil -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import java.util.UUID import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java index 5d6a70c592..4ef6b3404c 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicReadOperation.java @@ -7,10 +7,10 @@ import android.os.SystemClock; import java.util.UUID; import java.util.concurrent.TimeUnit; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; /** * Created by geoff on 5/26/16. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java index 700019cde0..3b216cd0e0 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/CharacteristicWriteOperation.java @@ -7,10 +7,10 @@ import android.os.SystemClock; import java.util.UUID; import java.util.concurrent.TimeUnit; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; /** * Created by geoff on 5/26/16. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java index 68674f5a68..969ebad26e 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/operations/DescriptorWriteOperation.java @@ -7,9 +7,9 @@ import android.os.SystemClock; import java.util.UUID; import java.util.concurrent.TimeUnit; +import app.aaps.interfaces.logging.AAPSLogger; +import app.aaps.interfaces.logging.LTag; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkBLE; -import info.nightscout.rx.logging.AAPSLogger; -import info.nightscout.rx.logging.LTag; /** * Created by geoff on 5/26/16. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java index def20af6bf..c919b11fb5 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java @@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data; import org.joda.time.LocalDateTime; +import app.aaps.interfaces.resources.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; import info.nightscout.pump.common.defs.PumpDeviceState; -import info.nightscout.shared.interfaces.ResourceHelper; /** diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.kt index 2fd7f8c177..9f0d3a5c41 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusActivity.kt @@ -4,11 +4,11 @@ import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.viewpager2.adapter.FragmentStateAdapter +import app.aaps.interfaces.resources.ResourceHelper import com.google.android.material.tabs.TabLayoutMediator import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusBinding import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class RileyLinkStatusActivity : TranslatedDaggerAppCompatActivity() { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt index 7607ca8837..16d1bcd703 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt @@ -4,17 +4,17 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusGeneralBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData -import info.nightscout.interfaces.plugin.ActivePlugin -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.Inject class RileyLinkStatusGeneralFragment : DaggerFragment() { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt index 591eede326..810c59bc21 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt @@ -6,6 +6,8 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil import dagger.android.support.DaggerFragment import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil @@ -13,8 +15,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistor import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusHistoryBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusHistoryItemBinding import info.nightscout.pump.common.defs.PumpDeviceState -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import javax.inject.Inject class RileyLinkStatusHistoryFragment : DaggerFragment() { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt index e2c3928377..5582a45b00 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBluetoothStateReceiver.kt @@ -4,14 +4,15 @@ import android.bluetooth.BluetoothAdapter import android.content.Context import android.content.Intent import android.content.IntentFilter +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin import dagger.android.DaggerBroadcastReceiver import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject class RileyLinkBluetoothStateReceiver : DaggerBroadcastReceiver() { + @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var rileyLinkUtil: RileyLinkUtil diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.kt index 79344e2001..5d77354952 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkBroadcastReceiver.kt @@ -7,6 +7,10 @@ import android.content.IntentFilter import android.os.Handler import android.os.HandlerThread import androidx.localbroadcastmanager.content.LocalBroadcastManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.DaggerBroadcastReceiver import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst @@ -18,10 +22,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTask import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject class RileyLinkBroadcastReceiver : DaggerBroadcastReceiver() { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt index cb8bbf5b39..63fe0a9310 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt @@ -4,6 +4,12 @@ import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothManager import android.content.Context import android.content.Intent +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager @@ -14,13 +20,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLink import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState -import info.nightscout.interfaces.plugin.ActivePlugin import info.nightscout.pump.common.defs.PumpDeviceState -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 java.util.Locale import javax.inject.Inject diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.kt index f909b050ef..1f670e89d2 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.kt @@ -1,5 +1,8 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.bus.RxBus import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion @@ -8,9 +11,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistor import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag import java.util.Locale import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.kt index 95585537b4..abbadbe91c 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/DiscoverGattServicesTask.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks +import app.aaps.interfaces.logging.AAPSLogger import dagger.android.HasAndroidInjector -import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject class DiscoverGattServicesTask(injector: HasAndroidInjector, private val needToConnect: Boolean = false) : ServiceTask(injector) { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt index c076820e0b..108bf69487 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt @@ -1,6 +1,11 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks import android.content.Context +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.Round import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil @@ -8,11 +13,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.Rile import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.utils.Round.isSame -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import kotlin.math.roundToLong @@ -49,7 +49,7 @@ class InitializePumpManagerTask(injector: HasAndroidInjector, private val contex } } else rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.IPC.MSG_PUMP_tunePump, context) } else { - if (!isSame(lastGoodFrequency, RileyLinkTargetFrequency.Omnipod.scanFrequencies[0])) { + if (!Round.isSame(lastGoodFrequency, RileyLinkTargetFrequency.Omnipod.scanFrequencies[0])) { lastGoodFrequency = RileyLinkTargetFrequency.Omnipod.scanFrequencies[0] lastGoodFrequency = (lastGoodFrequency * 1000.0).roundToLong() / 1000.0 rileyLinkServiceData.lastGoodFrequency = lastGoodFrequency diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.kt index 78c288c3d3..c25d3ab86d 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshButtonState import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshButtonState import javax.inject.Inject class ResetRileyLinkConfigurationTask(injector: HasAndroidInjector) : PumpTask(injector) { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.kt index dd419053ec..2176540242 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTask.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks +import app.aaps.interfaces.plugin.ActivePlugin import dagger.android.HasAndroidInjector import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice -import info.nightscout.interfaces.plugin.ActivePlugin import javax.inject.Inject @Suppress("LeakingThis") -open class ServiceTask constructor(val injector: HasAndroidInjector) : Runnable { +open class ServiceTask(val injector: HasAndroidInjector) : Runnable { @Inject lateinit var activePlugin: ActivePlugin diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.kt index 03192e3667..e436a8709f 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ServiceTaskExecutor.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.ThreadPoolExecutor diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.kt index d69546de2c..7e7d54b9cd 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventRefreshButtonState import dagger.android.HasAndroidInjector -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventRefreshButtonState import javax.inject.Inject class WakeAndTuneTask(injector: HasAndroidInjector) : PumpTask(injector) { diff --git a/pump/virtual/src/main/java/info/nightscout/pump/virtual/VirtualPumpFragment.kt b/pump/virtual/src/main/java/info/nightscout/pump/virtual/VirtualPumpFragment.kt index bd0a99f0bf..060a945373 100644 --- a/pump/virtual/src/main/java/info/nightscout/pump/virtual/VirtualPumpFragment.kt +++ b/pump/virtual/src/main/java/info/nightscout/pump/virtual/VirtualPumpFragment.kt @@ -6,24 +6,24 @@ import android.os.HandlerThread import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.defs.DoseStepSize +import app.aaps.interfaces.pump.defs.PumpTempBasalType +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventExtendedBolusChange +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.core.extensions.toStringFull import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.defs.DoseStepSize -import info.nightscout.interfaces.pump.defs.PumpTempBasalType -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.utils.DecimalFormatter import info.nightscout.pump.virtual.databinding.VirtualPumpFragmentBinding import info.nightscout.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 diff --git a/pump/virtual/src/main/java/info/nightscout/pump/virtual/VirtualPumpPlugin.kt b/pump/virtual/src/main/java/info/nightscout/pump/virtual/VirtualPumpPlugin.kt index 4d3b17d50a..4406bd2a34 100644 --- a/pump/virtual/src/main/java/info/nightscout/pump/virtual/VirtualPumpPlugin.kt +++ b/pump/virtual/src/main/java/info/nightscout/pump/virtual/VirtualPumpPlugin.kt @@ -3,45 +3,45 @@ package info.nightscout.pump.virtual import android.os.SystemClock import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.notifications.Notification +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.plugin.PluginDescription +import app.aaps.interfaces.plugin.PluginType +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.BolusProgressData +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpPluginBase +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.VirtualPump +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.utils.TimeChangeType import dagger.android.HasAndroidInjector import info.nightscout.core.events.EventNewNotification import info.nightscout.core.extensions.convertedToAbsolute import info.nightscout.core.extensions.plannedRemainingMinutes import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.utils.fabric.InstanceId -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.plugin.PluginDescription -import info.nightscout.interfaces.plugin.PluginType -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.BolusProgressData -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpPluginBase -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.VirtualPump -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.pump.virtual.events.EventVirtualPumpUpdateGui import info.nightscout.pump.virtual.extensions.toText -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventPreferenceChange -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 diff --git a/pump/virtual/src/main/java/info/nightscout/pump/virtual/di/VirtualPumpModule.kt b/pump/virtual/src/main/java/info/nightscout/pump/virtual/di/VirtualPumpModule.kt index 156c1bd0f5..0cb31e4ebb 100644 --- a/pump/virtual/src/main/java/info/nightscout/pump/virtual/di/VirtualPumpModule.kt +++ b/pump/virtual/src/main/java/info/nightscout/pump/virtual/di/VirtualPumpModule.kt @@ -1,9 +1,9 @@ package info.nightscout.pump.virtual.di +import app.aaps.interfaces.pump.VirtualPump import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.interfaces.pump.VirtualPump import info.nightscout.pump.virtual.VirtualPumpFragment import info.nightscout.pump.virtual.VirtualPumpPlugin diff --git a/pump/virtual/src/main/java/info/nightscout/pump/virtual/events/EventVirtualPumpUpdateGui.kt b/pump/virtual/src/main/java/info/nightscout/pump/virtual/events/EventVirtualPumpUpdateGui.kt index 4bb49eb4fb..c4e42eeb69 100644 --- a/pump/virtual/src/main/java/info/nightscout/pump/virtual/events/EventVirtualPumpUpdateGui.kt +++ b/pump/virtual/src/main/java/info/nightscout/pump/virtual/events/EventVirtualPumpUpdateGui.kt @@ -1,5 +1,5 @@ package info.nightscout.pump.virtual.events -import info.nightscout.rx.events.EventUpdateGui +import app.aaps.interfaces.rx.events.EventUpdateGui class EventVirtualPumpUpdateGui : EventUpdateGui() \ No newline at end of file diff --git a/pump/virtual/src/main/java/info/nightscout/pump/virtual/extensions/PumpEnactResultExtension.kt b/pump/virtual/src/main/java/info/nightscout/pump/virtual/extensions/PumpEnactResultExtension.kt index 664fdea6b2..bad0328670 100644 --- a/pump/virtual/src/main/java/info/nightscout/pump/virtual/extensions/PumpEnactResultExtension.kt +++ b/pump/virtual/src/main/java/info/nightscout/pump/virtual/extensions/PumpEnactResultExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.pump.virtual.extensions -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.shared.interfaces.ResourceHelper +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.resources.ResourceHelper fun PumpEnactResult.toText(rh: ResourceHelper): String { var ret = rh.gs(info.nightscout.core.ui.R.string.success) + ": " + success diff --git a/pump/virtual/src/test/java/info/nightscout/pump/virtual/VirtualPumpPluginUTest.kt b/pump/virtual/src/test/java/info/nightscout/pump/virtual/VirtualPumpPluginUTest.kt index f9fee7caea..e3003994ee 100644 --- a/pump/virtual/src/test/java/info/nightscout/pump/virtual/VirtualPumpPluginUTest.kt +++ b/pump/virtual/src/test/java/info/nightscout/pump/virtual/VirtualPumpPluginUTest.kt @@ -1,19 +1,19 @@ package info.nightscout.pump.virtual +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.PersistenceLayer +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.nsclient.ProcessedDeviceStatusData +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector import info.nightscout.core.utils.fabric.FabricPrivacy -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.db.PersistenceLayer -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.nsclient.ProcessedDeviceStatusData -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/shared/impl/src/main/kotlin/app/aaps/shared/impl/di/SharedImplModule.kt b/shared/impl/src/main/kotlin/app/aaps/shared/impl/di/SharedImplModule.kt index 686e9d151a..879bbe84e8 100644 --- a/shared/impl/src/main/kotlin/app/aaps/shared/impl/di/SharedImplModule.kt +++ b/shared/impl/src/main/kotlin/app/aaps/shared/impl/di/SharedImplModule.kt @@ -2,6 +2,12 @@ package app.aaps.shared.impl.di import android.content.Context import androidx.preference.PreferenceManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.L +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import app.aaps.shared.impl.logging.AAPSLoggerProduction import app.aaps.shared.impl.logging.LImpl import app.aaps.shared.impl.rx.AapsSchedulersImpl @@ -10,12 +16,6 @@ import app.aaps.shared.impl.sharedPreferences.SPImplementation import app.aaps.shared.impl.utils.DateUtilImpl import dagger.Module import dagger.Provides -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.interfaces.L -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import javax.inject.Singleton @Module( diff --git a/shared/impl/src/main/kotlin/app/aaps/shared/impl/logging/AAPSLoggerProduction.kt b/shared/impl/src/main/kotlin/app/aaps/shared/impl/logging/AAPSLoggerProduction.kt index ea5783d347..961ae68137 100644 --- a/shared/impl/src/main/kotlin/app/aaps/shared/impl/logging/AAPSLoggerProduction.kt +++ b/shared/impl/src/main/kotlin/app/aaps/shared/impl/logging/AAPSLoggerProduction.kt @@ -1,8 +1,8 @@ package app.aaps.shared.impl.logging -import info.nightscout.rx.interfaces.L -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.L +import app.aaps.interfaces.logging.LTag import org.slf4j.LoggerFactory /** diff --git a/shared/impl/src/main/kotlin/app/aaps/shared/impl/logging/LImpl.kt b/shared/impl/src/main/kotlin/app/aaps/shared/impl/logging/LImpl.kt index 738cd739bd..711eb22ac3 100644 --- a/shared/impl/src/main/kotlin/app/aaps/shared/impl/logging/LImpl.kt +++ b/shared/impl/src/main/kotlin/app/aaps/shared/impl/logging/LImpl.kt @@ -1,9 +1,9 @@ package app.aaps.shared.impl.logging -import info.nightscout.rx.interfaces.L -import info.nightscout.rx.interfaces.LogElement -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.logging.L +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.LogElement +import app.aaps.interfaces.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/shared/impl/src/main/kotlin/app/aaps/shared/impl/rx/AapsSchedulersImpl.kt b/shared/impl/src/main/kotlin/app/aaps/shared/impl/rx/AapsSchedulersImpl.kt index fe7d18f878..8943dcbcf9 100644 --- a/shared/impl/src/main/kotlin/app/aaps/shared/impl/rx/AapsSchedulersImpl.kt +++ b/shared/impl/src/main/kotlin/app/aaps/shared/impl/rx/AapsSchedulersImpl.kt @@ -1,6 +1,6 @@ package app.aaps.shared.impl.rx -import info.nightscout.rx.AapsSchedulers +import app.aaps.interfaces.rx.AapsSchedulers import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.core.Scheduler import io.reactivex.rxjava3.schedulers.Schedulers diff --git a/shared/impl/src/main/kotlin/app/aaps/shared/impl/rx/bus/RxBusImpl.kt b/shared/impl/src/main/kotlin/app/aaps/shared/impl/rx/bus/RxBusImpl.kt index d3b10a7783..9f070aff13 100644 --- a/shared/impl/src/main/kotlin/app/aaps/shared/impl/rx/bus/RxBusImpl.kt +++ b/shared/impl/src/main/kotlin/app/aaps/shared/impl/rx/bus/RxBusImpl.kt @@ -1,11 +1,11 @@ package app.aaps.shared.impl.rx.bus import app.aaps.annotations.OpenForTesting -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.Event -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.Event import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.subjects.PublishSubject import javax.inject.Inject diff --git a/shared/impl/src/main/kotlin/app/aaps/shared/impl/sharedPreferences/SPImplementation.kt b/shared/impl/src/main/kotlin/app/aaps/shared/impl/sharedPreferences/SPImplementation.kt index b5a019869d..eece02b7b8 100644 --- a/shared/impl/src/main/kotlin/app/aaps/shared/impl/sharedPreferences/SPImplementation.kt +++ b/shared/impl/src/main/kotlin/app/aaps/shared/impl/sharedPreferences/SPImplementation.kt @@ -4,8 +4,8 @@ import android.annotation.SuppressLint import android.content.Context import android.content.SharedPreferences import androidx.annotation.StringRes -import info.nightscout.shared.SafeParse -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.SafeParse import javax.inject.Inject import javax.inject.Singleton diff --git a/shared/impl/src/main/kotlin/app/aaps/shared/impl/utils/DateUtilImpl.kt b/shared/impl/src/main/kotlin/app/aaps/shared/impl/utils/DateUtilImpl.kt index e686c87b70..cd8501ea6d 100644 --- a/shared/impl/src/main/kotlin/app/aaps/shared/impl/utils/DateUtilImpl.kt +++ b/shared/impl/src/main/kotlin/app/aaps/shared/impl/utils/DateUtilImpl.kt @@ -5,11 +5,11 @@ import android.os.Build import androidx.annotation.RequiresApi import androidx.collection.LongSparseArray import app.aaps.annotations.OpenForTesting -import info.nightscout.interfaces.R -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import app.aaps.interfaces.R +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.SafeParse +import app.aaps.interfaces.utils.T import org.apache.commons.lang3.time.DateUtils.isSameDay import org.joda.time.DateTime import org.joda.time.format.DateTimeFormat diff --git a/shared/impl/src/test/kotlin/app/aaps/shared/impl/logging/LImplTest.kt b/shared/impl/src/test/kotlin/app/aaps/shared/impl/logging/LImplTest.kt index b4c2fb2b91..7dd44326bd 100644 --- a/shared/impl/src/test/kotlin/app/aaps/shared/impl/logging/LImplTest.kt +++ b/shared/impl/src/test/kotlin/app/aaps/shared/impl/logging/LImplTest.kt @@ -1,8 +1,8 @@ package app.aaps.shared.impl.logging +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.sharedPreferences.SP import com.google.common.truth.Truth.assertThat -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/AAPSLoggerTest.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/AAPSLoggerTest.kt index 225deb83c3..2b801aa0b5 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/AAPSLoggerTest.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/AAPSLoggerTest.kt @@ -1,7 +1,7 @@ package app.aaps.shared.tests -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag /** * Created by adrian on 2019-12-27. diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/HardLimitsMock.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/HardLimitsMock.kt index 9485d8b0d8..57683a716a 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/HardLimitsMock.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/HardLimitsMock.kt @@ -1,8 +1,8 @@ package app.aaps.shared.tests -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.HardLimits import javax.inject.Inject import kotlin.math.max import kotlin.math.min diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBase.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBase.kt index ea49fef208..1bec473eab 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBase.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBase.kt @@ -1,10 +1,10 @@ package app.aaps.shared.tests import android.annotation.SuppressLint +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus import app.aaps.shared.impl.rx.bus.RxBusImpl import app.aaps.shared.tests.rx.TestAapsSchedulers -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.extension.ExtendWith import org.mockito.ArgumentMatcher diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt index 54aa48795b..e26fc3721c 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestBaseWithProfile.kt @@ -1,6 +1,18 @@ package app.aaps.shared.tests import android.content.Context +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.ProfileStore +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.HardLimits import app.aaps.shared.impl.utils.DateUtilImpl import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector @@ -12,18 +24,6 @@ import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.implementation.profile.ProfileStoreObject import info.nightscout.implementation.profile.ProfileUtilImpl import info.nightscout.implementation.utils.DecimalFormatterImpl -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profile.ProfileStore -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HardLimits -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import org.junit.jupiter.api.BeforeEach import org.mockito.ArgumentMatchers.anyDouble diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestPumpPlugin.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestPumpPlugin.kt index b6dad5253d..ac6f2ca80e 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestPumpPlugin.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/TestPumpPlugin.kt @@ -1,16 +1,16 @@ package app.aaps.shared.tests import app.aaps.annotations.OpenForTesting +import app.aaps.interfaces.profile.Profile +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.pump.Pump +import app.aaps.interfaces.pump.PumpEnactResult +import app.aaps.interfaces.pump.PumpSync +import app.aaps.interfaces.pump.defs.ManufacturerType +import app.aaps.interfaces.pump.defs.PumpDescription +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.utils.TimeChangeType import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.profile.Profile -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.Pump -import info.nightscout.interfaces.pump.PumpEnactResult -import info.nightscout.interfaces.pump.PumpSync -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject @Suppress("MemberVisibilityCanBePrivate") diff --git a/shared/tests/src/main/kotlin/app/aaps/shared/tests/rx/TestAapsSchedulers.kt b/shared/tests/src/main/kotlin/app/aaps/shared/tests/rx/TestAapsSchedulers.kt index d83606d449..5e3319fdfa 100644 --- a/shared/tests/src/main/kotlin/app/aaps/shared/tests/rx/TestAapsSchedulers.kt +++ b/shared/tests/src/main/kotlin/app/aaps/shared/tests/rx/TestAapsSchedulers.kt @@ -1,6 +1,6 @@ package app.aaps.shared.tests.rx -import info.nightscout.rx.AapsSchedulers +import app.aaps.interfaces.rx.AapsSchedulers import io.reactivex.rxjava3.core.Scheduler import io.reactivex.rxjava3.schedulers.Schedulers diff --git a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt index 52b02afd58..f65e961d00 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt @@ -1,10 +1,10 @@ package info.nightscout.ui.activities import android.os.Bundle +import app.aaps.interfaces.sharedPreferences.SP import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.shared.sharedPreferences.SP import info.nightscout.ui.alertDialogs.ErrorDialog import info.nightscout.ui.services.AlarmSoundService import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt index 98354f0a49..778415aa40 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ProfileHelperActivity.kt @@ -6,6 +6,18 @@ import android.text.Editable import android.text.TextWatcher import android.widget.ArrayAdapter import android.widget.TextView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventLocalProfileChanged +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import com.google.android.material.tabs.TabLayout import com.google.common.collect.Lists import info.nightscout.core.profile.ProfileSealed @@ -15,18 +27,6 @@ import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventLocalProfileChanged -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 info.nightscout.ui.R import info.nightscout.ui.databinding.ActivityProfilehelperBinding import info.nightscout.ui.defaultProfile.DefaultProfile @@ -107,10 +107,10 @@ class ProfileHelperActivity : TranslatedDaggerAppCompatActivity() { binding.profileType.setOnItemClickListener { _, _, _, _ -> when (binding.profileType.text.toString()) { - rh.gs(R.string.motol_default_profile) -> switchTab(tabSelected, ProfileType.MOTOL_DEFAULT) - rh.gs(R.string.dpv_default_profile) -> switchTab(tabSelected, ProfileType.DPV_DEFAULT) - rh.gs(R.string.current_profile) -> switchTab(tabSelected, ProfileType.CURRENT) - rh.gs(R.string.available_profile) -> switchTab(tabSelected, ProfileType.AVAILABLE_PROFILE) + rh.gs(R.string.motol_default_profile) -> switchTab(tabSelected, ProfileType.MOTOL_DEFAULT) + rh.gs(R.string.dpv_default_profile) -> switchTab(tabSelected, ProfileType.DPV_DEFAULT) + rh.gs(R.string.current_profile) -> switchTab(tabSelected, ProfileType.CURRENT) + rh.gs(R.string.available_profile) -> switchTab(tabSelected, ProfileType.AVAILABLE_PROFILE) rh.gs(info.nightscout.core.ui.R.string.careportal_profileswitch) -> switchTab(tabSelected, ProfileType.PROFILE_SWITCH) } } diff --git a/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt index 8635605c11..d35ef77d6b 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/QuickWizardListActivity.kt @@ -16,21 +16,21 @@ import androidx.fragment.app.FragmentManager import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog +import info.nightscout.core.ui.dragHelpers.ItemTouchHelperAdapter +import info.nightscout.core.ui.dragHelpers.OnStartDragListener +import info.nightscout.core.ui.dragHelpers.SimpleItemTouchHelperCallback import info.nightscout.core.utils.ActionModeHelper import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.core.wizard.QuickWizard import info.nightscout.core.wizard.QuickWizardEntry -import info.nightscout.core.ui.dragHelpers.ItemTouchHelperAdapter -import info.nightscout.core.ui.dragHelpers.OnStartDragListener -import info.nightscout.core.ui.dragHelpers.SimpleItemTouchHelperCallback -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -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.R import info.nightscout.ui.databinding.ActivityQuickwizardListBinding import info.nightscout.ui.databinding.QuickwizardListItemBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt index 5c710e4a27..c6f90dfb6b 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt @@ -5,18 +5,18 @@ import android.os.Bundle import android.os.Handler import android.os.HandlerThread import android.widget.TextView +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.stats.DexcomTirCalculator +import app.aaps.interfaces.stats.TddCalculator +import app.aaps.interfaces.stats.TirCalculator import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.stats.DexcomTirCalculator -import info.nightscout.interfaces.stats.TddCalculator -import info.nightscout.interfaces.stats.TirCalculator -import info.nightscout.rx.AapsSchedulers -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.ui.R import info.nightscout.ui.activityMonitor.ActivityMonitor import info.nightscout.ui.databinding.ActivityStatsBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt index ecde272124..bbf5ea0ab4 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt @@ -2,14 +2,14 @@ package info.nightscout.ui.activities import android.os.Bundle import android.widget.ArrayAdapter +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.SafeParse import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.ui.toast.ToastUtils import info.nightscout.core.utils.fabric.InstanceId -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.shared.SafeParse -import info.nightscout.shared.utils.DateUtil import info.nightscout.ui.R import info.nightscout.ui.databinding.ActivitySurveyBinding import info.nightscout.ui.defaultProfile.DefaultProfile @@ -86,25 +86,25 @@ class SurveyActivity : TranslatedDaggerAppCompatActivity() { val specificProfile = profileStore.getSpecificProfile(profileName) r.profileJson = specificProfile.toString() -/* - val auth = FirebaseAuth.getInstance() - auth.signInAnonymously() - .addOnCompleteListener(this) { task -> - if (task.isSuccessful) { - aapsLogger.debug(LTag.CORE, "signInAnonymously:success") - //val user = auth.currentUser // do we need this, seems unused? + /* + val auth = FirebaseAuth.getInstance() + auth.signInAnonymously() + .addOnCompleteListener(this) { task -> + if (task.isSuccessful) { + aapsLogger.debug(LTag.CORE, "signInAnonymously:success") + //val user = auth.currentUser // do we need this, seems unused? - val database = FirebaseDatabase.getInstance().reference - database.child("survey").child(r.id).setValue(r) - } else { - aapsLogger.error("signInAnonymously:failure", task.exception!!) - ToastUtils.warnToast(this, "Authentication failed.") - //updateUI(null) - } + val database = FirebaseDatabase.getInstance().reference + database.child("survey").child(r.id).setValue(r) + } else { + aapsLogger.error("signInAnonymously:failure", task.exception!!) + ToastUtils.warnToast(this, "Authentication failed.") + //updateUI(null) + } - // ... - } - */ + // ... + } + */ finish() } } diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index 5de99168bb..f4a94fc965 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -14,24 +14,24 @@ import android.widget.EditText import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.pump.defs.PumpType +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDanaRSyncStatus +import app.aaps.interfaces.rx.events.EventPumpStatusChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.SafeParse +import app.aaps.interfaces.utils.T import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.core.utils.fabric.FabricPrivacy import info.nightscout.database.entities.TotalDailyDose import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDanaRSyncStatus -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.SafeParse -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.utils.T import info.nightscout.ui.databinding.ActivityTddStatsBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import java.text.DateFormat diff --git a/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt index 093079f5e3..f2265aaaa4 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt @@ -3,12 +3,12 @@ package info.nightscout.ui.activities import android.os.Bundle import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentTransaction +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper import com.google.android.material.tabs.TabLayout import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsBolusCarbsFragment import info.nightscout.ui.activities.fragments.TreatmentsCareportalFragment diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index b620c67005..2be8a0be92 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -15,6 +15,20 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventTreatmentChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import com.google.gson.Gson import dagger.android.support.DaggerFragment import info.nightscout.core.extensions.iobCalc @@ -33,20 +47,6 @@ import info.nightscout.database.impl.transactions.CutCarbsTransaction import info.nightscout.database.impl.transactions.InvalidateBolusCalculatorResultTransaction import info.nightscout.database.impl.transactions.InvalidateBolusTransaction import info.nightscout.database.impl.transactions.InvalidateCarbsTransaction -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventTreatmentChange -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.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.databinding.TreatmentsBolusCarbsFragmentBinding import info.nightscout.ui.databinding.TreatmentsBolusCarbsItemBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt index 2921601331..38e7a5599b 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -13,6 +13,19 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventTherapyEventChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.utils.Translator import dagger.android.support.DaggerFragment import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils @@ -25,19 +38,6 @@ import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateAAPSStartedTherapyEventTransaction import info.nightscout.database.impl.transactions.InvalidateTherapyEventTransaction -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Translator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventTherapyEventChange -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.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsCareportalFragment.RecyclerViewAdapter.TherapyEventsViewHolder import info.nightscout.ui.databinding.TreatmentsCareportalFragmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt index 6b4a9b7698..029dfc3b90 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -14,6 +14,18 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventExtendedBolusChange +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.core.extensions.iobCalc import info.nightscout.core.extensions.isInProgress @@ -28,18 +40,6 @@ import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventExtendedBolusChange -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 info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsExtendedBolusesFragment.RecyclerViewAdapter.ExtendedBolusesViewHolder import info.nightscout.ui.databinding.TreatmentsExtendedbolusFragmentBinding @@ -158,7 +158,12 @@ class TreatmentsExtendedBolusesFragment : DaggerFragment(), MenuProvider { val iob = extendedBolus.iobCalc(System.currentTimeMillis(), profile, activePlugin.activeInsulin) holder.binding.iob.text = rh.gs(info.nightscout.core.ui.R.string.format_insulin_units, iob.iob) holder.binding.ratio.text = rh.gs(info.nightscout.core.ui.R.string.pump_base_basal_rate, extendedBolus.rate) - if (iob.iob != 0.0) holder.binding.iob.setTextColor(rh.gac(context, info.nightscout.core.ui.R.attr.activeColor)) else holder.binding.iob.setTextColor(holder.binding.insulin.currentTextColor) + if (iob.iob != 0.0) holder.binding.iob.setTextColor( + rh.gac( + context, + info.nightscout.core.ui.R.attr.activeColor + ) + ) else holder.binding.iob.setTextColor(holder.binding.insulin.currentTextColor) holder.binding.cbRemove.visibility = (extendedBolus.isValid && actionHelper.isRemoving).toVisibility() if (actionHelper.isRemoving) { holder.binding.cbRemove.setOnCheckedChangeListener { _, value -> diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index d75799a797..5cc9b14b2c 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -15,6 +15,23 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventEffectiveProfileSwitchChanged +import app.aaps.interfaces.rx.events.EventLocalProfileChanged +import app.aaps.interfaces.rx.events.EventProfileSwitchChanged +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.core.extensions.getCustomizedName import info.nightscout.core.profile.ProfileSealed @@ -27,23 +44,6 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateProfileSwitchTransaction -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventEffectiveProfileSwitchChanged -import info.nightscout.rx.events.EventLocalProfileChanged -import info.nightscout.rx.events.EventProfileSwitchChanged -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.sharedPreferences.SP -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsProfileSwitchFragment.RecyclerProfileViewAdapter.ProfileSwitchViewHolder import info.nightscout.ui.databinding.TreatmentsProfileswitchFragmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt index 7f8129bab7..c0d9a05da1 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -14,6 +14,21 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.configuration.Config +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventTempTargetChange +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T +import app.aaps.interfaces.utils.Translator import dagger.android.support.DaggerFragment import info.nightscout.core.extensions.friendlyDescription import info.nightscout.core.extensions.highValueToUnitsToString @@ -30,21 +45,6 @@ import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateTemporaryTargetTransaction -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Translator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventTempTargetChange -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ProfileUtil -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.R import info.nightscout.ui.activities.fragments.TreatmentsTempTargetFragment.RecyclerViewAdapter.TempTargetsViewHolder import info.nightscout.ui.databinding.TreatmentsTemptargetFragmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 561b854ad2..adda3c9b08 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -14,6 +14,20 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.iob.IobTotal +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.plugin.ActivePlugin +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventTempBasalChange +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.core.extensions.iobCalc import info.nightscout.core.extensions.toStringFull @@ -32,20 +46,6 @@ import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalTransaction -import info.nightscout.interfaces.iob.IobTotal -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.plugin.ActivePlugin -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventTempBasalChange -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 info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsTemporaryBasalsFragment.RecyclerViewAdapter.TempBasalsViewHolder import info.nightscout.ui.databinding.TreatmentsTempbasalsFragmentBinding @@ -201,7 +201,12 @@ class TreatmentsTemporaryBasalsFragment : DaggerFragment(), MenuProvider { holder.binding.suspendFlag.visibility = (tempBasal.type == TemporaryBasal.Type.PUMP_SUSPEND).toVisibility() holder.binding.emulatedSuspendFlag.visibility = (tempBasal.type == TemporaryBasal.Type.EMULATED_PUMP_SUSPEND).toVisibility() holder.binding.superBolusFlag.visibility = (tempBasal.type == TemporaryBasal.Type.SUPERBOLUS).toVisibility() - if (abs(iob.basaliob) > 0.01) holder.binding.iob.setTextColor(rh.gac(context, info.nightscout.core.ui.R.attr.activeColor)) else holder.binding.iob.setTextColor(holder.binding.duration.currentTextColor) + if (abs(iob.basaliob) > 0.01) holder.binding.iob.setTextColor( + rh.gac( + context, + info.nightscout.core.ui.R.attr.activeColor + ) + ) else holder.binding.iob.setTextColor(holder.binding.duration.currentTextColor) holder.binding.cbRemove.visibility = (tempBasal.isValid && actionHelper.isRemoving).toVisibility() if (actionHelper.isRemoving) { holder.binding.cbRemove.setOnCheckedChangeListener { _, value -> diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index 03c0265a4b..4d01ca2c30 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -11,6 +11,17 @@ import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import app.aaps.interfaces.extensions.toVisibility +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.maintenance.ImportExportPrefs +import app.aaps.interfaces.profile.ProfileFunction +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventPreferenceChange +import app.aaps.interfaces.userEntry.UserEntryPresentationHelper +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerFragment import info.nightscout.core.ui.dialogs.OKDialog import info.nightscout.core.ui.toast.ToastUtils @@ -19,17 +30,6 @@ import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.maintenance.ImportExportPrefs -import info.nightscout.interfaces.profile.ProfileFunction -import info.nightscout.interfaces.userEntry.UserEntryPresentationHelper -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventPreferenceChange -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 info.nightscout.ui.R import info.nightscout.ui.databinding.TreatmentsUserEntryFragmentBinding import info.nightscout.ui.databinding.TreatmentsUserEntryItemBinding diff --git a/ui/src/main/java/info/nightscout/ui/activityMonitor/ActivityMonitor.kt b/ui/src/main/java/info/nightscout/ui/activityMonitor/ActivityMonitor.kt index 410806021b..7b72cf0b3d 100644 --- a/ui/src/main/java/info/nightscout/ui/activityMonitor/ActivityMonitor.kt +++ b/ui/src/main/java/info/nightscout/ui/activityMonitor/ActivityMonitor.kt @@ -10,13 +10,13 @@ import android.view.ViewGroup import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.SafeParse -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 app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sharedPreferences.SP +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.SafeParse +import app.aaps.interfaces.utils.T import info.nightscout.ui.R import javax.inject.Inject import javax.inject.Singleton @@ -102,7 +102,7 @@ class ActivityMonitor @Inject constructor( row.gravity = Gravity.CENTER_HORIZONTAL row.addView(TextView(context).apply { layoutParams = lp.apply { column = 0 }; text = activity }) row.addView(TextView(context).apply { layoutParams = lp.apply { column = 1 }; text = duration }) - row.addView(TextView(context).apply { layoutParams = lp.apply { column = 2 }; text = rh.gs(info.nightscout.interfaces.R.string.in_days, days.toDouble()) }) + row.addView(TextView(context).apply { layoutParams = lp.apply { column = 2 }; text = rh.gs(app.aaps.interfaces.R.string.in_days, days.toDouble()) }) } ) } diff --git a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt index a96e9a0335..6df97ebd76 100644 --- a/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/alertDialogs/ErrorDialog.kt @@ -9,14 +9,14 @@ import android.view.View import android.view.ViewGroup import android.view.Window import android.view.WindowManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.T import dagger.android.support.DaggerDialogFragment import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.shared.utils.T import info.nightscout.ui.databinding.DialogErrorBinding import javax.inject.Inject diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt index b49f8fde41..48458dfbf6 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt @@ -1,11 +1,11 @@ package info.nightscout.ui.defaultProfile +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.utils.DateUtil +import app.aaps.interfaces.utils.Round import info.nightscout.core.extensions.pureProfileFromJson -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.interfaces.utils.Round -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONObject import java.util.Locale diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt index 51b364a92b..bf4d5d708b 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt @@ -1,11 +1,11 @@ package info.nightscout.ui.defaultProfile +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.profile.PureProfile +import app.aaps.interfaces.utils.DateUtil import dagger.android.HasAndroidInjector import info.nightscout.core.extensions.pureProfileFromJson -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONObject import java.util.Locale diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt index 7f6e37944b..55fb625bee 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/BolusProgressDialog.kt @@ -7,21 +7,21 @@ import android.view.View import android.view.ViewGroup import android.view.Window import android.view.WindowManager +import app.aaps.interfaces.logging.AAPSLogger +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.pump.BolusProgressData +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.rx.AapsSchedulers +import app.aaps.interfaces.rx.bus.RxBus +import app.aaps.interfaces.rx.events.EventDismissBolusProgressIfRunning +import app.aaps.interfaces.rx.events.EventOverviewBolusProgress +import app.aaps.interfaces.rx.events.EventPumpStatusChanged import dagger.android.support.DaggerDialogFragment import info.nightscout.core.ui.activities.TranslatedDaggerAppCompatActivity import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.pump.BolusProgressData -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.rx.AapsSchedulers -import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventDismissBolusProgressIfRunning -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.rx.events.EventPumpStatusChanged -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.ui.databinding.DialogBolusprogressBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt index 56ce69b92a..71a3b3d306 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt @@ -4,6 +4,12 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.sync.XDripBroadcast import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.core.ui.dialogs.OKDialog @@ -11,12 +17,6 @@ import info.nightscout.core.utils.HtmlHelper import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.XDripBroadcast -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.ui.databinding.DialogCalibrationBinding import java.text.DecimalFormat import java.util.LinkedList diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index 40aa9ce9a8..3b44f489f0 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -7,6 +7,27 @@ import android.text.TextWatcher import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import app.aaps.interfaces.automation.Automation +import app.aaps.interfaces.configuration.Constants.CARBS_FAV1_DEFAULT +import app.aaps.interfaces.configuration.Constants.CARBS_FAV2_DEFAULT +import app.aaps.interfaces.configuration.Constants.CARBS_FAV3_DEFAULT +import app.aaps.interfaces.constraints.ConstraintsChecker +import app.aaps.interfaces.db.GlucoseUnit +import app.aaps.interfaces.iob.GlucoseStatusProvider +import app.aaps.interfaces.iob.IobCobCalculator +import app.aaps.interfaces.logging.LTag +import app.aaps.interfaces.logging.UserEntryLogger +import app.aaps.interfaces.profile.DefaultValueHelper +import app.aaps.interfaces.profile.ProfileUtil +import app.aaps.interfaces.protection.ProtectionCheck +import app.aaps.interfaces.protection.ProtectionCheck.Protection.BOLUS +import app.aaps.interfaces.pump.DetailedBolusInfo +import app.aaps.interfaces.queue.Callback +import app.aaps.interfaces.queue.CommandQueue +import app.aaps.interfaces.resources.ResourceHelper +import app.aaps.interfaces.ui.UiInteraction +import app.aaps.interfaces.utils.DecimalFormatter +import app.aaps.interfaces.utils.T import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.core.constraints.ConstraintObject @@ -20,27 +41,6 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.interfaces.Constants.CARBS_FAV1_DEFAULT -import info.nightscout.interfaces.Constants.CARBS_FAV2_DEFAULT -import info.nightscout.interfaces.Constants.CARBS_FAV3_DEFAULT -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.automation.Automation -import info.nightscout.interfaces.constraints.ConstraintsChecker -import info.nightscout.interfaces.iob.GlucoseStatusProvider -import info.nightscout.interfaces.iob.IobCobCalculator -import info.nightscout.interfaces.logging.UserEntryLogger -import info.nightscout.interfaces.profile.DefaultValueHelper -import info.nightscout.interfaces.protection.ProtectionCheck -import info.nightscout.interfaces.protection.ProtectionCheck.Protection.BOLUS -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.queue.CommandQueue -import info.nightscout.interfaces.ui.UiInteraction -import info.nightscout.interfaces.utils.DecimalFormatter -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.interfaces.ProfileUtil -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogCarbsBinding import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -278,7 +278,7 @@ class CarbsDialog : DialogFragmentWithDate() { actions.add(rh.gs(info.nightscout.core.ui.R.string.alarminxmin, timeOffset).formatColor(context, rh, info.nightscout.core.ui.R.attr.infoColor)) val duration = binding.duration.value.toInt() if (duration > 0) - actions.add(rh.gs(info.nightscout.core.ui.R.string.duration) + ": " + duration + rh.gs(info.nightscout.interfaces.R.string.shorthour)) + actions.add(rh.gs(info.nightscout.core.ui.R.string.duration) + ": " + duration + rh.gs(app.aaps.interfaces.R.string.shorthour)) if (carbsAfterConstraints > 0) { actions.add( rh.gs(info.nightscout.core.ui.R.string.carbs) + ": " + "