From 34320ad8ca10d791852176343d42ee87dd21116a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Nov 2022 17:34:47 +0100 Subject: [PATCH] sync -> plugins module --- app/src/main/AndroidManifest.xml | 6 +- .../nightscout/androidaps/MainActivity.kt | 12 +- .../info/nightscout/androidaps/MainApp.kt | 20 +- .../activities/MyPreferenceFragment.kt | 14 +- .../nightscout/androidaps/di/AppModule.kt | 34 +- .../androidaps/di/FragmentsModule.kt | 12 - .../androidaps/di/OverviewModule.kt | 2 +- .../androidaps/di/PluginsListModule.kt | 10 +- .../androidaps/di/ServicesModule.kt | 4 +- .../nightscout/androidaps/di/WorkersModule.kt | 24 -- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 10 +- .../configBuilder/ConfigBuilderPlugin.kt | 4 +- .../configBuilder/ProfileFunctionImpl.kt | 8 +- .../objectives/ObjectivesPlugin.kt | 6 +- .../objectives/objectives/Objective0.kt | 8 +- .../dataBroadcaster/DataBroadcastPlugin.kt | 8 +- .../general/maintenance/MaintenancePlugin.kt | 6 +- .../general/overview/OverviewFragment.kt | 18 +- .../general/overview/OverviewPlugin.kt | 14 +- .../plugins/general/wear/WearFragment.kt | 4 +- .../wear/wearintegration/DataHandlerMobile.kt | 8 +- .../androidaps/plugins/source/AidexPlugin.kt | 13 +- .../androidaps/plugins/source/DexcomPlugin.kt | 15 +- .../plugins/source/EversensePlugin.kt | 9 +- .../androidaps/plugins/source/GlimpPlugin.kt | 7 +- .../plugins/source/GlunovoPlugin.kt | 13 +- .../plugins/source/IntelligoPlugin.kt | 15 +- .../androidaps/plugins/source/MM640gPlugin.kt | 11 +- .../plugins/source/PoctechPlugin.kt | 7 +- .../plugins/source/RandomBgPlugin.kt | 7 +- .../androidaps/plugins/source/TomatoPlugin.kt | 5 +- .../androidaps/plugins/source/XdripPlugin.kt | 7 +- .../androidaps/receivers/KeepAliveWorker.kt | 8 +- .../androidaps/setupwizard/SWDefinition.kt | 4 +- .../setupwizard/SetupWizardActivity.kt | 2 +- .../utils/extensions/TherapyEventExtension.kt | 12 - .../workflow/PreparePredictionsWorker.kt | 6 +- .../main/res/layout/dialog_extendedbolus.xml | 2 +- .../res/layout/smscommunicator_fragment.xml | 13 - app/src/main/res/values/arrays.xml | 32 -- app/src/main/res/values/objectives.xml | 2 - app/src/main/res/values/strings.xml | 223 +---------- app/src/main/res/xml/pref_alerts.xml | 2 +- .../interfaces/ConstraintsCheckerTest.kt | 3 +- .../plugins/aps/loop/LoopPluginTest.kt | 14 +- .../constraints/safety/SafetyPluginTest.kt | 6 +- .../maintenance/MaintenancePluginTest.kt | 4 +- .../plugins/source/NSClientPluginTest.kt | 1 + .../utils/wizard/BolusWizardTest.kt | 6 +- .../androidaps/events/EventNewBG.kt | 0 .../plugins/general/overview/OverviewData.kt | 10 +- core/src/main/res/values/strings.xml | 18 +- .../pump/PumpSyncImplementation.kt | 16 +- .../pump/insight/LocalInsightFragment.java | 10 +- insight/src/main/res/values/strings.xml | 1 - .../info/nightscout/interfaces/VirtualPump.kt | 5 + openhumans/src/main/res/values/strings.xml | 1 - plugins/build.gradle | 1 + plugins/src/main/AndroidManifest.xml | 6 + .../configBuilder/RunningConfiguration.kt | 6 +- .../nightscout/plugins/di/AutotuneModule.kt | 3 + .../nightscout/plugins/di/PluginsModule.kt | 5 +- .../nightscout/plugins/di/SourceModule.kt | 15 + .../info/nightscout/plugins/di/SyncModule.kt | 41 ++ .../plugins/di/VirtualPumpModule.kt | 12 + .../plugins/general/food/FoodFragment.kt | 6 +- .../DismissNotificationService.kt | 2 +- .../notifications/NotificationStore.kt | 14 +- .../notifications/NotificationWithAction.kt | 16 +- .../events/EventUpdateOverviewNotification.kt | 2 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 198 +++++----- .../pump/virtual/VirtualPumpFragment.kt | 22 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 41 +- .../events/EventVirtualPumpUpdateGui.kt | 2 +- .../plugins/source/BGSourceFragment.kt | 32 +- .../plugins/source/NSClientSourcePlugin.kt | 18 +- .../plugins/sync/nsShared/NSClientFragment.kt | 31 +- .../plugins/sync/nsShared/StoreDataForDb.kt | 12 +- .../nsShared/events/EventNSClientNewLog.kt | 2 +- .../nsShared/events/EventNSClientResend.kt | 2 +- .../nsShared/events/EventNSClientStatus.kt | 2 +- .../nsShared/events/EventNSClientUpdateGUI.kt | 2 +- .../DataSyncSelectorImplementation.kt | 8 +- .../plugins/sync/nsclient/NSClientPlugin.kt | 32 +- .../sync/nsclient/NsClientReceiverDelegate.kt | 8 +- .../plugins/sync/nsclient/acks/NSAddAck.kt | 2 +- .../plugins/sync/nsclient/acks/NSAuthAck.kt | 2 +- .../plugins/sync/nsclient/acks/NSUpdateAck.kt | 2 +- .../plugins/sync/nsclient/data/AlarmAck.java | 2 +- .../plugins/sync/nsclient/data/NSAlarm.kt | 2 +- .../nsclient/data/NSDeviceStatusHandler.kt | 10 +- .../plugins/sync/nsclient/data/NSMbg.kt | 2 +- .../sync/nsclient/data/NSSettingsStatus.kt | 16 +- .../plugins/sync/nsclient/data/NSSgv.kt | 2 +- .../data/ProcessedDeviceStatusData.kt | 16 +- .../extensions/DeviceStatusExtension.kt | 2 +- .../extensions/TherapyEventExtension.kt | 16 +- .../sync/nsclient/services/NSClientService.kt | 64 ++-- .../nsclient/workers}/NSClientAddAckWorker.kt | 8 +- .../workers}/NSClientAddUpdateWorker.kt | 14 +- .../nsclient/workers}/NSClientMbgWorker.kt | 10 +- .../workers}/NSClientUpdateRemoveAckWorker.kt | 6 +- .../sync/nsclientV3/NSClientV3Plugin.kt | 50 +-- .../BolusCalculatorResultExtension.kt | 2 +- .../nsclientV3/extensions/BolusExtension.kt | 2 +- .../nsclientV3/extensions/CarbsExtension.kt | 2 +- .../EffectiveProfileSwitchExtension.kt | 4 +- .../extensions/ExtendedBolusExtension.kt | 2 +- .../extensions/OfflineEventExtension.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 6 +- .../extensions/TemporaryBasalExtension.kt | 2 +- .../extensions/TemporaryTargetExtension.kt | 2 +- .../extensions/TherapyEventExtension.kt | 2 +- .../sync/nsclientV3/workers/LoadBgWorker.kt | 16 +- .../workers/LoadDeviceStatusWorker.kt | 12 +- .../workers/LoadLastModificationWorker.kt | 4 +- .../nsclientV3/workers/LoadStatusWorker.kt | 4 +- .../workers/LoadTreatmentsWorker.kt | 10 +- .../workers/ProcessTreatmentsWorker.kt | 30 +- .../plugins/sync/tidepool/TidepoolFragment.kt | 14 +- .../plugins/sync/tidepool/TidepoolPlugin.kt | 24 +- .../sync/tidepool/comm/InfoInterceptor.kt | 2 +- .../plugins/sync/tidepool/comm/Session.kt | 6 +- .../sync/tidepool/comm/TidepoolApiService.kt | 23 +- .../sync/tidepool/comm/TidepoolCallback.kt | 4 +- .../sync/tidepool/comm/TidepoolUploader.kt | 25 +- .../plugins/sync/tidepool/comm/UploadChunk.kt | 26 +- .../sync/tidepool/elements/BasalElement.kt | 6 +- .../sync/tidepool/elements/BaseElement.kt | 2 +- .../tidepool/elements/BloodGlucoseElement.kt | 7 +- .../sync/tidepool/elements/BolusElement.kt | 4 +- .../sync/tidepool/elements/ProfileElement.kt | 6 +- .../tidepool/elements/SensorGlucoseElement.kt | 5 +- .../sync/tidepool/elements/WizardElement.kt | 4 +- .../tidepool/events/EventTidepoolDoUpload.kt | 2 +- .../tidepool/events/EventTidepoolResetData.kt | 2 +- .../tidepool/events/EventTidepoolStatus.kt | 2 +- .../tidepool/events/EventTidepoolUpdateGUI.kt | 2 +- .../tidepool/messages/AuthReplyMessage.kt | 2 +- .../tidepool/messages/AuthRequestMessage.kt | 4 +- .../sync/tidepool/messages/BaseMessage.kt | 4 +- .../messages/CloseDatasetRequestMessage.kt | 2 +- .../tidepool/messages/DatasetReplyMessage.kt | 2 +- .../messages/OpenDatasetRequestMessage.kt | 11 +- .../tidepool/messages/UploadReplyMessage.kt | 2 +- .../sync/tidepool/utils/GsonInstance.kt | 2 +- .../plugins/sync/tidepool/utils/RateLimit.kt | 6 +- .../main/res/layout/ns_client_fragment.xml | 6 +- .../res/layout/overview_notification_item.xml | 0 .../src/main/res/layout/source_fragment.xml | 2 +- .../src/main/res/layout/source_item.xml | 0 .../src/main/res/layout/tidepool_fragment.xml | 0 .../main/res/layout/virtual_pump_fragment.xml | 14 +- .../src/main/res/raw/urgentalarm.mp3 | Bin plugins/src/main/res/values/arrays.xml | 32 ++ plugins/src/main/res/values/strings.xml | 356 +++++++++++++++--- .../src/main/res/xml/pref_bgsource.xml | 0 .../src/main/res/xml/pref_ns_client.xml | 46 +-- .../src/main/res/xml/pref_smscommunicator.xml | 10 +- .../src/main/res/xml/pref_tidepool.xml | 0 .../src/main/res/xml/pref_virtual_pump.xml | 4 +- .../SmsCommunicatorPluginTest.kt | 86 ++--- .../pump/virtual/VirtualPumpPluginUTest.kt | 10 +- .../nsclient/NsClientReceiverDelegateTest.kt | 6 +- .../plugins/sync/tidepool/comm/SessionTest.kt | 6 +- .../main/res/layout/combopump_fragment.xml | 2 +- .../src/main/res/layout/danar_fragment.xml | 4 +- .../main/res/layout/diaconn_g8_fragment.xml | 4 +- .../main/res/layout/medtronic_fragment.xml | 2 +- ui/src/main/res/values/strings.xml | 2 - 170 files changed, 1238 insertions(+), 1166 deletions(-) delete mode 100644 app/src/main/java/info/nightscout/androidaps/utils/extensions/TherapyEventExtension.kt delete mode 100644 app/src/main/res/layout/smscommunicator_fragment.xml rename {app => core}/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt (100%) rename {app/src/main/java/info/nightscout/androidaps/plugins => implementation/src/main/java/info/nightscout/implementation}/pump/PumpSyncImplementation.kt (98%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/VirtualPump.kt rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/configBuilder/RunningConfiguration.kt (97%) create mode 100644 plugins/src/main/java/info/nightscout/plugins/di/SourceModule.kt create mode 100644 plugins/src/main/java/info/nightscout/plugins/di/SyncModule.kt create mode 100644 plugins/src/main/java/info/nightscout/plugins/di/VirtualPumpModule.kt rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/general/overview/notifications/DismissNotificationService.kt (88%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/general/overview/notifications/NotificationStore.kt (96%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/general/overview/notifications/NotificationWithAction.kt (84%) rename {app/src/main/java/info/nightscout/androidaps/plugins/general/overview => plugins/src/main/java/info/nightscout/plugins/general/overview/notifications}/events/EventUpdateOverviewNotification.kt (60%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/pump/virtual/VirtualPumpFragment.kt (88%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/pump/virtual/VirtualPumpPlugin.kt (96%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/pump/virtual/events/EventVirtualPumpUpdateGui.kt (61%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/source/BGSourceFragment.kt (93%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/source/NSClientSourcePlugin.kt (95%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsShared/NSClientFragment.kt (86%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsShared/StoreDataForDb.kt (99%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsShared/events/EventNSClientNewLog.kt (92%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsShared/events/EventNSClientResend.kt (60%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsShared/events/EventNSClientStatus.kt (83%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt (60%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/DataSyncSelectorImplementation.kt (99%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/NSClientPlugin.kt (90%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/NsClientReceiverDelegate.kt (96%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/acks/NSAddAck.kt (96%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/acks/NSAuthAck.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/acks/NSUpdateAck.kt (94%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/data/AlarmAck.java (73%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/data/NSAlarm.kt (95%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt (96%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/data/NSMbg.kt (87%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/data/NSSettingsStatus.kt (97%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/data/NSSgv.kt (94%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt (96%) rename {app/src/main/java/info/nightscout/androidaps/utils => plugins/src/main/java/info/nightscout/plugins/sync/nsclient}/extensions/DeviceStatusExtension.kt (99%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclient/services/NSClientService.kt (93%) rename {app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient => plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers}/NSClientAddAckWorker.kt (98%) rename {app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient => plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers}/NSClientAddUpdateWorker.kt (96%) rename {app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient => plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers}/NSClientMbgWorker.kt (83%) rename {app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient => plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers}/NSClientUpdateRemoveAckWorker.kt (97%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/NSClientV3Plugin.kt (88%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/BolusExtension.kt (92%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/CarbsExtension.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt (95%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt (90%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt (94%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt (96%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt (94%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt (95%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt (98%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/workers/LoadBgWorker.kt (90%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt (87%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt (88%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt (93%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt (85%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/TidepoolFragment.kt (84%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/TidepoolPlugin.kt (90%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/comm/InfoInterceptor.kt (92%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/comm/Session.kt (82%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/comm/TidepoolApiService.kt (75%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/comm/TidepoolCallback.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/comm/TidepoolUploader.kt (94%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/comm/UploadChunk.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/elements/BasalElement.kt (92%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/elements/BaseElement.kt (91%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/elements/BloodGlucoseElement.kt (93%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/elements/BolusElement.kt (86%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/elements/ProfileElement.kt (95%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/elements/SensorGlucoseElement.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/elements/WizardElement.kt (95%) rename {app/src/main/java/info/nightscout/androidaps/plugins/general => plugins/src/main/java/info/nightscout/plugins/sync}/tidepool/events/EventTidepoolDoUpload.kt (53%) rename {app/src/main/java/info/nightscout/androidaps/plugins/general => plugins/src/main/java/info/nightscout/plugins/sync}/tidepool/events/EventTidepoolResetData.kt (54%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/events/EventTidepoolStatus.kt (90%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt (55%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/messages/AuthReplyMessage.kt (89%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/messages/AuthRequestMessage.kt (82%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/messages/BaseMessage.kt (73%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt (68%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/messages/DatasetReplyMessage.kt (95%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt (82%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/messages/UploadReplyMessage.kt (53%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/utils/GsonInstance.kt (86%) rename {app/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout}/plugins/sync/tidepool/utils/RateLimit.kt (93%) rename {app => plugins}/src/main/res/layout/ns_client_fragment.xml (95%) rename {app => plugins}/src/main/res/layout/overview_notification_item.xml (100%) rename app/src/main/res/layout/bgsource_fragment.xml => plugins/src/main/res/layout/source_fragment.xml (86%) rename app/src/main/res/layout/bgsource_item.xml => plugins/src/main/res/layout/source_item.xml (100%) rename {app => plugins}/src/main/res/layout/tidepool_fragment.xml (100%) rename app/src/main/res/layout/virtualpump_fragment.xml => plugins/src/main/res/layout/virtual_pump_fragment.xml (97%) rename {app => plugins}/src/main/res/raw/urgentalarm.mp3 (100%) rename {app => plugins}/src/main/res/xml/pref_bgsource.xml (100%) rename app/src/main/res/xml/pref_nsclientinternal.xml => plugins/src/main/res/xml/pref_ns_client.xml (85%) rename {app => plugins}/src/main/res/xml/pref_tidepool.xml (100%) rename app/src/main/res/xml/pref_virtualpump.xml => plugins/src/main/res/xml/pref_virtual_pump.xml (86%) rename {app/src/test/java/info/nightscout/androidaps => plugins/src/test/java/info/nightscout}/plugins/pump/virtual/VirtualPumpPluginUTest.kt (96%) rename {app/src/test/java/info/nightscout/androidaps => plugins/src/test/java/info/nightscout}/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt (98%) rename {app/src/test/java/info/nightscout/androidaps => plugins/src/test/java/info/nightscout}/plugins/sync/tidepool/comm/SessionTest.kt (80%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 93f9a92669..2ee878e272 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -171,16 +171,12 @@ android:scheme="wear" /> - diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index 21f333dc60..c32028af81 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -40,28 +40,28 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.databinding.ActivityMainBinding import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IconsProvider import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.SmsCommunicator import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.androidaps.setupwizard.SetupWizardActivity import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.isRunningRealPumpTest -import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.tabs.TabPageAdapter import info.nightscout.androidaps.utils.ui.UIRunnable +import info.nightscout.interfaces.AndroidPermission +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.SmsCommunicator +import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin +import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.events.EventInitializationChanged diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index b3068cce38..0b49cf7551 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -23,30 +23,30 @@ import info.nightscout.androidaps.database.transactions.VersionChangeTransaction import info.nightscout.androidaps.db.CompatDBHelper import info.nightscout.androidaps.di.DaggerAppComponent import info.nightscout.androidaps.di.StaticInjector -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.ConfigBuilder -import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.PluginStore import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore import info.nightscout.androidaps.receivers.BTReceiver import info.nightscout.androidaps.receivers.ChargingStateReceiver import info.nightscout.androidaps.receivers.KeepAliveWorker import info.nightscout.androidaps.receivers.NetworkChangeReceiver import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.ProcessLifecycleListener +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.plugins.general.overview.notifications.NotificationStore import info.nightscout.plugins.general.themes.ThemeSwitcherPlugin import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import info.nightscout.ui.utils.ActivityMonitor import info.nightscout.ui.widget.Widget import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -124,7 +124,7 @@ class MainApp : DaggerApplication() { // log version disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() // log app start - if (sp.getBoolean(R.string.key_ns_logappstartedevent, config.APS)) + if (sp.getBoolean(R.string.key_ns_log_app_started_event, config.APS)) disposable += repository .runTransaction( InsertIfNewByTimestampTherapyEventTransaction( @@ -214,8 +214,8 @@ class MainApp : DaggerApplication() { } sp.remove("ns_charginonly") } - if (!sp.contains(R.string.key_ns_logappstartedevent)) - sp.putBoolean(R.string.key_ns_logappstartedevent, config.APS) + if (!sp.contains(R.string.key_ns_log_app_started_event)) + sp.putBoolean(R.string.key_ns_log_app_started_event, config.APS) } override fun applicationInjector(): AndroidInjector { diff --git a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt index ed0f7f6242..2ad9bdb92a 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -23,11 +23,9 @@ import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.diaconn.DiaconnG8Plugin import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploader import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin @@ -41,7 +39,6 @@ import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin import info.nightscout.androidaps.plugins.pump.eopatch.EopatchPumpPlugin import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin @@ -53,10 +50,6 @@ import info.nightscout.androidaps.plugins.source.GlunovoPlugin import info.nightscout.androidaps.plugins.source.IntelligoPlugin import info.nightscout.androidaps.plugins.source.PoctechPlugin import info.nightscout.androidaps.plugins.source.TomatoPlugin -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.androidaps.plugins.sync.tidepool.TidepoolPlugin import info.nightscout.androidaps.utils.alertDialogs.OKDialog.show import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionType.BIOMETRIC @@ -64,13 +57,20 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionTyp import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionType.CUSTOM_PIN import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionType.NONE import info.nightscout.automation.AutomationPlugin +import info.nightscout.interfaces.Config import info.nightscout.plugins.general.autotune.AutotunePlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.general.xdripStatusline.StatusLinePlugin import info.nightscout.plugins.insulin.InsulinOrefFreePeakPlugin +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin +import info.nightscout.plugins.sync.nsclient.NSClientPlugin +import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus +import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import info.nightscout.plugins.sync.tidepool.TidepoolPlugin import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRebuildTabs import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt index e9d2a00a84..b0f83d2931 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -10,28 +10,17 @@ import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.implementations.ActivityNamesImpl import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Autotune -import info.nightscout.interfaces.BolusTimer -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.CarbTimer import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.IconsProvider import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.NotificationHolder import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.SmsCommunicator import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator @@ -44,18 +33,12 @@ import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctionImpl import info.nightscout.androidaps.plugins.general.maintenance.ImportExportPrefsImpl import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin -import info.nightscout.androidaps.plugins.pump.PumpSyncImplementation -import info.nightscout.androidaps.plugins.sync.nsclient.DataSyncSelectorImplementation -import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.androidNotification.NotificationHolderImpl import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.androidaps.utils.buildHelper.ConfigImpl import info.nightscout.androidaps.utils.resources.IconsProviderImplementation -import info.nightscout.interfaces.storage.FileStorage -import info.nightscout.interfaces.storage.Storage import info.nightscout.implementation.AndroidPermissionImpl import info.nightscout.implementation.BolusTimerImpl import info.nightscout.implementation.CarbTimerImpl @@ -63,16 +46,33 @@ import info.nightscout.implementation.LocalAlertUtilsImpl import info.nightscout.implementation.TrendCalculatorImpl import info.nightscout.implementation.XDripBroadcastImpl import info.nightscout.implementation.constraints.ConstraintsImpl +import info.nightscout.implementation.pump.PumpSyncImplementation import info.nightscout.implementation.queue.CommandQueueImplementation import info.nightscout.implementation.stats.DexcomTirCalculatorImpl import info.nightscout.implementation.stats.TddCalculatorImpl import info.nightscout.implementation.stats.TirCalculatorImpl +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.AndroidPermission +import info.nightscout.interfaces.Autotune +import info.nightscout.interfaces.BolusTimer +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.CarbTimer +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.LocalAlertUtils +import info.nightscout.interfaces.NotificationHolder +import info.nightscout.interfaces.SmsCommunicator +import info.nightscout.interfaces.storage.FileStorage +import info.nightscout.interfaces.storage.Storage import info.nightscout.plugins.general.autotune.AutotunePlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin +import info.nightscout.plugins.sync.nsclient.DataSyncSelectorImplementation +import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import javax.inject.Singleton @Suppress("unused") diff --git a/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt b/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt index 5765478431..96d1ee7956 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt @@ -23,12 +23,7 @@ import info.nightscout.androidaps.plugins.general.maintenance.MaintenanceFragmen import info.nightscout.androidaps.plugins.general.overview.OverviewFragment import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog import info.nightscout.androidaps.plugins.general.wear.WearFragment -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpFragment -import info.nightscout.androidaps.plugins.source.BGSourceFragment -import info.nightscout.androidaps.plugins.sync.nsShared.NSClientFragment -import info.nightscout.androidaps.plugins.sync.tidepool.TidepoolFragment import info.nightscout.androidaps.utils.protection.PasswordCheck -import info.nightscout.plugins.general.autotune.AutotuneFragment @Module @Suppress("unused") @@ -37,21 +32,14 @@ abstract class FragmentsModule { @ContributesAndroidInjector abstract fun contributesPreferencesFragment(): MyPreferenceFragment @ContributesAndroidInjector abstract fun contributesActionsFragment(): ActionsFragment - @ContributesAndroidInjector abstract fun contributesAutotuneFragment(): AutotuneFragment - @ContributesAndroidInjector abstract fun contributesBGSourceFragment(): BGSourceFragment @ContributesAndroidInjector abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment @ContributesAndroidInjector abstract fun contributesObjectivesFragment(): ObjectivesFragment @ContributesAndroidInjector abstract fun contributesOpenAPSFragment(): OpenAPSFragment @ContributesAndroidInjector abstract fun contributesOverviewFragment(): OverviewFragment @ContributesAndroidInjector abstract fun contributesLoopFragment(): LoopFragment @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment - @ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment @ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment - @ContributesAndroidInjector abstract fun contributesTidepoolFragment(): TidepoolFragment - - @ContributesAndroidInjector abstract fun contributesVirtualPumpFragment(): VirtualPumpFragment - @ContributesAndroidInjector abstract fun contributesEditQuickWizardDialog(): EditQuickWizardDialog @ContributesAndroidInjector abstract fun contributesExtendedBolusDialog(): ExtendedBolusDialog diff --git a/app/src/main/java/info/nightscout/androidaps/di/OverviewModule.kt b/app/src/main/java/info/nightscout/androidaps/di/OverviewModule.kt index 8bbc28a25d..f5f5706f2e 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/OverviewModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/OverviewModule.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.di import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData -import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationWithAction +import info.nightscout.plugins.general.overview.notifications.NotificationWithAction @Module @Suppress("unused") diff --git a/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt b/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt index a8eecb1e3d..cd1083e8e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt @@ -31,7 +31,6 @@ import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin @@ -41,14 +40,10 @@ import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.plugins.source.GlunovoPlugin import info.nightscout.androidaps.plugins.source.IntelligoPlugin import info.nightscout.androidaps.plugins.source.MM640gPlugin -import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin import info.nightscout.androidaps.plugins.source.PoctechPlugin import info.nightscout.androidaps.plugins.source.RandomBgPlugin import info.nightscout.androidaps.plugins.source.TomatoPlugin import info.nightscout.androidaps.plugins.source.XdripPlugin -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin -import info.nightscout.androidaps.plugins.sync.tidepool.TidepoolPlugin import info.nightscout.automation.AutomationPlugin import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin import info.nightscout.plugins.constraints.dstHelper.DstHelperPlugin @@ -65,6 +60,11 @@ import info.nightscout.plugins.insulin.InsulinOrefFreePeakPlugin import info.nightscout.plugins.insulin.InsulinOrefRapidActingPlugin import info.nightscout.plugins.insulin.InsulinOrefUltraRapidActingPlugin import info.nightscout.plugins.profile.ProfilePlugin +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin +import info.nightscout.plugins.source.NSClientSourcePlugin +import info.nightscout.plugins.sync.nsclient.NSClientPlugin +import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin +import info.nightscout.plugins.sync.tidepool.TidepoolPlugin import javax.inject.Qualifier @Suppress("unused") diff --git a/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt b/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt index dab1c764e2..f1e5bd04fc 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt @@ -2,12 +2,11 @@ package info.nightscout.androidaps.di import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.plugins.sync.nsclient.services.NSClientService -import info.nightscout.androidaps.plugins.general.overview.notifications.DismissNotificationService import info.nightscout.androidaps.plugins.general.persistentNotification.DummyService import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobile import info.nightscout.androidaps.services.AlarmSoundService import info.nightscout.automation.services.LocationService +import info.nightscout.plugins.general.overview.notifications.DismissNotificationService @Module @Suppress("unused") @@ -17,6 +16,5 @@ abstract class ServicesModule { @ContributesAndroidInjector abstract fun contributesDismissNotificationService(): DismissNotificationService @ContributesAndroidInjector abstract fun contributesDummyService(): DummyService @ContributesAndroidInjector abstract fun contributesLocationService(): LocationService - @ContributesAndroidInjector abstract fun contributesNSClientService(): NSClientService @ContributesAndroidInjector abstract fun contributesWatchUpdaterService(): DataLayerListenerServiceMobile } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/di/WorkersModule.kt b/app/src/main/java/info/nightscout/androidaps/di/WorkersModule.kt index ad9b25c340..51f38b59c1 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/WorkersModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/WorkersModule.kt @@ -8,21 +8,9 @@ import info.nightscout.androidaps.plugins.source.DexcomPlugin import info.nightscout.androidaps.plugins.source.EversensePlugin import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.plugins.source.MM640gPlugin -import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin import info.nightscout.androidaps.plugins.source.PoctechPlugin import info.nightscout.androidaps.plugins.source.TomatoPlugin import info.nightscout.androidaps.plugins.source.XdripPlugin -import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientAddAckWorker -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientAddUpdateWorker -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientMbgWorker -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientUpdateRemoveAckWorker -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadBgWorker -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadLastModificationWorker -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadStatusWorker -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.ProcessTreatmentsWorker import info.nightscout.plugins.profile.ProfilePlugin @Module @@ -36,19 +24,7 @@ abstract class WorkersModule { @ContributesAndroidInjector abstract fun contributesPoctechWorker(): PoctechPlugin.PoctechWorker @ContributesAndroidInjector abstract fun contributesTomatoWorker(): TomatoPlugin.TomatoWorker @ContributesAndroidInjector abstract fun contributesEversenseWorker(): EversensePlugin.EversenseWorker - @ContributesAndroidInjector abstract fun contributesNSClientSourceWorker(): NSClientSourcePlugin.NSClientSourceWorker @ContributesAndroidInjector abstract fun contributesNSProfileWorker(): ProfilePlugin.NSProfileWorker - @ContributesAndroidInjector abstract fun contributesNSClientWorker(): NSClientAddUpdateWorker - @ContributesAndroidInjector abstract fun contributesNSClientAddAckWorker(): NSClientAddAckWorker - @ContributesAndroidInjector abstract fun contributesNSClientUpdateRemoveAckWorker(): NSClientUpdateRemoveAckWorker - @ContributesAndroidInjector abstract fun contributesNSClientMbgWorker(): NSClientMbgWorker @ContributesAndroidInjector abstract fun contributesCsvExportWorker(): ImportExportPrefsImpl.CsvExportWorker @ContributesAndroidInjector abstract fun contributesAidexWorker(): AidexPlugin.AidexWorker - @ContributesAndroidInjector abstract fun contributesLoadStatusWorker(): LoadStatusWorker - @ContributesAndroidInjector abstract fun contributesLoadLastModificationWorker(): LoadLastModificationWorker - @ContributesAndroidInjector abstract fun contributesLoadBgWorker(): LoadBgWorker - @ContributesAndroidInjector abstract fun contributesStoreBgWorker(): StoreDataForDb.StoreBgWorker - @ContributesAndroidInjector abstract fun contributesTreatmentWorker(): LoadTreatmentsWorker - @ContributesAndroidInjector abstract fun contributesProcessTreatmentsWorker(): ProcessTreatmentsWorker - @ContributesAndroidInjector abstract fun contributesLoadDeviceStatusWorker(): LoadDeviceStatusWorker } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt index f42529c2d7..f8378616b5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt @@ -41,20 +41,15 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification -import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.buildDeviceStatus import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config @@ -63,6 +58,8 @@ import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.queue.Callback +import info.nightscout.plugins.configBuilder.RunningConfiguration +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAcceptOpenLoopChange @@ -71,7 +68,10 @@ import info.nightscout.rx.events.EventTempTargetChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.rx.weardata.EventData +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt index d1f22fd2c3..792c462992 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt @@ -16,7 +16,6 @@ import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui @@ -29,6 +28,7 @@ import info.nightscout.rx.events.EventConfigBuilderChange import info.nightscout.rx.events.EventRebuildTabs import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton @@ -138,7 +138,7 @@ class ConfigBuilderPlugin @Inject constructor( // Ask when switching to physical pump plugin fun switchAllowed(changedPlugin: PluginBase, newState: Boolean, activity: FragmentActivity?, type: PluginType) { - if (changedPlugin.getType() == PluginType.PUMP && changedPlugin.name != rh.gs(R.string.virtualpump)) + if (changedPlugin.getType() == PluginType.PUMP && changedPlugin.name != rh.gs(R.string.virtual_pump)) confirmPumpPluginActivation(changedPlugin, newState, activity, type) else if (changedPlugin.getType() == PluginType.PUMP) { performPluginSwitch(changedPlugin, newState, type) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImpl.kt index 8b1c22c0fc..26604d33ed 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImpl.kt @@ -12,20 +12,20 @@ import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.fromConstant import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.ConcurrentHashMap diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt index f7b39ecb05..ab7f7ac337 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt @@ -6,7 +6,6 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective0 import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective1 @@ -22,6 +21,7 @@ import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton @@ -91,8 +91,8 @@ class ObjectivesPlugin @Inject constructor( objective.startedOn = 0 objective.accomplishedOn = 0 } - sp.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, false) - sp.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, false) + sp.putBoolean(R.string.key_objectives_bg_is_available_in_ns, false) + sp.putBoolean(R.string.key_objectives_pump_status_is_available_in_ns, false) sp.putInt(R.string.key_ObjectivesmanualEnacts, 0) sp.putBoolean(R.string.key_objectiveuseprofileswitch, false) sp.putBoolean(R.string.key_objectiveusedisconnect, false) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.kt index 9071d4eda3..f14f96218b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective0.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import javax.inject.Inject class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R.string.objectives_0_objective, R.string.objectives_0_gate) { @@ -22,7 +22,7 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R init { tasks.add(object : Task(this, R.string.objectives_bgavailableinns) { override fun isCompleted(): Boolean { - return sp.getBoolean(R.string.key_ObjectivesbgIsAvailableInNS, false) + return sp.getBoolean(R.string.key_objectives_bg_is_available_in_ns, false) } }) tasks.add(object : Task(this, R.string.synchaswritepermission) { @@ -32,7 +32,7 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R }) tasks.add(object : Task(this, R.string.virtualpump_uploadstatus_title) { override fun isCompleted(): Boolean { - return sp.getBoolean(R.string.key_virtualpump_uploadstatus, false) + return sp.getBoolean(R.string.key_virtual_pump_upload_status, false) } override fun shouldBeIgnored(): Boolean { @@ -41,7 +41,7 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R }) tasks.add(object : Task(this, R.string.objectives_pumpstatusavailableinns) { override fun isCompleted(): Boolean { - return sp.getBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, false) + return sp.getBoolean(R.string.key_objectives_pump_status_is_available_in_ns, false) } }) tasks.add(object : Task(this, R.string.hasbgdata) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt index 4138355326..71665179bf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt @@ -7,25 +7,22 @@ import android.os.Bundle import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.extensions.durationInMinutes -import info.nightscout.shared.extensions.safeQueryBroadcastReceivers import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.androidaps.receivers.Intents import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event @@ -33,6 +30,9 @@ import info.nightscout.rx.events.EventAutosensCalculationFinished import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.safeQueryBroadcastReceivers +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePlugin.kt index a2753670e1..e1c3107515 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePlugin.kt @@ -7,15 +7,15 @@ import androidx.core.content.FileProvider import dagger.android.HasAndroidInjector import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R +import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.plugins.general.maintenance.LoggerUtils +import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import java.io.BufferedInputStream import java.io.BufferedOutputStream diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 68e24c07ea..6e2bbfe85e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -46,8 +46,6 @@ import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.directionToIcon -import info.nightscout.shared.extensions.runOnUiThread -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue @@ -59,7 +57,6 @@ import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification @@ -68,19 +65,14 @@ import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizar import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewIobCob -import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewSensitivity import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData -import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin import info.nightscout.androidaps.plugins.source.DexcomPlugin import info.nightscout.androidaps.plugins.source.XdripPlugin -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus -import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.androidaps.skins.SkinProvider -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils @@ -95,6 +87,10 @@ import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin +import info.nightscout.plugins.general.overview.notifications.NotificationStore +import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification +import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus +import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAcceptOpenLoopChange @@ -106,7 +102,11 @@ import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.events.EventTempTargetChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.weardata.EventData +import info.nightscout.shared.extensions.runOnUiThread +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import info.nightscout.ui.dialogs.CalibrationDialog import info.nightscout.ui.dialogs.CarbsDialog import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -505,7 +505,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList R.id.temp_target -> v.performClick() R.id.active_profile -> activity?.let { activity -> - if (loop.isDisconnected) OKDialog.show(activity, rh.gs(R.string.not_available_full), rh.gs(R.string.smscommunicator_pumpdisconnected)) + if (loop.isDisconnected) OKDialog.show(activity, rh.gs(R.string.not_available_full), rh.gs(R.string.smscommunicator_pump_disconnected)) else protectionCheck.queryProtection( activity, diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewPlugin.kt index 6facf41961..a7b175c6a3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewPlugin.kt @@ -13,24 +13,24 @@ import info.nightscout.androidaps.extensions.putString import info.nightscout.androidaps.extensions.storeDouble import info.nightscout.androidaps.extensions.storeInt import info.nightscout.androidaps.extensions.storeString -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Overview import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress -import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification -import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore -import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationWithAction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.general.overview.notifications.NotificationStore +import info.nightscout.plugins.general.overview.notifications.NotificationWithAction +import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearFragment.kt index d2bf545ca9..25b8a9287f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearFragment.kt @@ -6,13 +6,13 @@ import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.databinding.WearFragmentBinding -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventMobileToWear import info.nightscout.rx.weardata.EventData +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt index 93ce00d453..5e339bb987 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataHandlerMobile.kt @@ -33,20 +33,16 @@ import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.androidaps.utils.wizard.QuickWizard @@ -54,13 +50,17 @@ import info.nightscout.androidaps.utils.wizard.QuickWizardEntry import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.queue.Callback +import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventMobileToWear import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.rx.weardata.EventData +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.dialogs.CarbsDialog import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/AidexPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/AidexPlugin.kt index d0bb5b6ac1..5e8c7282d3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/AidexPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/AidexPlugin.kt @@ -5,22 +5,23 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/DexcomPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/DexcomPlugin.kt index c1a9c3bebb..de50f72961 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/DexcomPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/DexcomPlugin.kt @@ -18,23 +18,24 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction import info.nightscout.androidaps.extensions.fromConstant -import info.nightscout.shared.extensions.safeGetInstalledPackages import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.source.activities.RequestDexcomPermissionActivity import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.safeGetInstalledPackages +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/EversensePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/EversensePlugin.kt index 712b1db606..aff6747a98 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/EversensePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/EversensePlugin.kt @@ -13,15 +13,16 @@ import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import java.util.Arrays import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/GlimpPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/GlimpPlugin.kt index 5026cd4330..76395f2cb3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/GlimpPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/GlimpPlugin.kt @@ -12,12 +12,13 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.interfaces.XDripBroadcast +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton @@ -34,7 +35,7 @@ class GlimpPlugin @Inject constructor( .mainType(PluginType.BGSOURCE) .fragmentClass(BGSourceFragment::class.java.name) .pluginIcon(R.drawable.ic_glimp) - .pluginName(R.string.Glimp) + .pluginName(R.string.glimp) .preferencesId(R.xml.pref_bgsource) .description(R.string.description_source_glimp), aapsLogger, rh, injector diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/GlunovoPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/GlunovoPlugin.kt index 51ce38808d..c1ed4e18d4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/GlunovoPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/GlunovoPlugin.kt @@ -5,7 +5,6 @@ import android.net.Uri import android.os.Handler import android.os.HandlerThread import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue @@ -15,17 +14,19 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/IntelligoPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/IntelligoPlugin.kt index 4393861eec..e937ddb23a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/IntelligoPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/IntelligoPlugin.kt @@ -7,7 +7,6 @@ import android.os.Handler import android.os.HandlerThread import android.util.Log import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue @@ -15,20 +14,22 @@ import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.CgmSourceTransaction -import info.nightscout.shared.extensions.safeGetInstalledPackages import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.safeGetInstalledPackages +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/MM640gPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/MM640gPlugin.kt index cad68c1ee8..a63d38d541 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/MM640gPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/MM640gPlugin.kt @@ -11,15 +11,16 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONException import javax.inject.Inject @@ -36,7 +37,7 @@ class MM640gPlugin @Inject constructor( .mainType(PluginType.BGSOURCE) .fragmentClass(BGSourceFragment::class.java.name) .pluginIcon(R.drawable.ic_generic_cgm) - .pluginName(R.string.MM640g) + .pluginName(R.string.mm640g) .description(R.string.description_source_mm640g), aapsLogger, rh, injector ), BgSource { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/PoctechPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/PoctechPlugin.kt index 402e2d5f32..36460da7f6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/PoctechPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/PoctechPlugin.kt @@ -5,20 +5,21 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.androidaps.interfaces.XDripBroadcast +import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.interfaces.utils.JsonHelper.safeGetString +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt index b94c25009b..559c1a14e6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt @@ -10,17 +10,18 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.isRunningTest import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Calendar diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/TomatoPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/TomatoPlugin.kt index 06bffd9096..50399cad2a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/TomatoPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/TomatoPlugin.kt @@ -11,12 +11,13 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.interfaces.XDripBroadcast +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/XdripPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/XdripPlugin.kt index b2e19ed545..410b1266e7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/XdripPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/XdripPlugin.kt @@ -11,13 +11,14 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt index d53dce1d33..7619e086bc 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -22,21 +22,21 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.buildDeviceStatus import info.nightscout.interfaces.Config import info.nightscout.interfaces.LocalAlertUtils +import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.widget.Widget import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt index 8ec20dd32e..823e98c983 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -16,14 +16,12 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.omnipod.dash.OmnipodDashPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus import info.nightscout.androidaps.setupwizard.elements.SWBreak import info.nightscout.androidaps.setupwizard.elements.SWButton import info.nightscout.androidaps.setupwizard.elements.SWEditEncryptedPassword @@ -47,7 +45,9 @@ import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginType import info.nightscout.plugins.profile.ProfileFragment import info.nightscout.plugins.profile.ProfilePlugin +import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt index 7431530e70..10c2a4af07 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt @@ -12,12 +12,12 @@ import info.nightscout.androidaps.databinding.ActivitySetupwizardBinding import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus import info.nightscout.androidaps.setupwizard.elements.SWItem import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.interfaces.locale.LocaleHelper.update +import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventProfileStoreChanged import info.nightscout.rx.events.EventProfileSwitchChanged diff --git a/app/src/main/java/info/nightscout/androidaps/utils/extensions/TherapyEventExtension.kt b/app/src/main/java/info/nightscout/androidaps/utils/extensions/TherapyEventExtension.kt deleted file mode 100644 index f11572cfd1..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/utils/extensions/TherapyEventExtension.kt +++ /dev/null @@ -1,12 +0,0 @@ -package info.nightscout.androidaps.utils.extensions - -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSMbg - -fun therapyEventFromNsMbg(mbg: NSMbg) = - TherapyEvent( - type = TherapyEvent.Type.FINGER_STICK_BG_VALUE, //convert Mbg to finger stick because is coming from "entries" collection - timestamp = mbg.date, - glucose = mbg.mbg, - glucoseUnit = TherapyEvent.GlucoseUnit.MGDL - ) diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt index 6d367d0943..812323f3fe 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt @@ -8,18 +8,18 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.OverviewMenus import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries -import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.shared.utils.T import info.nightscout.interfaces.Config +import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.T import java.util.Calendar import javax.inject.Inject import kotlin.math.ceil diff --git a/app/src/main/res/layout/dialog_extendedbolus.xml b/app/src/main/res/layout/dialog_extendedbolus.xml index c62642b775..4c12cc269b 100644 --- a/app/src/main/res/layout/dialog_extendedbolus.xml +++ b/app/src/main/res/layout/dialog_extendedbolus.xml @@ -31,7 +31,7 @@ android:layout_gravity="center" android:layout_marginStart="10dp" android:layout_marginEnd="10dp" - android:text="@string/virtualpump_extendedbolus_label" + android:text="@string/extended_bolus_label" android:textAlignment="center" android:textAppearance="?android:attr/textAppearanceLarge" /> diff --git a/app/src/main/res/layout/smscommunicator_fragment.xml b/app/src/main/res/layout/smscommunicator_fragment.xml deleted file mode 100644 index 69a4af9c8e..0000000000 --- a/app/src/main/res/layout/smscommunicator_fragment.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 618523df4d..145f2d778e 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -92,38 +92,6 @@ @string/key_pregnant - - Generic AAPS - MDI - Accu-Chek Combo - Accu-Chek Spirit - Accu-Chek Insight - Accu-Chek Solo - Animas Ping - Animas Vibe - Cellnovo - DanaR - DanaR Korean - DanaRS - DanaRv2 - DanaI - Diaconn G8 - Eoflow Eopatch2 - Medtronic 512/712 - Medtronic 515/715 - Medtronic 522/722 - Medtronic 523/723 (Revel) - Medtronic 554/754 (Veo) - Medtronic 640G - Omnipod Dash - Omnipod Eros - Tandem t:slim - Tandem t:flex - Tandem t:slim G4 - Tandem t:slim X2 - YpsoPump - - 15 30 diff --git a/app/src/main/res/values/objectives.xml b/app/src/main/res/values/objectives.xml index 8e6823e3ef..ee8a34ee0e 100644 --- a/app/src/main/res/values/objectives.xml +++ b/app/src/main/res/values/objectives.xml @@ -8,8 +8,6 @@ ObjectivesLoopUsed ObjectivesScaleUsed objectives_request_code - ObjectivesbgIsAvailableInNS - ObjectivespumpStatusIsAvailableInNS ObjectivesmanualEnacts Start diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0287e1f58e..20f0948d4c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -32,25 +32,8 @@ smscommunicator protection absorption_category_settings - ns_temporary_target_last_sync - ns_glucose_value_last_sync - ns_food_last_sync - ns_therapy_event_last_sync bolussnooze_dia_divisor autosens_adjust_targets - ns_bolus_calculator_result_last_synced_id - ns_carbs_last_synced_id - ns_bolus_last_synced_id - ns_device_status_last_synced_id - ns_temporary_basal_last_synced_id - ns_extended_bolus_last_synced_id - profile_switch_last_synced_id - ns_effective_profile_switch_last_synced_id - ns_offline_event_last_synced_id - ns_profile_store_last_synced_timestamp - ns_sync_slow - nsclient_token - nsclientv2_lastmodified last_cleanup_run Treatments safety Max allowed bolus [U] @@ -66,26 +49,17 @@ Used for configuring the active plugins Learning program Activate or deactivate the implementation triggering the loop. - Synchronizes your data with Nightscout using v3 API - Synchronizes your data with Nightscout State of the algorithm in 2017 Most recent algorithm for advanced users Most recent algorithm for advanced users with dynamic/automatic ISF Displays the current state of your loop and buttons for most common actions Shows an ongoing notification with a short overview of what your loop is doing - Pump integration for pumps which don\'t have any driver yet (Open Loop) Sensitivity is calculated the same way like Oref0, but you can specify timeframe to the past. Minimal carb absorption is calculated from max carb absorption time from preferences. Sensitivity is calculated from 8h or 24h data in the past (using either which is more sensitive). Carbs (if not absorbed) are cut after time specified in preferences. Plugin also calculates UAM. Sensitivity is calculated as a weighted average from deviations. Newer deviations have higher weight. Minimal carb absorption is calculated from max carb absorption time from preferences. This algorithm is the fastest in following sensitivity changes. - Receive BG values from the patched Eversense app. - Receive BG values from Glimp. - Receive BG values from the 600SeriesAndroidUploader. - Downloads BG data from Nightscout - Receive BG values from xDrip+. Saves all treatments that were made Monitor and control AAPS using your WearOS watch. Run now - VIRTUAL PUMP Last run Input parameters Glucose status @@ -101,7 +75,6 @@ Config Builder Overview Treatments - Virtual Pump Pump Which pump would you like to use with AAPS? Profile @@ -127,14 +100,12 @@ Change your input! BG Source Where should AAPS gain it\'s data from? - xDrip+ APS Mode Closed Loop Open Loop Low Glucose Suspend New suggestion available Carbs Suggestion - Unsupported version of Nightscout Carb time Profile TempBasal @@ -202,7 +173,6 @@ Resend All Data Open Settings on Wear Basal rate - MM640g Ongoing Notification OLD DATA OpenAPS AMA @@ -216,7 +186,6 @@ OAPS DYNISF HOME - VPUMP TREAT OBJ WEAR @@ -235,33 +204,6 @@ Attention!\nNormally you do not have to change these values below. Please CLICK HERE and READ the text and make sure you UNDERSTAND it before change any of these values. http://openaps.readthedocs.io/en/latest/docs/walkthrough/phase-3/beyond-low-glucose-suspend.html Executing - Virtual pump settings - Upload status to NS - NSClientV3 - NSV3 - NSClient - NSCI - URL: - Autoscroll - Restart - NSClient - Nightscout URL - Enter Your Nightscout URL - NS API secret - NS API secret - Enter NS API secret (min 12 chars) - NS access token - NS access token - Access token generated on NS admin page (min 17 chars) - Deliver now - Clear queue - Show queue - Queue: - Status: - Clear log - nsclientinternal_autoscroll - nsclientinternal_paused - NSCLIENT has no write permission. Wrong API secret? Wear settings not successful - please check phone Patient type @@ -274,7 +216,6 @@ Patient name Please provide patient name or nickname to differentiate among multiple setups I_understand - Glimp Suspend loop for 1h Suspend loop for 2h Suspend loop for 3h @@ -293,42 +234,11 @@ 10 hours Resume Reconnect Pump - Log app start to NS Exiting application to apply settings. Which type of insulin are you using? key_usersuperbolus Enable superbolus in wizard Enable superbolus functionality in wizard. Do not enable until you learn what it really does. IT MAY CAUSE INSULIN OVERDOSE IF USED BLINDLY! - show_statuslights - Show status lights on home screen - statuslights_cage_warning - Threshold warning canula age [h] - statuslights_cage_critical - Threshold critical canula age [h] - statuslights_iage_warning - Threshold warning insulin age [h] - statuslights_iage_critical - Threshold critical insulin age [h] - statuslights_sage_warning - Threshold warning sensor age [h] - statuslights_sage_critical - Threshold critical sensor age [h] - statuslights_sbat_warning - Threshold warning sensor battery level [%] - statuslights_sbat_critical - Threshold critical sensor battery level [%] - statuslights_bage_warning - Threshold warning pump battery age [h] - statuslights_bage_critical - Threshold critical pump battery age [h] - statuslights_res_warning - Threshold warning reservoir level [U] - statuslights_res_critical - Threshold critical reservoir level [U] - statuslights_bat_warning - Threshold warning pump battery level [%] - statuslights_bat_critical - Threshold critical pump battery level [%] PRED BAS DEV @@ -345,15 +255,15 @@ Pump battery age: level: - Alarm options + Alarm options ns_announcements ns_alarms - nsalarm_staledatavalue - nsalarm_urgent_staledatavalue + nsalarm_staledatavalue + nsalarm_urgent_staledatavalue Create notifications from NS alarms Create notifications from NS announcements - Stale data threshold [min] - Urgent stale data threshold [min] + Stale data threshold [min] + Urgent stale data threshold [min] Interval for autosens [h] Amount of hours in the past for sensitivity detection (carbs absorption time is excluded) openapsama_autosens_period @@ -367,16 +277,12 @@ Absorption settings Meal max absorption time [h] Time in hours where is expected all carbs from meal will be absorbed - OAPS - UPLD Keep screen on Prevent Android to turn screen off. It will consume lot of energy when not plugged to power outlet. By turning on Autosense feature remember to enter all eated carbs. Otherwise carbs deviations will be identified wrong as sensitivity change !! Sensitivity WeightedAverage Not all profiles loaded! Values not stored! - Enable broadcasts to other apps (like xDrip+). Do not enable if you have more than one instance of AAPS or AAPSClient installed! - Enable local Broadcasts. OpenAPS SMB Dynamic ISF DynISFAdjust @@ -404,20 +310,12 @@ Reuse %1$d%% %2$dh Controls from Watch Set Temp-Targets and enter Treatments from the watch. - raise_urgent_alarms_as_android_notification - Use system notifications for alerts and notifications Gradually increase the volume for alerts and notifications Local alerts Alert if no BG data is received Alert if pump is unreachable Pump unreachable threshold [min] Alert if carbs are required - Urgent Alarm - INFO - Eversense App (patched) - Upload BG data to NS - dexcomg5_nsupload - BG upload settings Show detailed delta Show delta with one more decimal place smbinterval @@ -428,10 +326,6 @@ carbsReqThreshold Minimum Carbs Required For Suggestion Minimum grams of carbs to display a carbs suggestion alert. Carbs suggestions below this number will not trigger a notification. - Send BG data to xDrip+ - In xDrip+ select 640g/Eversense data source - NSClient BG - NS BG BG calculation Bolus IOB calculation Basal IOB calculation @@ -487,12 +381,6 @@ History browser Notify on SMB Show SMB on the watch like a standard bolus. - Create announcements from errors - Create announcements from carbs required alerts - Create Nightscout announcement for error dialogs and local alerts (also viewable in Careportal under Treatments) - Create Nightscout announcements for carbs required alerts - ns_create_announcements_from_carbs_req - EVR Show the predictions on the watchface. Predictions Data Choices @@ -558,30 +446,12 @@ Second carbs increment Third carbs increment CGM - ns_cellular - ns_wifi - ns_wifi_ssids - ns_allowroaming - ns_battery - ns_charging - Use Cellular connection - Use WiFi connection - WiFi SSID - During charging - On battery - Connection settings - Allowed SSIDs (semicolon separated) - Allow connection in roaming always_use_shortavg Max autosens ratio Min autosens ratio Bolus snooze dia divisor Max daily safety multiplier Current basal safety multiplier - virtualpump_uploadstatus - Virtual Pump Type - Pump Definition - Bolus: Step=%1$s\nExtended Bolus: [Step=%2$s, Duration=%3$smin-%4$sh]\nBasal: Step=%5$s\nTBR: %6$s (by %7$s), Duration=%8$smin-%9$sh\n%10$s wearwizard_bg wearwizard_tt wearwizard_trend @@ -607,13 +477,6 @@ Open navigation Close navigation Plugin preferences - Poctech - Receive BG values from Poctech app - Glunovo - Receive values from Glunovo app - Intelligo - Receive values from Intelligo app - Receive BG values from Tomato app (MiaoMiao device) high_temptarget_raises_sensitivity low_temptarget_lowers_sensitivity High temptarget raises sensitivity @@ -650,7 +513,6 @@ Miscellaneous Log settings Reset to defaults - NSClient malfunction. Consider NS and NSClient restart. aps_mode Preferred APS mode Send today\'s log files to developers along with this time. Unexpected situation. @@ -661,41 +523,9 @@ dexcom_lognssensorchange Log sensor change to NS Create event \"Sensor Change\" in NS automatically on sensor start - Tomato (MiaoMiao) - Tomato - tidepool_username - tidepool_password - tidepool_dev_servers - tidepool_test_login - tidepool_only_while_charging - tidepool_only_while_unmetered - Your Tidepool login user name, normally your email address - Login User Name - Your Tidepool login password - Login Password - Test Tidepool Login - If enabled, uploads will go to https://int-app.tidepool.org instead of the regular https://app.tidepool.org/ - Use Integration (test) servers - Tidepool - TDP - Uploads data to Tidepool - tidepool_last_end - Upload CGM data - tidepool_upload_cgm - tidepool_upload_bolus - Upload treatments (insulin, carbs) - tidepool_upload_tbr - Upload temporary basals - tidepool_upload_profile - Upload profile switches, temp targets - tidepool_upload_bg - Upload BG tests smbmaxminutes uamsmbmaxminutes 2h - BYODA - BYODA - Receive BG values from the \'Build Your Own Dexcom App\'. COB vs IOB Bolus constraint applied: %1$.2f U to %2$.2f U !!!!! Slow carbs absorption detected: %2$d%% of time. Double check your calculation. COB can be overestimated thus more insulin could be given !!!!!]]> @@ -724,7 +554,6 @@ Show removed Clear queue? All data in queue will be lost! wear_detailed_delta - snoozedTo Use of Extended bolus feature will stop closed loop mode for the time of running extended bolus. Do you really want it? Closed loop disabled because of running Extended bolus Chart menu @@ -741,11 +570,6 @@ Absolute insulin Master password is used for backup encryption and to override security in application. Remember it or store on a safe place. Current master password - Status lights - Copy settings from NS - statuslights_copy_ns - Copy NS settings (if exists)? - statuslights_overview_advanced Original skin Low Resolution skin Buttons are always displayed on bottom of screen @@ -781,34 +605,6 @@ Email address Privacy setting You can provide optional email address if you want to be notified about app crashes. This is not an automated service. You will be contacted by developers in dangerous situations. - Full synchronization - Full synchronization? It may take many hours and until finish you\'ll not see new data in NS. - Synchronization - ns_upload - Profiles, boluses, carbs, temporary basals are uploaded to NS - Upload data to NS - Receive profile store - Synchronize profiles from NS profile editor - Receive temporary targets - Accept temporary targets entered through NS or NSClient - Receive profile switches - Accept profile switches entered through NS or NSClient - Receive APS offline events - Accept APS Offline events entered through NS or NSClient - Receive TBR and EB - Accept TBR and EB entered through another instance - Receive insulin - Accept insulin entered through NS or NSClient (it\'s not delivered, only calculated towards IOB) - Receive carbs - Accept carbs entered through NS or NSClient - ns_receive_tbr_eb - Receive therapy events - Accept therapy events (cannula, insulin, battery change etc) entered through NS or NSClient - ns_receive_cgm - Receive/backfill CGM data - Accept CGM data from NS - Run %s? - Slow down uploads BG data status Remove BG readings cannula age @@ -868,9 +664,6 @@ Graph scale Profile 1 Profile 2 - Login - Remove all - Reset start open settings set carb timer alarm All @@ -881,12 +674,6 @@ drag and drop handle Search - - GlucoRx Aidex - Aidex - Receive BG values from GlucoRx Aidex CGMS. - Blocked by charging options - Blocked by connectivity options (No Watch Connected) dynisf_adjust_sensitivity Adjust sensitivity and BG diff --git a/app/src/main/res/xml/pref_alerts.xml b/app/src/main/res/xml/pref_alerts.xml index 811a06b2e8..354489b0d5 100644 --- a/app/src/main/res/xml/pref_alerts.xml +++ b/app/src/main/res/xml/pref_alerts.xml @@ -18,7 +18,7 @@ android:dependency="@string/key_enable_missed_bg_readings_alert" android:inputType="number" android:key="@string/key_missed_bg_readings_threshold_minutes" - android:title="@string/nsalarm_staledatavalue_label" + android:title="@string/ns_alarm_stale_data_value_label" validate:maxNumber="10000" validate:minNumber="15" validate:testType="numericRange" /> diff --git a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt index ecf9dbe9ab..944f21674a 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -25,7 +25,6 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.RuffyScripter import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.utils.HardLimits @@ -34,13 +33,13 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.implementation.constraints.ConstraintsImpl import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test import org.mockito.Mock import org.mockito.Mockito.`when` -import java.util.* /** * Created by mike on 18.03.2018. diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt index bc8df4dc93..1fda3795e0 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt @@ -8,23 +8,23 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpDescription -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.configBuilder.RunningConfiguration +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.kt index 8fb19b3e95..4f60958f7c 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.kt @@ -2,22 +2,22 @@ package info.nightscout.androidaps.plugins.constraints.safety import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PumpDescription import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin -import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Constants +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePluginTest.kt index c762397071..170e402f99 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePluginTest.kt @@ -5,9 +5,9 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.plugins.general.maintenance.LoggerUtils +import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt index ff3f949df6..28f853bb34 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt @@ -3,6 +3,7 @@ package info.nightscout.androidaps.plugins.source import dagger.android.AndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.interfaces.Config +import info.nightscout.plugins.source.NSClientSourcePlugin import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert diff --git a/app/src/test/java/info/nightscout/androidaps/utils/wizard/BolusWizardTest.kt b/app/src/test/java/info/nightscout/androidaps/utils/wizard/BolusWizardTest.kt index 1b10aacabe..e483228007 100644 --- a/app/src/test/java/info/nightscout/androidaps/utils/wizard/BolusWizardTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/utils/wizard/BolusWizardTest.kt @@ -15,12 +15,12 @@ import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpDescription -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin -import info.nightscout.shared.utils.DateUtil +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.junit.Assert import org.junit.Test import org.mockito.Mock diff --git a/app/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt b/core/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt similarity index 100% rename from app/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt rename to core/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt index 0cbd49f33d..c5b98edc1f 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt @@ -21,7 +21,6 @@ import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DeviationDataPoint import info.nightscout.androidaps.plugins.general.overview.graphExtensions.FixedLineGraphSeries @@ -30,11 +29,12 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import java.util.Calendar import javax.inject.Inject import javax.inject.Singleton @@ -170,10 +170,10 @@ class OverviewData @Inject constructor( fun temporaryBasalDialogText(iobCobCalculator: IobCobCalculator): String = profileFunction.getProfile()?.let { profile -> iobCobCalculator.getTempBasalIncludingConvertedExtended(dateUtil.now())?.let { temporaryBasal -> - "${rh.gs(R.string.basebasalrate_label)}: ${rh.gs(R.string.pump_basebasalrate, profile.getBasal())}" + + "${rh.gs(R.string.base_basal_rate_label)}: ${rh.gs(R.string.pump_basebasalrate, profile.getBasal())}" + "\n" + rh.gs(R.string.tempbasal_label) + ": " + temporaryBasal.toStringFull(profile, dateUtil) } - ?: "${rh.gs(R.string.basebasalrate_label)}: ${rh.gs(R.string.pump_basebasalrate, profile.getBasal())}" + ?: "${rh.gs(R.string.base_basal_rate_label)}: ${rh.gs(R.string.pump_basebasalrate, profile.getBasal())}" } ?: rh.gs(R.string.value_unavailable_short) @DrawableRes fun temporaryBasalIcon(iobCobCalculator: IobCobCalculator): Int = diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 9a155e24e0..ddb8ad89fb 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -17,7 +17,6 @@ low_mark high_mark ns_create_announcements_from_errors - ns_logappstartedevent bt_watchdog bt_watchdog_last pump_unreachable_threshold @@ -48,7 +47,7 @@ openapsma_settings medtronic_settings danars_settings - nsclientinternal_settings + nsclientinternal_settings insight_local_settings data_choices_settings dexcom_settings @@ -154,9 +153,9 @@ Last connection Last bolus Daily units - Base basal rate + Base basal rate Temp basal - Extended bolus + Extended bolus Reservoir Pump history View profile @@ -251,6 +250,11 @@ COB Bolus IOB Basal IOB + %1$d%% + Paused + INVALID + Login + Upload now Limiting max basal rate to %1$.2f U/h because of %2$s @@ -656,6 +660,12 @@ Another run of Autotune is detected, run cancelled Application needs bluetooth permission + + raise_urgent_alarms_as_android_notification + Use system notifications for alerts and notifications + Urgent Alarm + INFO + Missing SMS permission diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt rename to implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 808a6cda76..7da5c0e0ef 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump +package info.nightscout.implementation.pump import info.nightscout.androidaps.core.R import info.nightscout.androidaps.data.DetailedBolusInfo @@ -32,18 +32,18 @@ import info.nightscout.androidaps.database.transactions.SyncTemporaryBasalWithTe import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.VirtualPump +import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -79,7 +79,7 @@ class PumpSyncImplementation @Inject constructor( override fun verifyPumpIdentification(type: PumpType, serialNumber: String): Boolean { val storedType = sp.getString(R.string.key_active_pump_type, "") val storedSerial = sp.getString(R.string.key_active_pump_serial_number, "") - if (activePlugin.activePump is VirtualPumpPlugin) return true + if (activePlugin.activePump is VirtualPump) return true if (type.description == storedType && serialNumber == storedSerial) return true aapsLogger.debug(LTag.PUMP, "verifyPumpIdentification failed for $type $serialNumber") return false @@ -107,7 +107,7 @@ class PumpSyncImplementation @Inject constructor( return timestamp > dateUtil.now() - T.mins(1).msecs() // allow first record to be 1 min old } - if (activePlugin.activePump is VirtualPumpPlugin || (type.description == storedType && serialNumber == storedSerial && timestamp >= storedTimestamp)) { + if (activePlugin.activePump is VirtualPump || (type.description == storedType && serialNumber == storedSerial && timestamp >= storedTimestamp)) { // data match return true } 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 d1a1393ba2..f90414e021 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 @@ -22,7 +22,6 @@ import javax.inject.Inject; import dagger.android.support.DaggerFragment; import info.nightscout.androidaps.insight.R; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.rx.bus.RxBus; import info.nightscout.androidaps.plugins.pump.insight.app_layer.parameter_blocks.TBROverNotificationBlock; import info.nightscout.androidaps.plugins.pump.insight.descriptors.ActiveBasalRate; import info.nightscout.androidaps.plugins.pump.insight.descriptors.ActiveBolus; @@ -31,12 +30,13 @@ import info.nightscout.androidaps.plugins.pump.insight.descriptors.CartridgeStat import info.nightscout.androidaps.plugins.pump.insight.descriptors.InsightState; import info.nightscout.androidaps.plugins.pump.insight.descriptors.TotalDailyDose; import info.nightscout.androidaps.plugins.pump.insight.events.EventLocalInsightUpdateGUI; -import info.nightscout.interfaces.queue.Callback; -import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.androidaps.utils.FabricPrivacy; -import info.nightscout.shared.interfaces.ResourceHelper; +import info.nightscout.interfaces.queue.Callback; import info.nightscout.rx.AapsSchedulers; +import info.nightscout.rx.bus.RxBus; +import info.nightscout.shared.interfaces.ResourceHelper; +import info.nightscout.shared.utils.DateUtil; import io.reactivex.rxjava3.disposables.CompositeDisposable; public class LocalInsightFragment extends DaggerFragment implements View.OnClickListener { @@ -305,7 +305,7 @@ public class LocalInsightFragment extends DaggerFragment implements View.OnClick private void getBaseBasalRateItem(List statusItems) { if (localInsightPlugin.getActiveBasalRate() == null) return; ActiveBasalRate activeBasalRate = localInsightPlugin.getActiveBasalRate(); - statusItems.add(getStatusItem(rh.gs(R.string.basebasalrate_label), + statusItems.add(getStatusItem(rh.gs(R.string.base_basal_rate_label), DecimalFormatter.INSTANCE.to2Decimal(activeBasalRate.getActiveBasalRate()) + " U/h (" + activeBasalRate.getActiveBasalProfileName() + ")")); } diff --git a/insight/src/main/res/values/strings.xml b/insight/src/main/res/values/strings.xml index b8bef8b2e9..ece7a4902a 100644 --- a/insight/src/main/res/values/strings.xml +++ b/insight/src/main/res/values/strings.xml @@ -11,7 +11,6 @@ Stop pump Started Stopped - Paused Operating mode Pump integration for Accu-Chek Insight pumps Not inserted diff --git a/interfaces/src/main/java/info/nightscout/interfaces/VirtualPump.kt b/interfaces/src/main/java/info/nightscout/interfaces/VirtualPump.kt new file mode 100644 index 0000000000..73506746e1 --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/VirtualPump.kt @@ -0,0 +1,5 @@ +package info.nightscout.interfaces + +interface VirtualPump { + var fakeDataDetected: Boolean +} \ No newline at end of file diff --git a/openhumans/src/main/res/values/strings.xml b/openhumans/src/main/res/values/strings.xml index 496a82e868..646ff82672 100644 --- a/openhumans/src/main/res/values/strings.xml +++ b/openhumans/src/main/res/values/strings.xml @@ -16,7 +16,6 @@ AAPS is uploading to Open Humans. This may take a while. You have been signed out of Open Humans Click here to sign in again if this wasn\'t on purpose. - Upload now Next Welcome to Open Humans To setup data upload, click \'Next\'. diff --git a/plugins/build.gradle b/plugins/build.gradle index 0a538ec21d..7d421bcb4f 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -22,4 +22,5 @@ dependencies { implementation project(':graphview') implementation project(':core') implementation project(':interfaces') + implementation project(':ns-sdk') } \ No newline at end of file diff --git a/plugins/src/main/AndroidManifest.xml b/plugins/src/main/AndroidManifest.xml index 58a76272b2..4f28ee4e97 100644 --- a/plugins/src/main/AndroidManifest.xml +++ b/plugins/src/main/AndroidManifest.xml @@ -6,6 +6,8 @@ + + + \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt rename to plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt index ceb1e700ce..55706a3a68 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt +++ b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.configBuilder +package info.nightscout.plugins.configBuilder import info.nightscout.androidaps.core.R import info.nightscout.androidaps.interfaces.ActivePlugin @@ -6,18 +6,18 @@ import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.sdk.remotemodel.RemoteDeviceStatus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/di/AutotuneModule.kt b/plugins/src/main/java/info/nightscout/plugins/di/AutotuneModule.kt index 36259705e0..7e0f512aaa 100644 --- a/plugins/src/main/java/info/nightscout/plugins/di/AutotuneModule.kt +++ b/plugins/src/main/java/info/nightscout/plugins/di/AutotuneModule.kt @@ -4,6 +4,7 @@ import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.plugins.general.autotune.AutotuneCore import info.nightscout.plugins.general.autotune.AutotuneFS +import info.nightscout.plugins.general.autotune.AutotuneFragment import info.nightscout.plugins.general.autotune.AutotuneIob import info.nightscout.plugins.general.autotune.AutotunePrep import info.nightscout.plugins.general.autotune.data.ATProfile @@ -14,6 +15,8 @@ import info.nightscout.plugins.general.autotune.data.PreppedGlucose @Module @Suppress("unused") abstract class AutotuneModule { + @ContributesAndroidInjector abstract fun contributesAutotuneFragment(): AutotuneFragment + @ContributesAndroidInjector abstract fun autoTunePrepInjector(): AutotunePrep @ContributesAndroidInjector abstract fun autoTuneIobInjector(): AutotuneIob @ContributesAndroidInjector abstract fun autoTuneCoreInjector(): AutotuneCore diff --git a/plugins/src/main/java/info/nightscout/plugins/di/PluginsModule.kt b/plugins/src/main/java/info/nightscout/plugins/di/PluginsModule.kt index 086dad48e1..57c9aae6e7 100644 --- a/plugins/src/main/java/info/nightscout/plugins/di/PluginsModule.kt +++ b/plugins/src/main/java/info/nightscout/plugins/di/PluginsModule.kt @@ -8,7 +8,10 @@ import dagger.Module FoodModule::class, SMSCommunicatorModule::class, AutotuneModule::class, - ProfileModule::class + ProfileModule::class, + SyncModule::class, + SourceModule::class, + VirtualPumpModule::class ] ) diff --git a/plugins/src/main/java/info/nightscout/plugins/di/SourceModule.kt b/plugins/src/main/java/info/nightscout/plugins/di/SourceModule.kt new file mode 100644 index 0000000000..3a64db284c --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/di/SourceModule.kt @@ -0,0 +1,15 @@ +package info.nightscout.plugins.di + +import dagger.Module +import dagger.android.ContributesAndroidInjector +import info.nightscout.plugins.source.BGSourceFragment +import info.nightscout.plugins.source.NSClientSourcePlugin + +@Module +@Suppress("unused") +abstract class SourceModule { + + @ContributesAndroidInjector abstract fun contributesBGSourceFragment(): BGSourceFragment + + @ContributesAndroidInjector abstract fun contributesNSClientSourceWorker(): NSClientSourcePlugin.NSClientSourceWorker +} \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/di/SyncModule.kt b/plugins/src/main/java/info/nightscout/plugins/di/SyncModule.kt new file mode 100644 index 0000000000..59b6d8d0e3 --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/di/SyncModule.kt @@ -0,0 +1,41 @@ +package info.nightscout.plugins.di + +import dagger.Module +import dagger.android.ContributesAndroidInjector +import info.nightscout.plugins.sync.nsShared.NSClientFragment +import info.nightscout.plugins.sync.nsShared.StoreDataForDb +import info.nightscout.plugins.sync.nsclient.services.NSClientService +import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker +import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker +import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker +import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker +import info.nightscout.plugins.sync.nsclientV3.workers.LoadBgWorker +import info.nightscout.plugins.sync.nsclientV3.workers.LoadDeviceStatusWorker +import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorker +import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker +import info.nightscout.plugins.sync.nsclientV3.workers.LoadTreatmentsWorker +import info.nightscout.plugins.sync.nsclientV3.workers.ProcessTreatmentsWorker +import info.nightscout.plugins.sync.tidepool.TidepoolFragment + +@Module +@Suppress("unused") +abstract class SyncModule { + + @ContributesAndroidInjector abstract fun contributesNSClientFragment(): NSClientFragment + + @ContributesAndroidInjector abstract fun contributesNSClientService(): NSClientService + @ContributesAndroidInjector abstract fun contributesNSClientWorker(): NSClientAddUpdateWorker + @ContributesAndroidInjector abstract fun contributesNSClientAddAckWorker(): NSClientAddAckWorker + @ContributesAndroidInjector abstract fun contributesNSClientUpdateRemoveAckWorker(): NSClientUpdateRemoveAckWorker + @ContributesAndroidInjector abstract fun contributesNSClientMbgWorker(): NSClientMbgWorker + + @ContributesAndroidInjector abstract fun contributesLoadStatusWorker(): LoadStatusWorker + @ContributesAndroidInjector abstract fun contributesLoadLastModificationWorker(): LoadLastModificationWorker + @ContributesAndroidInjector abstract fun contributesLoadBgWorker(): LoadBgWorker + @ContributesAndroidInjector abstract fun contributesStoreBgWorker(): StoreDataForDb.StoreBgWorker + @ContributesAndroidInjector abstract fun contributesTreatmentWorker(): LoadTreatmentsWorker + @ContributesAndroidInjector abstract fun contributesProcessTreatmentsWorker(): ProcessTreatmentsWorker + @ContributesAndroidInjector abstract fun contributesLoadDeviceStatusWorker(): LoadDeviceStatusWorker + + @ContributesAndroidInjector abstract fun contributesTidepoolFragment(): TidepoolFragment +} \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/di/VirtualPumpModule.kt b/plugins/src/main/java/info/nightscout/plugins/di/VirtualPumpModule.kt new file mode 100644 index 0000000000..6bff121485 --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/di/VirtualPumpModule.kt @@ -0,0 +1,12 @@ +package info.nightscout.plugins.di + +import dagger.Module +import dagger.android.ContributesAndroidInjector +import info.nightscout.plugins.pump.virtual.VirtualPumpFragment + +@Module +@Suppress("unused") +abstract class VirtualPumpModule { + + @ContributesAndroidInjector abstract fun contributesVirtualPumpFragment(): VirtualPumpFragment +} \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt index c0c314aed7..54b0bd1ca9 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt @@ -190,11 +190,11 @@ class FoodFragment : DaggerFragment() { holder.binding.name.text = food.name holder.binding.portion.text = food.portion.toString() + food.unit holder.binding.carbs.text = food.carbs.toString() + rh.gs(R.string.shortgramm) - holder.binding.fat.text = rh.gs(R.string.shortfat) + ": " + food.fat + rh.gs(R.string.shortgramm) + holder.binding.fat.text = rh.gs(R.string.short_fat) + ": " + food.fat + rh.gs(R.string.shortgramm) holder.binding.fat.visibility = food.fat.isNotZero().toVisibility() - holder.binding.protein.text = rh.gs(R.string.shortprotein) + ": " + food.protein + rh.gs(R.string.shortgramm) + holder.binding.protein.text = rh.gs(R.string.short_protein) + ": " + food.protein + rh.gs(R.string.shortgramm) holder.binding.protein.visibility = food.protein.isNotZero().toVisibility() - holder.binding.energy.text = rh.gs(R.string.shortenergy) + ": " + food.energy + rh.gs(R.string.shortkilojoul) + holder.binding.energy.text = rh.gs(R.string.short_energy) + ": " + food.energy + rh.gs(R.string.short_kilo_joul) holder.binding.energy.visibility = food.energy.isNotZero().toVisibility() holder.binding.icRemove.tag = food holder.binding.icCalculator.tag = food diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/DismissNotificationService.kt b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/DismissNotificationService.kt similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/DismissNotificationService.kt rename to plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/DismissNotificationService.kt index ec0a87162d..6f1e4f6ba3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/DismissNotificationService.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/DismissNotificationService.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.notifications +package info.nightscout.plugins.general.overview.notifications import android.content.Intent import dagger.android.DaggerIntentService diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt rename to plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt index 787d988091..105682c734 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.notifications +package info.nightscout.plugins.general.overview.notifications import android.app.NotificationChannel import android.app.NotificationManager @@ -12,19 +12,19 @@ import android.view.View import android.view.ViewGroup import androidx.core.app.NotificationCompat import androidx.recyclerview.widget.RecyclerView -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.OverviewNotificationItemBinding import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IconsProvider -import info.nightscout.interfaces.NotificationHolder -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.notifications.Notification +import info.nightscout.plugins.R +import info.nightscout.plugins.databinding.OverviewNotificationItemBinding +import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import java.util.Collections import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationWithAction.kt similarity index 84% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt rename to plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationWithAction.kt index 2c8bd8c49a..1e475059d1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationWithAction.kt @@ -1,16 +1,16 @@ -package info.nightscout.androidaps.plugins.general.overview.notifications +package info.nightscout.plugins.general.overview.notifications import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSAlarm import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.shared.utils.T import info.nightscout.interfaces.notifications.Notification +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.nsclient.NSClientPlugin +import info.nightscout.plugins.sync.nsclient.data.NSAlarm import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.T import javax.inject.Inject @Suppress("SpellCheckingInspection") @@ -64,9 +64,9 @@ class NotificationWithAction constructor( nsClientPlugin.handleClearAlarm(nsAlarm, 60 * 60 * 1000L) // Adding current time to snooze if we got staleData aapsLogger.debug(LTag.NOTIFICATION, "Notification text is: $text") - val msToSnooze = sp.getInt(R.string.key_nsalarm_staledatavalue, 15) * 60 * 1000L + val msToSnooze = sp.getInt(R.string.key_ns_alarm_stale_data_value, 15) * 60 * 1000L aapsLogger.debug(LTag.NOTIFICATION, "snooze nsalarm_staledatavalue in minutes is ${T.msecs(msToSnooze).mins()} currentTimeMillis is: ${System.currentTimeMillis()}") - sp.putLong(R.string.key_snoozedTo, System.currentTimeMillis() + msToSnooze) + sp.putLong(R.string.key_snoozed_to, System.currentTimeMillis() + msToSnooze) } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventUpdateOverviewNotification.kt b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/events/EventUpdateOverviewNotification.kt similarity index 60% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventUpdateOverviewNotification.kt rename to plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/events/EventUpdateOverviewNotification.kt index f20816c0d7..5b12aea539 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventUpdateOverviewNotification.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/events/EventUpdateOverviewNotification.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.overview.events +package info.nightscout.plugins.general.overview.notifications.events import info.nightscout.rx.events.Event diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index edf1532d2d..46bcced601 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -158,23 +158,23 @@ class SmsCommunicatorPlugin @Inject constructor( val allowedNumbers = preferenceFragment.findPreference(rh.gs(R.string.key_smscommunicator_allowednumbers)) as EditTextPreference? ?: return if (!areMoreNumbers(allowedNumbers.text)) { - distance.title = (rh.gs(R.string.smscommunicator_remotebolusmindistance) + distance.title = (rh.gs(R.string.smscommunicator_remote_bolus_min_distance) + ".\n" - + rh.gs(R.string.smscommunicator_remotebolusmindistance_caveat)) + + rh.gs(R.string.smscommunicator_remote_bolus_min_distance_caveat)) distance.isEnabled = false } else { - distance.title = rh.gs(R.string.smscommunicator_remotebolusmindistance) + distance.title = rh.gs(R.string.smscommunicator_remote_bolus_min_distance) distance.isEnabled = true } allowedNumbers.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any -> if (!areMoreNumbers(newValue as String)) { distance.text = (Constants.remoteBolusMinDistance / (60 * 1000L)).toString() - distance.title = (rh.gs(R.string.smscommunicator_remotebolusmindistance) + distance.title = (rh.gs(R.string.smscommunicator_remote_bolus_min_distance) + ".\n" - + rh.gs(R.string.smscommunicator_remotebolusmindistance_caveat)) + + rh.gs(R.string.smscommunicator_remote_bolus_min_distance_caveat)) distance.isEnabled = false } else { - distance.title = rh.gs(R.string.smscommunicator_remotebolusmindistance) + distance.title = rh.gs(R.string.smscommunicator_remote_bolus_min_distance) distance.isEnabled = true } true @@ -275,7 +275,7 @@ class SmsCommunicatorPlugin @Inject constructor( else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "LOOP" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size == 2 || divided.size == 3) processLOOP(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) @@ -284,50 +284,50 @@ class SmsCommunicatorPlugin @Inject constructor( else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "PUMP" -> - if (!remoteCommandsAllowed && divided.size > 1) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed && divided.size > 1) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size <= 3) processPUMP(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "PROFILE" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size == 2 || divided.size == 3) processPROFILE(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "BASAL" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size == 2 || divided.size == 3) processBASAL(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "EXTENDED" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size == 2 || divided.size == 3) processEXTENDED(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "BOLUS" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (commandQueue.bolusInQueue()) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_another_bolus_in_queue))) - else if (divided.size == 2 && dateUtil.now() - lastRemoteBolusTime < minDistance) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotebolusnotallowed))) + else if (divided.size == 2 && dateUtil.now() - lastRemoteBolusTime < minDistance) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_bolus_not_allowed))) else if (divided.size == 2 && pump.isSuspended()) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.pumpsuspended))) else if (divided.size == 2 || divided.size == 3) processBOLUS(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "CARBS" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size == 2 || divided.size == 3) processCARBS(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "CAL" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size == 2) processCAL(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "TARGET" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size == 2) processTARGET(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) "SMS" -> - if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remotecommandnotallowed))) + if (!remoteCommandsAllowed) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_remote_command_not_allowed))) else if (divided.size == 2) processSMS(divided, receivedSms) else sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) @@ -342,7 +342,7 @@ class SmsCommunicatorPlugin @Inject constructor( execute?.action(divided[0]) } else { messageToConfirm = null - sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_unknowncommand))) + sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_unknown_command))) } } } @@ -379,7 +379,7 @@ class SmsCommunicatorPlugin @Inject constructor( "DISABLE", "STOP" -> { if (loop.enabled) { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_loopdisablereplywithcode, passCode) + val reply = rh.gs(R.string.smscommunicator_loop_disable_reply_with_code, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) { override fun run() { @@ -388,8 +388,8 @@ class SmsCommunicatorPlugin @Inject constructor( commandQueue.cancelTempBasal(true, object : Callback() { override fun run() { rxBus.send(EventRefreshOverview("SMS_LOOP_STOP")) - val replyText = rh.gs(R.string.smscommunicator_loophasbeendisabled) + " " + - rh.gs(if (result.success) R.string.smscommunicator_tempbasalcanceled else R.string.smscommunicator_tempbasalcancelfailed) + val replyText = rh.gs(R.string.smscommunicator_loop_has_been_disabled) + " " + + rh.gs(if (result.success) R.string.smscommunicator_tempbasal_canceled else R.string.smscommunicator_tempbasal_cancel_failed) sendSMS(Sms(receivedSms.phoneNumber, replyText)) } }) @@ -403,25 +403,25 @@ class SmsCommunicatorPlugin @Inject constructor( "ENABLE", "START" -> { if (!loop.enabled) { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_loopenablereplywithcode, passCode) + val reply = rh.gs(R.string.smscommunicator_loop_enable_reply_with_code, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) { override fun run() { uel.log(Action.LOOP_ENABLED, Sources.SMS) loop.enabled = true - sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loophasbeenenabled))) + sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loop_has_been_enabled))) rxBus.send(EventRefreshOverview("SMS_LOOP_START")) } }) } else - sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loopisenabled))) + sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loop_is_enabled))) receivedSms.processed = true } "STATUS" -> { val reply = if (loop.enabled) { if (loop.isSuspended) rh.gs(R.string.sms_loop_suspended_for, loop.minutesToEndOfSuspend()) - else rh.gs(R.string.smscommunicator_loopisenabled) + else rh.gs(R.string.smscommunicator_loop_is_enabled) } else rh.gs(R.string.loopisdisabled) sendSMS(Sms(receivedSms.phoneNumber, reply)) @@ -430,7 +430,7 @@ class SmsCommunicatorPlugin @Inject constructor( "RESUME" -> { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_loopresumereplywithcode, passCode) + val reply = rh.gs(R.string.smscommunicator_loop_resume_reply_with_code, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) { override fun run() { @@ -445,13 +445,13 @@ class SmsCommunicatorPlugin @Inject constructor( commandQueue.cancelTempBasal(true, object : Callback() { override fun run() { if (!result.success) { - var replyText = rh.gs(R.string.smscommunicator_tempbasalfailed) + var replyText = rh.gs(R.string.smscommunicator_tempbasal_failed) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) } } }) - sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loopresumed))) + sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_loop_resumed))) } }) } @@ -463,11 +463,11 @@ class SmsCommunicatorPlugin @Inject constructor( duration = min(180, duration) if (duration == 0) { receivedSms.processed = true - sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_wrongduration))) + sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_wrong_duration))) return } else { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_suspendreplywithcode, duration, passCode) + val reply = rh.gs(R.string.smscommunicator_suspend_reply_with_code, duration, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, duration) { override fun run() { @@ -489,11 +489,11 @@ class SmsCommunicatorPlugin @Inject constructor( aapsLogger.error(LTag.DATABASE, "Error while saving OfflineEvent", it) }) rxBus.send(EventRefreshOverview("SMS_LOOP_SUSPENDED")) - val replyText = rh.gs(R.string.smscommunicator_loopsuspended) + " " + - rh.gs(if (result.success) R.string.smscommunicator_tempbasalcanceled else R.string.smscommunicator_tempbasalcancelfailed) + val replyText = rh.gs(R.string.smscommunicator_loop_suspended) + " " + + rh.gs(if (result.success) R.string.smscommunicator_tempbasal_canceled else R.string.smscommunicator_tempbasal_cancel_failed) sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) } else { - var replyText = rh.gs(R.string.smscommunicator_tempbasalcancelfailed) + var replyText = rh.gs(R.string.smscommunicator_tempbasal_cancel_failed) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) } @@ -552,7 +552,7 @@ class SmsCommunicatorPlugin @Inject constructor( receivedSms.processed = true } else if ((divided.size == 2) && (divided[1].equals("CONNECT", ignoreCase = true))) { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_pumpconnectwithcode, passCode) + val reply = rh.gs(R.string.smscommunicator_pump_connect_with_code, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) { override fun run() { @@ -560,7 +560,7 @@ class SmsCommunicatorPlugin @Inject constructor( commandQueue.cancelTempBasal(true, object : Callback() { override fun run() { if (!result.success) { - sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_pumpconnectfail))) + sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_pump_connect_fail))) } else { disposable += repository.runTransactionForResult(CancelCurrentOfflineEventIfAnyTransaction(dateUtil.now())) .subscribe({ result -> @@ -581,11 +581,11 @@ class SmsCommunicatorPlugin @Inject constructor( duration = min(120, duration) if (duration == 0) { receivedSms.processed = true - sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_wrongduration))) + sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_wrong_duration))) return } else { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_pumpdisconnectwithcode, duration, passCode) + val reply = rh.gs(R.string.smscommunicator_pump_disconnect_with_code, duration, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) { override fun run() { @@ -593,7 +593,7 @@ class SmsCommunicatorPlugin @Inject constructor( val profile = profileFunction.getProfile() ?: return loop.goToZeroTemp(duration, profile, OfflineEvent.Reason.DISCONNECT_PUMP) rxBus.send(EventRefreshOverview("SMS_PUMP_DISCONNECT")) - sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_pumpdisconnected))) + sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.smscommunicator_pump_disconnected))) } }) } @@ -638,7 +638,7 @@ class SmsCommunicatorPlugin @Inject constructor( if (profile == null) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.noprofile))) else { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_profilereplywithcode, list[pIndex - 1], percentage, passCode) + val reply = rh.gs(R.string.smscommunicator_profile_reply_with_code, list[pIndex - 1], percentage, passCode) receivedSms.processed = true val finalPercentage = percentage messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, list[pIndex - 1] as String, finalPercentage) { @@ -664,27 +664,27 @@ class SmsCommunicatorPlugin @Inject constructor( private fun processBASAL(divided: Array, receivedSms: Sms) { if (divided[1].uppercase(Locale.getDefault()) == "CANCEL" || divided[1].uppercase(Locale.getDefault()) == "STOP") { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_basalstopreplywithcode, passCode) + val reply = rh.gs(R.string.smscommunicator_basal_stop_reply_with_code, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) { override fun run() { commandQueue.cancelTempBasal(true, object : Callback() { override fun run() { if (result.success) { - var replyText = rh.gs(R.string.smscommunicator_tempbasalcanceled) + var replyText = rh.gs(R.string.smscommunicator_tempbasal_canceled) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalcanceled), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasalcanceled)) + Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_canceled), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_canceled)) ) } else { - var replyText = rh.gs(R.string.smscommunicator_tempbasalcancelfailed) + var replyText = rh.gs(R.string.smscommunicator_tempbasal_cancel_failed) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalcancelfailed), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasalcancelfailed)) + Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_cancel_failed), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_cancel_failed)) ) } } @@ -703,7 +703,7 @@ class SmsCommunicatorPlugin @Inject constructor( else { tempBasalPct = constraintChecker.applyBasalPercentConstraints(Constraint(tempBasalPct), profile).value() val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_basalpctreplywithcode, tempBasalPct, duration, passCode) + val reply = rh.gs(R.string.smscommunicator_basal_pct_reply_with_code, tempBasalPct, duration, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, tempBasalPct, duration) { override fun run() { @@ -711,8 +711,8 @@ class SmsCommunicatorPlugin @Inject constructor( override fun run() { if (result.success) { var replyText = - if (result.isPercent) rh.gs(R.string.smscommunicator_tempbasalset_percent, result.percent, result.duration) else rh.gs( - R.string.smscommunicator_tempbasalset, + if (result.isPercent) rh.gs(R.string.smscommunicator_tempbasal_set_percent, result.percent, result.duration) else rh.gs( + R.string.smscommunicator_tempbasal_set, result.absolute, result.duration ) @@ -721,24 +721,24 @@ class SmsCommunicatorPlugin @Inject constructor( if (result.isPercent) uel.log( Action.TEMP_BASAL, Sources.SMS, - activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalset_percent, result.percent, result.duration), + activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_set_percent, result.percent, result.duration), ValueWithUnit.Percent(result.percent), ValueWithUnit.Minute(result.duration) ) else uel.log( Action.TEMP_BASAL, Sources.SMS, - activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalset, result.absolute, result.duration), + activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_set, result.absolute, result.duration), ValueWithUnit.UnitPerHour(result.absolute), ValueWithUnit.Minute(result.duration) ) } else { - var replyText = rh.gs(R.string.smscommunicator_tempbasalfailed) + var replyText = rh.gs(R.string.smscommunicator_tempbasal_failed) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalfailed), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasalfailed)) + Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_failed), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_failed)) ) } } @@ -758,22 +758,22 @@ class SmsCommunicatorPlugin @Inject constructor( else { tempBasal = constraintChecker.applyBasalConstraints(Constraint(tempBasal), profile).value() val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_basalreplywithcode, tempBasal, duration, passCode) + val reply = rh.gs(R.string.smscommunicator_basal_reply_with_code, tempBasal, duration, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, tempBasal, duration) { override fun run() { commandQueue.tempBasalAbsolute(aDouble(), secondInteger(), true, profile, PumpSync.TemporaryBasalType.NORMAL, object : Callback() { override fun run() { if (result.success) { - var replyText = if (result.isPercent) rh.gs(R.string.smscommunicator_tempbasalset_percent, result.percent, result.duration) - else rh.gs(R.string.smscommunicator_tempbasalset, result.absolute, result.duration) + var replyText = if (result.isPercent) rh.gs(R.string.smscommunicator_tempbasal_set_percent, result.percent, result.duration) + else rh.gs(R.string.smscommunicator_tempbasal_set, result.absolute, result.duration) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) if (result.isPercent) uel.log( Action.TEMP_BASAL, Sources.SMS, - activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalset_percent, result.percent, result.duration), + activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_set_percent, result.percent, result.duration), ValueWithUnit.Percent(result.percent), ValueWithUnit.Minute(result.duration) ) @@ -781,17 +781,17 @@ class SmsCommunicatorPlugin @Inject constructor( uel.log( Action.TEMP_BASAL, Sources.SMS, - activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalset, result.absolute, result.duration), + activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_set, result.absolute, result.duration), ValueWithUnit.UnitPerHour(result.absolute), ValueWithUnit.Minute(result.duration) ) } else { - var replyText = rh.gs(R.string.smscommunicator_tempbasalfailed) + var replyText = rh.gs(R.string.smscommunicator_tempbasal_failed) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasalfailed), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasalfailed)) + Action.TEMP_BASAL, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_tempbasal_failed), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_failed)) ) } } @@ -805,23 +805,23 @@ class SmsCommunicatorPlugin @Inject constructor( private fun processEXTENDED(divided: Array, receivedSms: Sms) { if (divided[1].uppercase(Locale.getDefault()) == "CANCEL" || divided[1].uppercase(Locale.getDefault()) == "STOP") { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_extendedstopreplywithcode, passCode) + val reply = rh.gs(R.string.smscommunicator_extended_stop_reply_with_code, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true) { override fun run() { commandQueue.cancelExtended(object : Callback() { override fun run() { if (result.success) { - var replyText = rh.gs(R.string.smscommunicator_extendedcanceled) + var replyText = rh.gs(R.string.smscommunicator_extended_canceled) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) } else { - var replyText = rh.gs(R.string.smscommunicator_extendedcancelfailed) + var replyText = rh.gs(R.string.smscommunicator_extended_cancel_failed) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extendedcanceled), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_extendedcanceled)) + Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extended_canceled), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_extended_canceled)) ) } } @@ -837,14 +837,14 @@ class SmsCommunicatorPlugin @Inject constructor( if (extended == 0.0 || duration == 0) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) else { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_extendedreplywithcode, extended, duration, passCode) + val reply = rh.gs(R.string.smscommunicator_extended_reply_with_code, extended, duration, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, extended, duration) { override fun run() { commandQueue.extendedBolus(aDouble(), secondInteger(), object : Callback() { override fun run() { if (result.success) { - var replyText = rh.gs(R.string.smscommunicator_extendedset, aDouble, duration) + var replyText = rh.gs(R.string.smscommunicator_extended_set, aDouble, duration) if (config.APS) replyText += "\n" + rh.gs(R.string.loopsuspended) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) @@ -852,24 +852,24 @@ class SmsCommunicatorPlugin @Inject constructor( uel.log( Action.EXTENDED_BOLUS, Sources.SMS, - activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extendedset, aDouble, duration) + " / " + rh.gs(R.string.loopsuspended), + activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extended_set, aDouble, duration) + " / " + rh.gs(R.string.loopsuspended), ValueWithUnit.Insulin(aDouble ?: 0.0), ValueWithUnit.Minute(duration), ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.loopsuspended)) ) else uel.log( - Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extendedset, aDouble, duration), + Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extended_set, aDouble, duration), ValueWithUnit.Insulin(aDouble ?: 0.0), ValueWithUnit.Minute(duration) ) } else { - var replyText = rh.gs(R.string.smscommunicator_extendedfailed) + var replyText = rh.gs(R.string.smscommunicator_extended_failed) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extendedfailed), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_extendedfailed)) + Action.EXTENDED_BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_extended_failed), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_extended_failed)) ) } } @@ -905,9 +905,9 @@ class SmsCommunicatorPlugin @Inject constructor( override fun run() { if (resultSuccess) { var replyText = if (isMeal) - rh.gs(R.string.smscommunicator_mealbolusdelivered, resultBolusDelivered) + rh.gs(R.string.smscommunicator_meal_bolus_delivered, resultBolusDelivered) else - rh.gs(R.string.smscommunicator_bolusdelivered, resultBolusDelivered) + rh.gs(R.string.smscommunicator_bolus_delivered, resultBolusDelivered) replyText += "\n" + activePlugin.activePump.shortStatus(true) lastRemoteBolusTime = dateUtil.now() if (isMeal) { @@ -944,18 +944,18 @@ class SmsCommunicatorPlugin @Inject constructor( val tt = if (currentProfile.units == GlucoseUnit.MMOL) { DecimalFormatter.to1Decimal(eatingSoonTT) } else DecimalFormatter.to0Decimal(eatingSoonTT) - replyText += "\n" + rh.gs(R.string.smscommunicator_mealbolusdelivered_tt, tt, eatingSoonTTDuration) + replyText += "\n" + rh.gs(R.string.smscommunicator_meal_bolus_delivered_tt, tt, eatingSoonTTDuration) } } sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) uel.log(Action.BOLUS, Sources.SMS, replyText) } else { - var replyText = rh.gs(R.string.smscommunicator_bolusfailed) + var replyText = rh.gs(R.string.smscommunicator_bolus_failed) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_bolusfailed), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_bolusfailed)) + Action.BOLUS, Sources.SMS, activePlugin.activePump.shortStatus(true) + "\n" + rh.gs(R.string.smscommunicator_bolus_failed), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_bolus_failed)) ) } } @@ -1000,7 +1000,7 @@ class SmsCommunicatorPlugin @Inject constructor( if (grams == 0) sendSMS(Sms(receivedSms.phoneNumber, rh.gs(R.string.wrong_format))) else { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_carbsreplywithcode, grams, dateUtil.timeString(time), passCode) + val reply = rh.gs(R.string.smscommunicator_carbs_reply_with_code, grams, dateUtil.timeString(time), passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = true, grams, time) { override fun run() { @@ -1010,19 +1010,19 @@ class SmsCommunicatorPlugin @Inject constructor( commandQueue.bolus(detailedBolusInfo, object : Callback() { override fun run() { if (result.success) { - var replyText = rh.gs(R.string.smscommunicator_carbsset, anInteger) + var replyText = rh.gs(R.string.smscommunicator_carbs_set, anInteger) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true) + ": " + rh.gs(R.string.smscommunicator_carbsset, anInteger), + Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true) + ": " + rh.gs(R.string.smscommunicator_carbs_set, anInteger), ValueWithUnit.Gram(anInteger ?: 0) ) } else { - var replyText = rh.gs(R.string.smscommunicator_carbsfailed, anInteger) + var replyText = rh.gs(R.string.smscommunicator_carbs_failed, anInteger) replyText += "\n" + activePlugin.activePump.shortStatus(true) sendSMS(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true) + ": " + rh.gs(R.string.smscommunicator_carbsfailed, anInteger), + Action.CARBS, Sources.SMS, activePlugin.activePump.shortStatus(true) + ": " + rh.gs(R.string.smscommunicator_carbs_failed, anInteger), ValueWithUnit.Gram(anInteger ?: 0) ) } @@ -1040,7 +1040,7 @@ class SmsCommunicatorPlugin @Inject constructor( val isStop = divided[1].equals("STOP", ignoreCase = true) || divided[1].equals("CANCEL", ignoreCase = true) if (isMeal || isActivity || isHypo) { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_temptargetwithcode, divided[1].uppercase(Locale.getDefault()), passCode) + val reply = rh.gs(R.string.smscommunicator_temptarget_with_code, divided[1].uppercase(Locale.getDefault()), passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) { override fun run() { @@ -1110,7 +1110,7 @@ class SmsCommunicatorPlugin @Inject constructor( }) } else if (isStop) { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_temptargetcancel, passCode) + val reply = rh.gs(R.string.smscommunicator_temptarget_cancel, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) { override fun run() { @@ -1137,16 +1137,16 @@ class SmsCommunicatorPlugin @Inject constructor( || divided[1].equals("DISABLE", ignoreCase = true)) if (isStop) { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_stopsmswithcode, passCode) + val reply = rh.gs(R.string.smscommunicator_stops_ns_with_code, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false) { override fun run() { sp.putBoolean(R.string.key_smscommunicator_remote_commands_allowed, false) - val replyText = rh.gs(R.string.smscommunicator_stoppedsms) + val replyText = rh.gs(R.string.smscommunicator_stopped_sms) sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) uel.log( - Action.STOP_SMS, Sources.SMS, rh.gs(R.string.smscommunicator_stoppedsms), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_stoppedsms)) + Action.STOP_SMS, Sources.SMS, rh.gs(R.string.smscommunicator_stopped_sms), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_stopped_sms)) ) } }) @@ -1157,23 +1157,23 @@ class SmsCommunicatorPlugin @Inject constructor( val cal = SafeParse.stringToDouble(divided[1]) if (cal > 0.0) { val passCode = generatePassCode() - val reply = rh.gs(R.string.smscommunicator_calibrationreplywithcode, cal, passCode) + val reply = rh.gs(R.string.smscommunicator_calibration_reply_with_code, cal, passCode) receivedSms.processed = true messageToConfirm = AuthRequest(injector, receivedSms, reply, passCode, object : SmsAction(pumpCommand = false, cal) { override fun run() { val result = xDripBroadcast.sendCalibration(aDouble!!) val replyText = - if (result) rh.gs(R.string.smscommunicator_calibrationsent) else rh.gs(R.string.smscommunicator_calibrationfailed) + if (result) rh.gs(R.string.smscommunicator_calibration_sent) else rh.gs(R.string.smscommunicator_calibration_failed) sendSMSToAllNumbers(Sms(receivedSms.phoneNumber, replyText)) if (result) uel.log( - Action.CALIBRATION, Sources.SMS, rh.gs(R.string.smscommunicator_calibrationsent), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_calibrationsent)) + Action.CALIBRATION, Sources.SMS, rh.gs(R.string.smscommunicator_calibration_sent), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_calibration_sent)) ) else uel.log( - Action.CALIBRATION, Sources.SMS, rh.gs(R.string.smscommunicator_calibrationfailed), - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_calibrationfailed)) + Action.CALIBRATION, Sources.SMS, rh.gs(R.string.smscommunicator_calibration_failed), + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.smscommunicator_calibration_failed)) ) } }) @@ -1210,11 +1210,11 @@ class SmsCommunicatorPlugin @Inject constructor( messages.add(sms) } catch (e: IllegalArgumentException) { return if (e.message == "Invalid message body") { - val notification = Notification(Notification.INVALID_MESSAGE_BODY, rh.gs(R.string.smscommunicator_messagebody), Notification.NORMAL) + val notification = Notification(Notification.INVALID_MESSAGE_BODY, rh.gs(R.string.smscommunicator_message_body), Notification.NORMAL) rxBus.send(EventNewNotification(notification)) false } else { - val notification = Notification(Notification.INVALID_PHONE_NUMBER, rh.gs(R.string.smscommunicator_invalidphonennumber), Notification.NORMAL) + val notification = Notification(Notification.INVALID_PHONE_NUMBER, rh.gs(R.string.smscommunicator_invalid_phone_number), Notification.NORMAL) rxBus.send(EventNewNotification(notification)) false } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpFragment.kt similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt rename to plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpFragment.kt index dd1af9d626..25234cee59 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.virtual +package info.nightscout.plugins.pump.virtual import android.os.Bundle import android.os.Handler @@ -7,20 +7,20 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.VirtualpumpFragmentBinding import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T +import info.nightscout.plugins.R +import info.nightscout.plugins.databinding.VirtualPumpFragmentBinding +import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.events.EventTempBasalChange +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -41,14 +41,14 @@ class VirtualPumpFragment : DaggerFragment() { private lateinit var refreshLoop: Runnable private var handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper) - private var _binding: VirtualpumpFragmentBinding? = null + private var _binding: VirtualPumpFragmentBinding? = null // This property is only valid between onCreateView and // onDestroyView. private val binding get() = _binding!! override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View = - VirtualpumpFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root + VirtualPumpFragmentBinding.inflate(inflater, container, false).also { _binding = it }.root @Synchronized override fun onResume() { @@ -90,7 +90,7 @@ class VirtualPumpFragment : DaggerFragment() { private fun updateGui() { if (_binding == null) return val profile = profileFunction.getProfile() ?: return - binding.basabasalrate.text = rh.gs(R.string.pump_basebasalrate, virtualPumpPlugin.baseBasalRate) + binding.baseBasalRate.text = rh.gs(R.string.pump_basebasalrate, virtualPumpPlugin.baseBasalRate) binding.tempbasal.text = iobCobCalculator.getTempBasal(dateUtil.now())?.toStringFull(profile, dateUtil) ?: "" binding.extendedbolus.text = iobCobCalculator.getExtendedBolus(dateUtil.now())?.toStringFull(dateUtil) @@ -102,7 +102,7 @@ class VirtualPumpFragment : DaggerFragment() { val pumpType = virtualPumpPlugin.pumpType binding.type.text = pumpType?.description - binding.typeDef.text = pumpType?.getFullDescription(rh.gs(R.string.virtualpump_pump_def), pumpType.hasExtendedBasals(), rh) + binding.typeDef.text = pumpType?.getFullDescription(rh.gs(R.string.virtual_pump_pump_def), pumpType.hasExtendedBasals(), rh) binding.serialNumber.text = virtualPumpPlugin.serialNumber() } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt index d7b24cabcb..5dad72b728 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -1,45 +1,46 @@ -package info.nightscout.androidaps.plugins.pump.virtual +package info.nightscout.plugins.pump.virtual import android.os.SystemClock import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.InstanceId -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.VirtualPump +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.interfaces.utils.TimeChangeType +import info.nightscout.plugins.R +import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONException @@ -68,14 +69,14 @@ open class VirtualPumpPlugin @Inject constructor( .mainType(PluginType.PUMP) .fragmentClass(VirtualPumpFragment::class.java.name) .pluginIcon(R.drawable.ic_virtual_pump) - .pluginName(R.string.virtualpump) - .shortName(R.string.virtualpump_shortname) - .preferencesId(R.xml.pref_virtualpump) + .pluginName(R.string.virtual_pump) + .shortName(R.string.virtual_pump_shortname) + .preferencesId(R.xml.pref_virtual_pump) .description(R.string.description_pump_virtual) .setDefault() .neverVisible(config.NSCLIENT), injector, aapsLogger, rh, commandQueue -), Pump { +), Pump, VirtualPump { private val disposable = CompositeDisposable() var batteryPercent = 50 @@ -123,14 +124,14 @@ open class VirtualPumpPlugin @Inject constructor( override fun preprocessPreferences(preferenceFragment: PreferenceFragmentCompat) { super.preprocessPreferences(preferenceFragment) - val uploadStatus = preferenceFragment.findPreference(rh.gs(R.string.key_virtualpump_uploadstatus)) as SwitchPreference? + val uploadStatus = preferenceFragment.findPreference(rh.gs(R.string.key_virtual_pump_upload_status)) as SwitchPreference? ?: return uploadStatus.isVisible = !config.NSCLIENT } override val isFakingTempsByExtendedBoluses: Boolean get() = config.NSCLIENT && fakeDataDetected - var fakeDataDetected = false + override var fakeDataDetected = false override fun loadTDDs(): PumpEnactResult { //no result, could read DB in the future? return PumpEnactResultImpl(injector) @@ -340,7 +341,7 @@ open class VirtualPumpPlugin @Inject constructor( override fun getJSONStatus(profile: Profile, profileName: String, version: String): JSONObject { val now = System.currentTimeMillis() - if (!sp.getBoolean(R.string.key_virtualpump_uploadstatus, false)) { + if (!sp.getBoolean(R.string.key_virtual_pump_upload_status, false)) { return JSONObject() } val pump = JSONObject() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/events/EventVirtualPumpUpdateGui.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/events/EventVirtualPumpUpdateGui.kt similarity index 61% rename from app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/events/EventVirtualPumpUpdateGui.kt rename to plugins/src/main/java/info/nightscout/plugins/pump/virtual/events/EventVirtualPumpUpdateGui.kt index b5f08f2b2f..55457db925 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/events/EventVirtualPumpUpdateGui.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/events/EventVirtualPumpUpdateGui.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.virtual.events +package info.nightscout.plugins.pump.virtual.events import info.nightscout.rx.events.EventUpdateGui diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt rename to plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt index e155dd9bd3..f4605abc85 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.source +package info.nightscout.plugins.source import android.os.Bundle import android.util.SparseArray @@ -14,33 +14,33 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction -import info.nightscout.androidaps.databinding.BgsourceFragmentBinding -import info.nightscout.androidaps.databinding.BgsourceItemBinding import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.extensions.directionToIcon -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.plugins.R +import info.nightscout.plugins.databinding.SourceFragmentBinding +import info.nightscout.plugins.databinding.SourceItemBinding import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit @@ -62,13 +62,13 @@ class BGSourceFragment : DaggerFragment(), MenuProvider { private val disposable = CompositeDisposable() private val millsToThePast = T.hours(36).msecs() private lateinit var actionHelper: ActionModeHelper - private var _binding: BgsourceFragmentBinding? = null + private var _binding: SourceFragmentBinding? = null // This property is only valid between onCreateView and onDestroyView. private val binding get() = _binding!! override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View = - BgsourceFragmentBinding.inflate(inflater, container, false).also { + SourceFragmentBinding.inflate(inflater, container, false).also { _binding = it actionHelper = ActionModeHelper(rh, activity, this) actionHelper.setUpdateListHandler { binding.recyclerview.adapter?.notifyDataSetChanged() } @@ -130,7 +130,7 @@ class BGSourceFragment : DaggerFragment(), MenuProvider { inner class RecyclerViewAdapter internal constructor(private var glucoseValues: List) : RecyclerView.Adapter() { override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): GlucoseValuesViewHolder { - val v = LayoutInflater.from(viewGroup.context).inflate(R.layout.bgsource_item, viewGroup, false) + val v = LayoutInflater.from(viewGroup.context).inflate(R.layout.source_item, viewGroup, false) return GlucoseValuesViewHolder(v) } @@ -176,7 +176,7 @@ class BGSourceFragment : DaggerFragment(), MenuProvider { inner class GlucoseValuesViewHolder(view: View) : RecyclerView.ViewHolder(view) { - val binding = BgsourceItemBinding.bind(view) + val binding = SourceItemBinding.bind(view) } } @@ -195,13 +195,13 @@ class BGSourceFragment : DaggerFragment(), MenuProvider { val source = when ((activePlugin.activeBgSource as PluginBase).pluginDescription.pluginName) { R.string.dexcom_app_patched -> Sources.Dexcom R.string.eversense -> Sources.Eversense - R.string.Glimp -> Sources.Glimp - R.string.MM640g -> Sources.MM640g - R.string.nsclientbg -> Sources.NSClientSource + R.string.glimp -> Sources.Glimp + R.string.mm640g -> Sources.MM640g + R.string.ns_client_bg -> Sources.NSClientSource R.string.poctech -> Sources.PocTech R.string.tomato -> Sources.Tomato R.string.glunovo -> Sources.Glunovo - R.string.intelligo -> Sources.Intelligo + R.string.intelligo -> Sources.Intelligo R.string.xdrip -> Sources.Xdrip R.string.aidex -> Sources.Aidex else -> Sources.Unknown diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt index bf803033aa..5cfd4cb35b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt @@ -1,34 +1,34 @@ -package info.nightscout.androidaps.plugins.source +package info.nightscout.plugins.source import android.content.Context import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification -import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSgv import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.nsShared.StoreDataForDb +import info.nightscout.plugins.sync.nsclient.data.NSSgv import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.sdk.localmodel.entry.NSSgvV3 +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject @@ -45,8 +45,8 @@ class NSClientSourcePlugin @Inject constructor( .mainType(PluginType.BGSOURCE) .fragmentClass(BGSourceFragment::class.java.name) .pluginIcon(R.drawable.ic_nsclient_bg) - .pluginName(R.string.nsclientbg) - .shortName(R.string.nsclientbgshort) + .pluginName(R.string.ns_client_bg) + .shortName(R.string.ns_client_bg_short) .description(R.string.description_source_ns_client), aapsLogger, rh, injector ), BgSource { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt similarity index 86% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index 4e1f003f0e..e2bb2515c3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsShared +package info.nightscout.plugins.sync.nsShared import android.os.Bundle import android.os.Handler @@ -13,24 +13,25 @@ import android.widget.ScrollView import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.databinding.NsClientFragmentBinding import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.PluginFragment -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.interfaces.BuildHelper +import info.nightscout.plugins.R +import info.nightscout.plugins.databinding.NsClientFragmentBinding +import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI +import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventNSClientRestart import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign @@ -47,6 +48,7 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment { @Inject lateinit var uel: UserEntryLogger @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var activePlugin: ActivePlugin + @Inject lateinit var buildHelper: BuildHelper companion object { @@ -80,13 +82,13 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - binding.autoscroll.isChecked = sp.getBoolean(R.string.key_nsclientinternal_autoscroll, true) + binding.autoscroll.isChecked = sp.getBoolean(R.string.key_ns_client_autoscroll, true) binding.autoscroll.setOnCheckedChangeListener { _, isChecked -> - sp.putBoolean(R.string.key_nsclientinternal_autoscroll, isChecked) + sp.putBoolean(R.string.key_ns_client_autoscroll, isChecked) updateGui() } - binding.paused.isChecked = sp.getBoolean(R.string.key_nsclientinternal_paused, false) + binding.paused.isChecked = sp.getBoolean(R.string.key_ns_client_paused, false) binding.paused.setOnCheckedChangeListener { _, isChecked -> uel.log(if (isChecked) UserEntry.Action.NS_PAUSED else UserEntry.Action.NS_RESUME, UserEntry.Sources.NSClient) nsClientPlugin?.pause(isChecked) @@ -95,8 +97,9 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment { } override fun onCreateMenu(menu: Menu, inflater: MenuInflater) { - menu.add(Menu.FIRST, ID_MENU_TEST, 0, "Test").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) - menu.add(Menu.FIRST, ID_MENU_CLEAR_LOG, 0, rh.gs(R.string.clearlog)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) + if (buildHelper.isUnfinishedMode()) + menu.add(Menu.FIRST, ID_MENU_TEST, 0, "Test").setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) + menu.add(Menu.FIRST, ID_MENU_CLEAR_LOG, 0, rh.gs(R.string.clear_log)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) menu.add(Menu.FIRST, ID_MENU_RESTART, 0, rh.gs(R.string.restart)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) menu.add(Menu.FIRST, ID_MENU_SEND_NOW, 0, rh.gs(R.string.deliver_now)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) menu.add(Menu.FIRST, ID_MENU_FULL_SYNC, 0, rh.gs(R.string.full_sync)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) @@ -123,7 +126,7 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment { ID_MENU_FULL_SYNC -> { context?.let { context -> OKDialog.showConfirmation( - context, rh.gs(R.string.nsclientinternal), rh.gs(R.string.full_sync_comment), + context, rh.gs(R.string.ns_client), rh.gs(R.string.full_sync_comment), Runnable { nsClientPlugin?.resetToFullSync() } ) } @@ -154,9 +157,9 @@ class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment { private fun updateGui() { if (_binding == null) return - binding.paused.isChecked = sp.getBoolean(R.string.key_nsclientinternal_paused, false) + binding.paused.isChecked = sp.getBoolean(R.string.key_ns_client_paused, false) binding.log.text = nsClientPlugin?.textLog() - if (sp.getBoolean(R.string.key_nsclientinternal_autoscroll, true)) binding.logScrollview.fullScroll(ScrollView.FOCUS_DOWN) + if (sp.getBoolean(R.string.key_ns_client_autoscroll, true)) binding.logScrollview.fullScroll(ScrollView.FOCUS_DOWN) binding.url.text = nsClientPlugin?.address binding.status.text = nsClientPlugin?.status val size = dataSyncSelector.queueSize() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt index fa139ebde4..f4f0059d98 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt @@ -1,11 +1,10 @@ -package info.nightscout.androidaps.plugins.sync.nsShared +package info.nightscout.plugins.sync.nsShared import android.content.Context import android.os.SystemClock import androidx.work.Worker import androidx.work.WorkerParameters import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.BolusCalculatorResult @@ -37,13 +36,13 @@ import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin -import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.notifications.Notification +import info.nightscout.plugins.R +import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin +import info.nightscout.plugins.source.NSClientSourcePlugin +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -58,6 +57,7 @@ import info.nightscout.sdk.localmodel.treatment.NSTemporaryBasal import info.nightscout.sdk.localmodel.treatment.NSTemporaryTarget import info.nightscout.sdk.localmodel.treatment.NSTherapyEvent import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import java.util.concurrent.TimeUnit import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientNewLog.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt similarity index 92% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientNewLog.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt index ecef80a645..a808d14a74 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientNewLog.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsShared.events +package info.nightscout.plugins.sync.nsShared.events import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientResend.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientResend.kt similarity index 60% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientResend.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientResend.kt index 5c34cf5b68..506561809c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientResend.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientResend.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsShared.events +package info.nightscout.plugins.sync.nsShared.events import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt similarity index 83% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt index 0ed0d48916..0fb562e43e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsShared.events +package info.nightscout.plugins.sync.nsShared.events import info.nightscout.androidaps.events.EventStatus import info.nightscout.androidaps.interfaces.NsClient diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt similarity index 60% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt index af08d1acaa..86578a7585 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsShared.events +package info.nightscout.plugins.sync.nsShared.events import info.nightscout.rx.events.EventUpdateGui diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorImplementation.kt similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorImplementation.kt index 92c544d2f1..2b85ca8620 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorImplementation.kt @@ -1,6 +1,5 @@ -package info.nightscout.androidaps.plugins.sync.nsclient +package info.nightscout.plugins.sync.nsclient -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.Bolus @@ -20,13 +19,14 @@ import info.nightscout.androidaps.extensions.toJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.plugins.sync.nsclient.extensions.toJson -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.toJson +import info.nightscout.plugins.R import info.nightscout.plugins.profile.ProfilePlugin +import info.nightscout.plugins.sync.nsclient.extensions.toJson import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt index 7220ddc5c8..0c230c2a7d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient +package info.nightscout.plugins.sync.nsclient import android.content.ComponentName import android.content.Context @@ -12,21 +12,11 @@ import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sync -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI -import info.nightscout.androidaps.plugins.sync.nsShared.NSClientFragment -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientResend -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus -import info.nightscout.androidaps.plugins.sync.nsclient.data.AlarmAck -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSAlarm -import info.nightscout.androidaps.plugins.sync.nsclient.services.NSClientService import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.BuildHelper @@ -35,6 +25,15 @@ import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.utils.HtmlHelper.fromHtml +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.nsShared.NSClientFragment +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog +import info.nightscout.plugins.sync.nsShared.events.EventNSClientResend +import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus +import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI +import info.nightscout.plugins.sync.nsclient.data.AlarmAck +import info.nightscout.plugins.sync.nsclient.data.NSAlarm +import info.nightscout.plugins.sync.nsclient.services.NSClientService import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit @@ -42,6 +41,7 @@ import info.nightscout.rx.events.EventChargingState import info.nightscout.rx.events.EventNetworkChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign @@ -67,9 +67,9 @@ class NSClientPlugin @Inject constructor( .mainType(PluginType.SYNC) .fragmentClass(NSClientFragment::class.java.name) .pluginIcon(R.drawable.ic_nightscout_syncs) - .pluginName(R.string.nsclientinternal) - .shortName(R.string.nsclientinternal_shortname) - .preferencesId(R.xml.pref_nsclientinternal) + .pluginName(R.string.ns_client) + .shortName(R.string.ns_client_short_name) + .preferencesId(R.xml.pref_ns_client) .description(R.string.description_ns_client), aapsLogger, rh, injector ) { @@ -196,8 +196,8 @@ class NSClientPlugin @Inject constructor( } override fun pause(newState: Boolean) { - sp.putBoolean(R.string.key_nsclientinternal_paused, newState) - rxBus.send(EventPreferenceChange(rh, R.string.key_nsclientinternal_paused)) + sp.putBoolean(R.string.key_ns_client_paused, newState) + rxBus.send(EventPreferenceChange(rh, R.string.key_ns_client_paused)) } override val version: NsClient.Version diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NsClientReceiverDelegate.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NsClientReceiverDelegate.kt index 418b146987..f64bdc6174 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NsClientReceiverDelegate.kt @@ -1,12 +1,12 @@ -package info.nightscout.androidaps.plugins.sync.nsclient +package info.nightscout.plugins.sync.nsclient -import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.ReceiverStatusStore +import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventChargingState import info.nightscout.rx.events.EventNetworkChange +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton @@ -67,7 +67,7 @@ class NsClientReceiverDelegate @Inject constructor( val newAllowedState = allowedChargingState && allowedNetworkState if (newAllowedState != allowed) { allowed = newAllowedState - rxBus.send(EventPreferenceChange(rh.gs(R.string.key_nsclientinternal_paused))) + rxBus.send(EventPreferenceChange(rh.gs(R.string.key_ns_client_paused))) } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAddAck.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAddAck.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt index 46a81ea2b3..0b68f3c8e9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAddAck.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAddAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.acks +package info.nightscout.plugins.sync.nsclient.acks import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAuthAck.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAuthAck.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt index 8e9e85f4d5..d734e95a6f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAuthAck.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSAuthAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.acks +package info.nightscout.plugins.sync.nsclient.acks import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSUpdateAck.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSUpdateAck.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt index 87b5673dd4..fd07b22ce5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSUpdateAck.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/acks/NSUpdateAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.acks +package info.nightscout.plugins.sync.nsclient.acks import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/AlarmAck.java b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java similarity index 73% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/AlarmAck.java rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java index f24c79ed37..b9fa6ced88 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/AlarmAck.java +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/AlarmAck.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.data; +package info.nightscout.plugins.sync.nsclient.data; /** * Created by mike on 11.06.2017. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSAlarm.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSAlarm.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSAlarm.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSAlarm.kt index b9741e5915..3179751712 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSAlarm.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSAlarm.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.data +package info.nightscout.plugins.sync.nsclient.data import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt index 321117d679..a710996e2c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.data +package info.nightscout.plugins.sync.nsclient.data -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration -import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.Config import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.plugins.R +import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.sdk.remotemodel.RemoteDeviceStatus import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import javax.inject.Singleton @@ -82,7 +82,7 @@ class NSDeviceStatusHandler @Inject constructor( updateDeviceData(nsDeviceStatus) updateOpenApsData(nsDeviceStatus) updateUploaderData(nsDeviceStatus) - nsDeviceStatus.pump?.let { sp.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, true) } // Objective 0 + nsDeviceStatus.pump?.let { sp.putBoolean(R.string.key_objectives_pump_status_is_available_in_ns, true) } // Objective 0 if (config.NSCLIENT && !configurationDetected) nsDeviceStatus.configuration?.let { // copy configuration of Insulin and Sensitivity from main AAPS diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSMbg.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSMbg.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt index 90d0aae931..9ab9cecf28 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSMbg.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSMbg.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.data +package info.nightscout.plugins.sync.nsclient.data import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt index 4665b6f477..83acdf14c2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt @@ -1,22 +1,22 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.data +package info.nightscout.plugins.sync.nsclient.data import android.content.Context -import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.interfaces.Config -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject @@ -149,7 +149,7 @@ class NSSettingsStatus @Inject constructor( data = status aapsLogger.debug(LTag.NSCLIENT, "Got versions: Nightscout: ${getVersion()}") if (getVersionNum() < config.SUPPORTEDNSVERSION) { - val notification = Notification(Notification.OLD_NS, rh.gs(R.string.unsupportednsversion), Notification.NORMAL) + val notification = Notification(Notification.OLD_NS, rh.gs(R.string.unsupported_ns_version), Notification.NORMAL) rxBus.send(EventNewNotification(notification)) } else { rxBus.send(EventDismissNotification(Notification.OLD_NS)) @@ -246,7 +246,7 @@ class NSSettingsStatus @Inject constructor( uel.log(Action.NS_SETTINGS_COPIED, UserEntry.Sources.NSClient) } - if (context != null) OKDialog.showConfirmation(context, rh.gs(R.string.statuslights), rh.gs(R.string.copyexistingvalues), action) + if (context != null) OKDialog.showConfirmation(context, rh.gs(R.string.statuslights), rh.gs(R.string.copy_existing_values), action) else action.run() } } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSgv.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSgv.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSgv.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSgv.kt index 9da2da982a..db934f5fe3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSgv.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSgv.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.data +package info.nightscout.plugins.sync.nsclient.data import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt index 6af1385cf0..a69507f64a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt @@ -1,16 +1,16 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.data +package info.nightscout.plugins.sync.nsclient.data import android.text.Spanned import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.APSResult -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.Round +import info.nightscout.plugins.R +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton @@ -145,9 +145,9 @@ class ProcessedDeviceStatusData @Inject constructor( // test warning level val level = when { - openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_nsalarm_urgent_staledatavalue, 31)).msecs() < dateUtil.now() -> Levels.URGENT - openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_nsalarm_staledatavalue, 16)).msecs() < dateUtil.now() -> Levels.WARN - else -> Levels.INFO + openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_ns_alarm_urgent_stale_data_value, 31)).msecs() < dateUtil.now() -> Levels.URGENT + openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_ns_alarm_stale_data_value, 16)).msecs() < dateUtil.now() -> Levels.WARN + else -> Levels.INFO } string.append("") if (openAPSData.clockSuggested != 0L) string.append(dateUtil.minAgo(rh, openAPSData.clockSuggested)).append(" ") diff --git a/app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index 94abd15d4b..f973198253 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -6,8 +6,8 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration import info.nightscout.androidaps.receivers.ReceiverStatusStore +import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.shared.utils.DateUtil import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt index cdffc5e7d6..e7201d774c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt @@ -3,11 +3,12 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.plugins.sync.nsclient.data.NSMbg import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject import java.util.concurrent.TimeUnit @@ -26,10 +27,13 @@ fun TherapyEvent.GlucoseUnit.toMainUnit(): GlucoseUnit = if (this == TherapyEvent.GlucoseUnit.MGDL) GlucoseUnit.MGDL else GlucoseUnit.MMOL -/* - create fake object with nsID and isValid == false - */ - +fun therapyEventFromNsMbg(mbg: NSMbg) = + TherapyEvent( + type = TherapyEvent.Type.FINGER_STICK_BG_VALUE, //convert Mbg to finger stick because is coming from "entries" collection + timestamp = mbg.date, + glucose = mbg.mbg, + glucoseUnit = TherapyEvent.GlucoseUnit.MGDL + ) fun therapyEventFromJson(jsonObject: JSONObject): TherapyEvent? { val glucoseUnit = if (JsonHelper.safeGetString(jsonObject, "units", Constants.MGDL) == Constants.MGDL) TherapyEvent.GlucoseUnit.MGDL else TherapyEvent.GlucoseUnit.MMOL val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt index 470a4162a5..c27ddd9b35 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient.services +package info.nightscout.plugins.sync.nsclient.services import android.annotation.SuppressLint import android.content.Context @@ -16,44 +16,41 @@ import com.google.gson.GsonBuilder import com.google.gson.JsonDeserializer import dagger.android.DaggerService import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationWithAction -import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin -import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientAddAckWorker -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientAddUpdateWorker -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientMbgWorker -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.sync.nsclient.NSClientUpdateRemoveAckWorker -import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSAddAck -import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSAuthAck -import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSUpdateAck -import info.nightscout.androidaps.plugins.sync.nsclient.data.AlarmAck -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSAlarm -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T.Companion.mins import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.interfaces.utils.JsonHelper.safeGetStringAllowNull +import info.nightscout.plugins.R import info.nightscout.plugins.general.food.FoodPlugin +import info.nightscout.plugins.general.overview.notifications.NotificationWithAction import info.nightscout.plugins.profile.ProfilePlugin +import info.nightscout.plugins.source.NSClientSourcePlugin +import info.nightscout.plugins.sync.nsShared.StoreDataForDb +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog +import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus +import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI +import info.nightscout.plugins.sync.nsclient.NSClientPlugin +import info.nightscout.plugins.sync.nsclient.acks.NSAddAck +import info.nightscout.plugins.sync.nsclient.acks.NSAuthAck +import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck +import info.nightscout.plugins.sync.nsclient.data.AlarmAck +import info.nightscout.plugins.sync.nsclient.data.NSAlarm +import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler +import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus +import info.nightscout.plugins.sync.nsclient.workers.NSClientAddAckWorker +import info.nightscout.plugins.sync.nsclient.workers.NSClientAddUpdateWorker +import info.nightscout.plugins.sync.nsclient.workers.NSClientMbgWorker +import info.nightscout.plugins.sync.nsclient.workers.NSClientUpdateRemoveAckWorker +import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit @@ -62,7 +59,10 @@ import info.nightscout.rx.events.EventNSClientRestart import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.sdk.remotemodel.RemoteDeviceStatus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T.Companion.mins import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import io.socket.client.IO @@ -144,7 +144,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService { .subscribe({ event: EventPreferenceChange -> if (event.isChanged(rh, R.string.key_nsclientinternal_url) || event.isChanged(rh, R.string.key_nsclientinternal_api_secret) || - event.isChanged(rh, R.string.key_nsclientinternal_paused) + event.isChanged(rh, R.string.key_ns_client_paused) ) { latestDateInReceivedData = 0 destroy() @@ -221,7 +221,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService { rxBus.send(EventNSClientNewLog("ERROR", "Write treatment permission not granted ", NsClient.Version.V1)) } if (!hasWriteAuth) { - val noWritePerm = Notification(Notification.NSCLIENT_NO_WRITE_PERMISSION, rh.gs(R.string.nowritepermission), Notification.URGENT) + val noWritePerm = Notification(Notification.NSCLIENT_NO_WRITE_PERMISSION, rh.gs(R.string.no_write_permission), Notification.URGENT) rxBus.send(EventNewNotification(noWritePerm)) } else { rxBus.send(EventDismissNotification(Notification.NSCLIENT_NO_WRITE_PERMISSION)) @@ -238,7 +238,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService { override fun onStartCommand(intent: Intent, flags: Int, startId: Int): Int = START_STICKY - fun initialize() { + private fun initialize() { dataCounter = 0 readPreferences() @Suppress("DEPRECATION") @@ -247,7 +247,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService { if (!nsClientPlugin.isAllowed) { rxBus.send(EventNSClientNewLog("NSCLIENT", nsClientPlugin.blockingReason, NsClient.Version.V1)) rxBus.send(EventNSClientStatus(nsClientPlugin.blockingReason, NsClient.Version.V1)) - } else if (sp.getBoolean(R.string.key_nsclientinternal_paused, false)) { + } else if (sp.getBoolean(R.string.key_ns_client_paused, false)) { rxBus.send(EventNSClientNewLog("NSCLIENT", "paused", NsClient.Version.V1)) rxBus.send(EventNSClientStatus("Paused", NsClient.Version.V1)) } else if (!nsEnabled) { @@ -309,7 +309,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService { } rxBus.send(EventNSClientNewLog("WATCHDOG", "connections in last " + WATCHDOG_INTERVAL_MINUTES + " minutes: " + reconnections.size + "/" + WATCHDOG_MAX_CONNECTIONS, NsClient.Version.V1)) if (reconnections.size >= WATCHDOG_MAX_CONNECTIONS) { - val n = Notification(Notification.NS_MALFUNCTION, rh.gs(R.string.nsmalfunction), Notification.URGENT) + val n = Notification(Notification.NS_MALFUNCTION, rh.gs(R.string.ns_malfunction), Notification.URGENT) rxBus.send(EventNewNotification(n)) rxBus.send(EventNSClientNewLog("WATCHDOG", "pausing for $WATCHDOG_RECONNECT_IN minutes", NsClient.Version.V1)) nsClientPlugin.pause(true) @@ -544,7 +544,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService { if (sgvs.length() > 0) { rxBus.send(EventNSClientNewLog("DATA", "received " + sgvs.length() + " sgvs", NsClient.Version.V1)) // Objective0 - sp.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, true) + sp.putBoolean(R.string.key_objectives_bg_is_available_in_ns, true) dataWorkerStorage .beginUniqueWork( NSClientV3Plugin.JOB_NAME, @@ -646,7 +646,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService { private fun handleAlarm(alarm: JSONObject) { val defaultVal = config.NSCLIENT if (sp.getBoolean(R.string.key_ns_alarms, defaultVal)) { - val snoozedTo = sp.getLong(R.string.key_snoozedTo, 0L) + val snoozedTo = sp.getLong(R.string.key_snoozed_to, 0L) if (snoozedTo == 0L || System.currentTimeMillis() > snoozedTo) { val nsAlarm = NSAlarm(alarm) val notification: Notification = NotificationWithAction(injector, nsAlarm) @@ -660,7 +660,7 @@ class NSClientService : DaggerService(), NsClient.NSClientService { private fun handleUrgentAlarm(alarm: JSONObject) { val defaultVal = config.NSCLIENT if (sp.getBoolean(R.string.key_ns_alarms, defaultVal)) { - val snoozedTo = sp.getLong(R.string.key_snoozedTo, 0L) + val snoozedTo = sp.getLong(R.string.key_snoozed_to, 0L) if (snoozedTo == 0L || System.currentTimeMillis() > snoozedTo) { val nsAlarm = NSAlarm(alarm) val notification: Notification = NotificationWithAction(injector, nsAlarm) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddAckWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddAckWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt index 65ecac8683..8878129b16 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddAckWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient +package info.nightscout.plugins.sync.nsclient.workers import android.content.Context import android.os.SystemClock @@ -6,7 +6,6 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.DeviceStatus import info.nightscout.androidaps.database.transactions.UpdateNsIdBolusCalculatorResultTransaction @@ -37,9 +36,10 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryBasal import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryTarget import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTherapyEvent import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSAddAck import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog +import info.nightscout.plugins.sync.nsclient.acks.NSAddAck import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt index 336d7b3d7a..18453033ef 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt @@ -1,24 +1,23 @@ -package info.nightscout.androidaps.plugins.sync.nsclient +package info.nightscout.plugins.sync.nsclient.workers import android.content.Context import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin -import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.VirtualPump import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.nsShared.StoreDataForDb import info.nightscout.plugins.sync.nsclient.extensions.bolusFromJson import info.nightscout.plugins.sync.nsclient.extensions.carbsFromJson import info.nightscout.plugins.sync.nsclient.extensions.effectiveProfileSwitchFromJson @@ -33,6 +32,7 @@ import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject class NSClientAddUpdateWorker( @@ -50,7 +50,6 @@ class NSClientAddUpdateWorker( @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var rxBus: RxBus @Inject lateinit var uel: UserEntryLogger - @Inject lateinit var virtualPumpPlugin: VirtualPumpPlugin @Inject lateinit var xDripBroadcast: XDripBroadcast @Inject lateinit var storeDataForDb: StoreDataForDb @@ -100,7 +99,8 @@ class NSClientAddUpdateWorker( ebJson.put("mills", mills) json = ebJson eventType = JsonHelper.safeGetString(json, "eventType") - virtualPumpPlugin.fakeDataDetected = true + + activePlugin.activePump.let { if (it is VirtualPump) it.fakeDataDetected = true } } when { insulin > 0 || carbs > 0 -> Any() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientMbgWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt similarity index 83% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientMbgWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt index bf7e05fa60..033f1e2cc5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientMbgWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientMbgWorker.kt @@ -1,16 +1,16 @@ -package info.nightscout.androidaps.plugins.sync.nsclient +package info.nightscout.plugins.sync.nsclient.workers import android.content.Context import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R -import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSMbg import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.extensions.therapyEventFromNsMbg import info.nightscout.interfaces.Config +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.nsShared.StoreDataForDb +import info.nightscout.plugins.sync.nsclient.data.NSMbg +import info.nightscout.plugins.sync.nsclient.extensions.therapyEventFromNsMbg import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientUpdateRemoveAckWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientUpdateRemoveAckWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt index df4f77f049..952d208407 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientUpdateRemoveAckWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclient +package info.nightscout.plugins.sync.nsclient.workers import android.content.Context import androidx.work.Worker @@ -20,9 +20,9 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryBasal import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryTarget import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTherapyEvent import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.sync.nsclient.acks.NSUpdateAck import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog +import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index a4218cb84c..353676cf46 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3 +package info.nightscout.plugins.sync.nsclientV3 import android.content.Context import android.os.Handler @@ -12,27 +12,11 @@ import androidx.work.OneTimeWorkRequest import androidx.work.WorkInfo import androidx.work.WorkManager import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sync -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI -import info.nightscout.androidaps.plugins.sync.nsShared.NSClientFragment -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientResend -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientStatus -import info.nightscout.androidaps.plugins.sync.nsclient.NsClientReceiverDelegate -import info.nightscout.androidaps.plugins.sync.nsclient.data.AlarmAck -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSAlarm -import info.nightscout.androidaps.plugins.sync.nsclient.services.NSClientService -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadBgWorker -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadLastModificationWorker -import info.nightscout.androidaps.plugins.sync.nsclientV3.workers.LoadStatusWorker -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config @@ -40,6 +24,19 @@ import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.utils.HtmlHelper +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.nsShared.NSClientFragment +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog +import info.nightscout.plugins.sync.nsShared.events.EventNSClientResend +import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus +import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI +import info.nightscout.plugins.sync.nsclient.NsClientReceiverDelegate +import info.nightscout.plugins.sync.nsclient.data.AlarmAck +import info.nightscout.plugins.sync.nsclient.data.NSAlarm +import info.nightscout.plugins.sync.nsclient.services.NSClientService +import info.nightscout.plugins.sync.nsclientV3.workers.LoadBgWorker +import info.nightscout.plugins.sync.nsclientV3.workers.LoadLastModificationWorker +import info.nightscout.plugins.sync.nsclientV3.workers.LoadStatusWorker import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventChargingState @@ -49,7 +46,10 @@ import info.nightscout.rx.logging.LTag import info.nightscout.sdk.NSAndroidClientImpl 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 info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.serialization.decodeFromString @@ -77,9 +77,9 @@ class NSClientV3Plugin @Inject constructor( .mainType(PluginType.SYNC) .fragmentClass(NSClientFragment::class.java.name) .pluginIcon(R.drawable.ic_nightscout_syncs) - .pluginName(R.string.nsclientv3) - .shortName(R.string.nsclientv3_shortname) - .preferencesId(R.xml.pref_nsclientinternal) + .pluginName(R.string.ns_client_v3) + .shortName(R.string.ns_client_v3_short_name) + .preferencesId(R.xml.pref_ns_client) .description(R.string.description_ns_client_v3), aapsLogger, rh, injector ) { @@ -121,7 +121,7 @@ class NSClientV3Plugin @Inject constructor( lastFetched = Json.decodeFromString( sp.getString( - R.string.key_nsclientv2_lastmodified, + R.string.key_ns_client_v3_last_modified, Json.encodeToString( LastModified.serializer(), LastModified(LastModified.Collections(dateUtil.now() - maxAge, dateUtil.now() - maxAge, dateUtil.now() - maxAge, dateUtil.now() - maxAge)) @@ -135,7 +135,7 @@ class NSClientV3Plugin @Inject constructor( nsAndroidClient = NSAndroidClientImpl( baseUrl = sp.getString(R.string.key_nsclientinternal_url, "").lowercase().replace("https://", ""), - accessToken = sp.getString(R.string.key_nsclient_token, ""), + accessToken = sp.getString(R.string.key_ns_client_token, ""), context = context, logging = true ) @@ -236,8 +236,8 @@ class NSClientV3Plugin @Inject constructor( } override fun pause(newState: Boolean) { - sp.putBoolean(R.string.key_nsclientinternal_paused, newState) - rxBus.send(EventPreferenceChange(rh, R.string.key_nsclientinternal_paused)) + sp.putBoolean(R.string.key_ns_client_paused, newState) + rxBus.send(EventPreferenceChange(rh, R.string.key_ns_client_paused)) } override val version: NsClient.Version @@ -284,7 +284,7 @@ class NSClientV3Plugin @Inject constructor( } private fun storeLastFetched() { - sp.putString(R.string.key_nsclientv2_lastmodified, Json.encodeToString(LastModified.serializer(), lastFetched)) + sp.putString(R.string.key_ns_client_v3_last_modified, Json.encodeToString(LastModified.serializer(), lastFetched)) } fun test() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt index ddc6d88c84..a79c4988ec 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import com.google.gson.Gson import com.google.gson.JsonSyntaxException diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt similarity index 92% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt index 10f41e9343..bcd88ed1d5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Bolus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt index 3c85c8de41..4dc2bdac3a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Carbs diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt index 2b97063c31..dcc9102f07 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -1,12 +1,12 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.plugins.sync.nsclient.extensions.fromConstant import info.nightscout.sdk.localmodel.treatment.NSEffectiveProfileSwitch +import info.nightscout.shared.utils.DateUtil fun NSEffectiveProfileSwitch.toEffectiveProfileSwitch(dateUtil: DateUtil): EffectiveProfileSwitch? { val pureProfile = pureProfileFromJson(profileJson, dateUtil) ?: return null diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt index 41966b4ccb..5a5c3e2303 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.ExtendedBolus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt index d237881d43..3bfa4ce2ba 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.OfflineEvent diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt index 41f27cc3da..8ed408fa57 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -1,14 +1,14 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.fromConstant import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T fun NSProfileSwitch.toProfileSwitch(activePlugin: ActivePlugin, dateUtil: DateUtil): ProfileSwitch? { val pureProfile = diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt index 8735c78443..71dc0651d7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.TemporaryBasal diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt index 22d1d62038..17445fe2bf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.TemporaryTarget diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt index 4226fe79b8..ea94e4a770 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions +package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.TherapyEvent diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt index e9736e6939..f6f577767f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.workers +package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.ExistingWorkPolicy @@ -8,17 +8,17 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin -import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil +import info.nightscout.plugins.R +import info.nightscout.plugins.source.NSClientSourcePlugin +import info.nightscout.plugins.sync.nsShared.StoreDataForDb +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog +import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.runBlocking import javax.inject.Inject @@ -57,7 +57,7 @@ class LoadBgWorker( ) ) // Objective0 - sp.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, true) + sp.putBoolean(R.string.key_objectives_bg_is_available_in_ns, true) // Schedule processing of fetched data and continue of loading WorkManager.getInstance(context).beginUniqueWork( JOB_NAME, diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt index c4f528421a..d751339faf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.workers +package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.Worker @@ -6,14 +6,14 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.sync.nsclient.data.NSDeviceStatusHandler -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog +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.logging.AAPSLogger +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import kotlinx.coroutines.runBlocking import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt index 62162e7367..d231df9543 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.workers +package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin +import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.rx.logging.AAPSLogger import kotlinx.coroutines.runBlocking import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt index bdebb19219..0ffef7ffeb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.workers +package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin +import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.rx.logging.AAPSLogger import kotlinx.coroutines.runBlocking import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt index bf6f08a54e..44c3a658ef 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.workers +package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.ExistingWorkPolicy @@ -9,13 +9,13 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb -import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil +import info.nightscout.plugins.sync.nsShared.StoreDataForDb +import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog +import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.utils.DateUtil import kotlinx.coroutines.runBlocking import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt similarity index 85% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt index d9448aa17d..981497f58a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt @@ -1,32 +1,30 @@ -package info.nightscout.androidaps.plugins.sync.nsclientV3.workers +package info.nightscout.plugins.sync.nsclientV3.workers import android.content.Context import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin -import info.nightscout.androidaps.plugins.sync.nsShared.StoreDataForDb -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toBolus -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toBolusCalculatorResult -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toCarbs -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toEffectiveProfileSwitch -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toExtendedBolus -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toOfflineEvent -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toProfileSwitch -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toTemporaryBasal -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toTemporaryTarget -import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toTherapyEvent import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.nsShared.StoreDataForDb +import info.nightscout.plugins.sync.nsclientV3.extensions.toBolus +import info.nightscout.plugins.sync.nsclientV3.extensions.toBolusCalculatorResult +import info.nightscout.plugins.sync.nsclientV3.extensions.toCarbs +import info.nightscout.plugins.sync.nsclientV3.extensions.toEffectiveProfileSwitch +import info.nightscout.plugins.sync.nsclientV3.extensions.toExtendedBolus +import info.nightscout.plugins.sync.nsclientV3.extensions.toOfflineEvent +import info.nightscout.plugins.sync.nsclientV3.extensions.toProfileSwitch +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.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -42,6 +40,7 @@ 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 javax.inject.Inject class ProcessTreatmentsWorker( @@ -59,7 +58,6 @@ class ProcessTreatmentsWorker( @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var rxBus: RxBus @Inject lateinit var uel: UserEntryLogger - @Inject lateinit var virtualPumpPlugin: VirtualPumpPlugin @Inject lateinit var xDripBroadcast: XDripBroadcast @Inject lateinit var storeDataForDb: StoreDataForDb diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolFragment.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt similarity index 84% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolFragment.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt index 4d13020853..2438b321a8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool +package info.nightscout.plugins.sync.tidepool import android.os.Bundle import android.view.LayoutInflater @@ -6,13 +6,13 @@ import android.view.View import android.view.ViewGroup import android.widget.ScrollView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.R -import info.nightscout.androidaps.databinding.TidepoolFragmentBinding -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolDoUpload -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolResetData -import info.nightscout.androidaps.plugins.sync.tidepool.comm.TidepoolUploader -import info.nightscout.androidaps.plugins.sync.tidepool.events.EventTidepoolUpdateGUI import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.plugins.R +import info.nightscout.plugins.databinding.TidepoolFragmentBinding +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.sharedPreferences.SP diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt index 66bc129d46..8081ad492e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt @@ -1,37 +1,37 @@ -package info.nightscout.androidaps.plugins.sync.tidepool +package info.nightscout.plugins.sync.tidepool import android.content.Context import android.text.Spanned import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sync -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolDoUpload -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolResetData -import info.nightscout.androidaps.plugins.sync.tidepool.comm.TidepoolUploader -import info.nightscout.androidaps.plugins.sync.tidepool.comm.UploadChunk -import info.nightscout.androidaps.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.androidaps.plugins.sync.tidepool.events.EventTidepoolUpdateGUI -import info.nightscout.androidaps.plugins.sync.tidepool.utils.RateLimit import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.utils.HtmlHelper +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader +import info.nightscout.plugins.sync.tidepool.comm.UploadChunk +import info.nightscout.plugins.sync.tidepool.events.EventTidepoolDoUpload +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.EventNetworkChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -67,7 +67,7 @@ class TidepoolPlugin @Inject constructor( private val listLog = ArrayList() var textLog: Spanned = HtmlHelper.fromHtml("") - @Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS", "NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS", "UNNECESSARY_NOT_NULL_ASSERTION") + @Suppress("UNNECESSARY_NOT_NULL_ASSERTION") override fun onStart() { super.onStart() disposable += rxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/InfoInterceptor.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt similarity index 92% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/InfoInterceptor.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt index 0f29e5233f..71987129f0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/InfoInterceptor.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/InfoInterceptor.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.comm +package info.nightscout.plugins.sync.tidepool.comm import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/Session.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt similarity index 82% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/Session.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt index 6b3622851f..4c425899b7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/Session.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/Session.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.comm +package info.nightscout.plugins.sync.tidepool.comm -import info.nightscout.androidaps.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.androidaps.plugins.sync.tidepool.messages.DatasetReplyMessage +import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage +import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage import okhttp3.Headers class Session(val authHeader: String?, diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolApiService.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt similarity index 75% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolApiService.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt index f9c0491e81..90c571b008 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolApiService.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolApiService.kt @@ -1,20 +1,27 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.comm +package info.nightscout.plugins.sync.tidepool.comm -import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.androidaps.plugins.sync.tidepool.messages.DatasetReplyMessage -import info.nightscout.androidaps.plugins.sync.tidepool.messages.UploadReplyMessage +import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage +import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage +import info.nightscout.plugins.sync.tidepool.messages.UploadReplyMessage import okhttp3.RequestBody import retrofit2.Call -import retrofit2.http.* +import retrofit2.http.Body +import retrofit2.http.DELETE +import retrofit2.http.GET +import retrofit2.http.Header +import retrofit2.http.Headers +import retrofit2.http.POST +import retrofit2.http.PUT +import retrofit2.http.Path +import retrofit2.http.Query const val SESSION_TOKEN_HEADER: String = "x-tidepool-session-token" interface TidepoolApiService { @Headers( - "User-Agent: AAPS- " + BuildConfig.VERSION_NAME, - "X-Tidepool-Client-Name: info.nightscout.androidaps" + BuildConfig.APPLICATION_ID, + "User-Agent: AAPS- " + "1.0", + "X-Tidepool-Client-Name: info.nightscout.androidaps", "X-Tidepool-Client-Version: 0.1.0" ) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolCallback.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolCallback.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt index 0e7334378b..9b06e3367a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolCallback.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolCallback.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.comm +package info.nightscout.plugins.sync.tidepool.comm -import info.nightscout.androidaps.plugins.sync.tidepool.events.EventTidepoolStatus +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt index 4221589884..630d7291e0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/TidepoolUploader.kt @@ -1,25 +1,24 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.comm +package info.nightscout.plugins.sync.tidepool.comm import android.content.Context import android.os.PowerManager import android.os.SystemClock -import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.androidaps.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.androidaps.plugins.sync.tidepool.messages.AuthRequestMessage -import info.nightscout.androidaps.plugins.sync.tidepool.messages.DatasetReplyMessage -import info.nightscout.androidaps.plugins.sync.tidepool.messages.OpenDatasetRequestMessage -import info.nightscout.androidaps.plugins.sync.tidepool.messages.UploadReplyMessage -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.tidepool.events.EventTidepoolStatus +import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage +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 @@ -150,7 +149,7 @@ class TidepoolUploader @Inject constructor( // See if we already have an open data set to write to val datasetCall = session.service!!.getOpenDataSets( session.token!!, - session.authReply!!.userid!!, BuildConfig.APPLICATION_ID, 1 + session.authReply!!.userid!!, "AAPS", 1 ) datasetCall.enqueue(TidepoolCallback>(aapsLogger, rxBus, session, "Get Open Datasets", { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt index 44cf474e28..4f8056b8bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt @@ -1,26 +1,26 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.comm +package info.nightscout.plugins.sync.tidepool.comm -import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.database.entities.TemporaryBasal import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.plugins.sync.tidepool.elements.BasalElement -import info.nightscout.androidaps.plugins.sync.tidepool.elements.BaseElement -import info.nightscout.androidaps.plugins.sync.tidepool.elements.BloodGlucoseElement -import info.nightscout.androidaps.plugins.sync.tidepool.elements.BolusElement -import info.nightscout.androidaps.plugins.sync.tidepool.elements.ProfileElement -import info.nightscout.androidaps.plugins.sync.tidepool.elements.SensorGlucoseElement -import info.nightscout.androidaps.plugins.sync.tidepool.elements.WizardElement -import info.nightscout.androidaps.plugins.sync.tidepool.events.EventTidepoolStatus -import info.nightscout.androidaps.plugins.sync.tidepool.utils.GsonInstance -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.plugins.R +import info.nightscout.plugins.sync.tidepool.elements.BasalElement +import info.nightscout.plugins.sync.tidepool.elements.BaseElement +import info.nightscout.plugins.sync.tidepool.elements.BloodGlucoseElement +import info.nightscout.plugins.sync.tidepool.elements.BolusElement +import info.nightscout.plugins.sync.tidepool.elements.ProfileElement +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.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/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt similarity index 92% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt index a848e95566..cc92b0ebe0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.elements +package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.database.entities.TemporaryBasal import info.nightscout.androidaps.extensions.convertedToAbsolute +import info.nightscout.androidaps.interfaces.Profile import info.nightscout.shared.utils.DateUtil -import java.util.* +import java.util.UUID class BasalElement(tbr: TemporaryBasal, private val profile: Profile, dateUtil: DateUtil) : BaseElement(tbr.timestamp, UUID.nameUUIDFromBytes(("AAPS-basal" + tbr.timestamp).toByteArray()).toString(), dateUtil) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt index d761a2cf70..c5bdc1057e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BaseElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.elements +package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.shared.utils.DateUtil diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index 7679dc39cb..c4c919ccc3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -1,11 +1,12 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.elements +package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.androidaps.interfaces.Profile import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit import info.nightscout.shared.utils.DateUtil -import java.util.* +import java.util.LinkedList +import java.util.UUID class BloodGlucoseElement(therapyEvent: TherapyEvent, dateUtil: DateUtil) : BaseElement(therapyEvent.timestamp, UUID.nameUUIDFromBytes(("AAPS-bg" + therapyEvent.timestamp).toByteArray()).toString(), dateUtil) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt similarity index 86% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt index 0a3f0d1683..4918d735e8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.elements +package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.shared.utils.DateUtil -import java.util.* +import java.util.UUID class BolusElement(bolus: Bolus, dateUtil: DateUtil) : BaseElement(bolus.timestamp, UUID.nameUUIDFromBytes(("AAPS-bolus" + bolus.timestamp).toByteArray()).toString(), dateUtil) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt index 827ff2ba65..f247ecbbf5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt @@ -1,12 +1,12 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.elements +package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.plugins.sync.tidepool.comm.TidepoolUploader +import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import info.nightscout.shared.utils.DateUtil -import java.util.* +import java.util.UUID class ProfileElement(ps: EffectiveProfileSwitch, serialNumber: String, dateUtil: DateUtil) : BaseElement(ps.timestamp, UUID.nameUUIDFromBytes(("AAPS-profile" + ps.timestamp).toByteArray()).toString(), dateUtil) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt index 250e08ce82..f7fb4ef6dd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt @@ -1,9 +1,10 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.elements +package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.shared.utils.DateUtil -import java.util.* +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) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt index af80c5b30a..b53252edc0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.elements +package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.shared.utils.DateUtil -import java.util.* +import java.util.UUID class WizardElement(carbs: Carbs, dateUtil: DateUtil) : BaseElement(carbs.timestamp, UUID.nameUUIDFromBytes(("AAPS-wizard" + carbs.timestamp).toByteArray()).toString(), dateUtil) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolDoUpload.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt similarity index 53% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolDoUpload.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt index d97e354f1b..3d16c71169 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolDoUpload.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolDoUpload.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.events +package info.nightscout.plugins.sync.tidepool.events import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolResetData.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt similarity index 54% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolResetData.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt index 43ed9ff251..0c0762a1b1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolResetData.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolResetData.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.events +package info.nightscout.plugins.sync.tidepool.events import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt index 7addb83399..9b064661b4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.events +package info.nightscout.plugins.sync.tidepool.events import info.nightscout.rx.events.Event import java.text.SimpleDateFormat diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt similarity index 55% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt index 7e6e2b796b..341e5a0cf9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.events +package info.nightscout.plugins.sync.tidepool.events import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt index 99edf8eeed..8713d91339 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.messages +package info.nightscout.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose import com.google.gson.annotations.SerializedName diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt similarity index 82% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt index afa62e5894..33428422de 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/AuthRequestMessage.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.messages +package info.nightscout.plugins.sync.tidepool.messages -import info.nightscout.androidaps.R +import info.nightscout.plugins.R import info.nightscout.shared.sharedPreferences.SP import okhttp3.Credentials diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/BaseMessage.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt similarity index 73% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/BaseMessage.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt index b3ae854bf2..2c1df65ba5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/BaseMessage.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/BaseMessage.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.messages +package info.nightscout.plugins.sync.tidepool.messages -import info.nightscout.androidaps.plugins.sync.tidepool.utils.GsonInstance +import info.nightscout.plugins.sync.tidepool.utils.GsonInstance import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.RequestBody import okhttp3.RequestBody.Companion.toRequestBody diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt similarity index 68% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt index 3bc3f5b670..586f96c438 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.messages +package info.nightscout.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt similarity index 95% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt index 295f917a24..7eed75c13a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/DatasetReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.messages +package info.nightscout.plugins.sync.tidepool.messages class DatasetReplyMessage { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt similarity index 82% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt index 25e89a7883..5117af073c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt @@ -1,11 +1,10 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.messages +package info.nightscout.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose -import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.plugins.sync.tidepool.comm.TidepoolUploader +import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T -import java.util.* +import java.util.TimeZone class OpenDatasetRequestMessage(serialNumber: String, dateUtil: DateUtil) : BaseMessage() { @@ -50,12 +49,12 @@ class OpenDatasetRequestMessage(serialNumber: String, dateUtil: DateUtil) : Base var timezone: String = TimeZone.getDefault().id @Expose - var version = BuildConfig.VERSION_NAME + var version = "1.0" inner class ClientInfo { @Expose - val name = BuildConfig.APPLICATION_ID + val name = "AAPS" @Expose val version = TidepoolUploader.VERSION diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt similarity index 53% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt index 459c63ec6e..ac40f05e5a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/messages/UploadReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.messages +package info.nightscout.plugins.sync.tidepool.messages class UploadReplyMessage { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/GsonInstance.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt similarity index 86% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/GsonInstance.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt index 5c383f3440..0801ece9dc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/GsonInstance.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/utils/GsonInstance.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.utils +package info.nightscout.plugins.sync.tidepool.utils import com.google.gson.Gson import com.google.gson.GsonBuilder diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt index ab4fcdd0c9..a819ded98e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/utils/RateLimit.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.utils +package info.nightscout.plugins.sync.tidepool.utils -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T 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 javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/res/layout/ns_client_fragment.xml b/plugins/src/main/res/layout/ns_client_fragment.xml similarity index 95% rename from app/src/main/res/layout/ns_client_fragment.xml rename to plugins/src/main/res/layout/ns_client_fragment.xml index 91016d058e..3a92d3f400 100644 --- a/app/src/main/res/layout/ns_client_fragment.xml +++ b/plugins/src/main/res/layout/ns_client_fragment.xml @@ -3,7 +3,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context=".plugins.sync.nsShared.NSClientFragment"> + tools:context=".sync.nsShared.NSClientFragment"> + android:text="@string/ns_client_url" /> diff --git a/app/src/main/res/layout/overview_notification_item.xml b/plugins/src/main/res/layout/overview_notification_item.xml similarity index 100% rename from app/src/main/res/layout/overview_notification_item.xml rename to plugins/src/main/res/layout/overview_notification_item.xml diff --git a/app/src/main/res/layout/bgsource_fragment.xml b/plugins/src/main/res/layout/source_fragment.xml similarity index 86% rename from app/src/main/res/layout/bgsource_fragment.xml rename to plugins/src/main/res/layout/source_fragment.xml index beefd8120b..f56d3e838c 100644 --- a/app/src/main/res/layout/bgsource_fragment.xml +++ b/plugins/src/main/res/layout/source_fragment.xml @@ -4,7 +4,7 @@ android:layout_height="match_parent" android:orientation="vertical" android:paddingTop="2dp" - tools:context="info.nightscout.androidaps.plugins.source.BGSourceFragment"> + tools:context=".source.BGSourceFragment"> + tools:context=".pump.virtual.VirtualPumpFragment"> @@ -46,7 +46,7 @@ tools:ignore="HardcodedText" /> @@ -323,7 +323,7 @@ android:layout_weight="1" android:paddingStart="0dp" android:paddingEnd="5dp" - android:text="@string/virtualpump_type" + android:text="@string/virtual_pump_type" android:textAlignment="viewEnd" android:textSize="14sp" /> @@ -372,7 +372,7 @@ android:layout_weight="1" android:paddingStart="0dp" android:paddingEnd="5dp" - android:text="@string/virtualpump_definition" + android:text="@string/virtual_pump_definition" android:textAlignment="viewEnd" android:textSize="14sp" /> diff --git a/app/src/main/res/raw/urgentalarm.mp3 b/plugins/src/main/res/raw/urgentalarm.mp3 similarity index 100% rename from app/src/main/res/raw/urgentalarm.mp3 rename to plugins/src/main/res/raw/urgentalarm.mp3 diff --git a/plugins/src/main/res/values/arrays.xml b/plugins/src/main/res/values/arrays.xml index 3360615473..0e75db8ee1 100644 --- a/plugins/src/main/res/values/arrays.xml +++ b/plugins/src/main/res/values/arrays.xml @@ -12,4 +12,36 @@ @string/value_system_theme + + Generic AAPS + MDI + Accu-Chek Combo + Accu-Chek Spirit + Accu-Chek Insight + Accu-Chek Solo + Animas Ping + Animas Vibe + Cellnovo + DanaR + DanaR Korean + DanaRS + DanaRv2 + DanaI + Diaconn G8 + Eoflow Eopatch2 + Medtronic 512/712 + Medtronic 515/715 + Medtronic 522/722 + Medtronic 523/723 (Revel) + Medtronic 554/754 (Veo) + Medtronic 640G + Omnipod Dash + Omnipod Eros + Tandem t:slim + Tandem t:flex + Tandem t:slim G4 + Tandem t:slim X2 + YpsoPump + + \ No newline at end of file diff --git a/plugins/src/main/res/values/strings.xml b/plugins/src/main/res/values/strings.xml index 1162ab96fb..2d89aa74db 100644 --- a/plugins/src/main/res/values/strings.xml +++ b/plugins/src/main/res/values/strings.xml @@ -39,64 +39,64 @@ +XXXXXXXXXX;+YYYYYYYYYY To deliver bolus %1$.2fU reply with code %2$s To deliver meal bolus %1$.2fU reply with code %2$s - To set the Temp Target %1$s reply with code %2$s - To cancel Temp Target reply with code %1$s - To disable the SMS Remote Service reply with code %1$s.\n\nKeep in mind that you\'ll able to reactivate it directly from the AAPS master smartphone only. - SMS Remote Service stopped. To reactivate it, use AAPS on master smartphone. - To send calibration %1$.2f reply with code %2$s - Bolus failed - Minimum number of minutes that must elapse between one remote bolus and the next - How many minutes must elapse, at least, between one bolus and the next - For your safety, to edit this preference you need to add at least 2 phone numbers. - Bolus %1$.2f U delivered successfully - Meal Bolus %1$.2f U delivered successfully - Target %1$s for %2$d minutes + To set the Temp Target %1$s reply with code %2$s + To cancel Temp Target reply with code %1$s + To disable the SMS Remote Service reply with code %1$s.\n\nKeep in mind that you\'ll able to reactivate it directly from the AAPS master smartphone only. + SMS Remote Service stopped. To reactivate it, use AAPS on master smartphone. + To send calibration %1$.2f reply with code %2$s + Bolus failed + Minimum number of minutes that must elapse between one remote bolus and the next + How many minutes must elapse, at least, between one bolus and the next + For your safety, to edit this preference you need to add at least 2 phone numbers. + Bolus %1$.2f U delivered successfully + Meal Bolus %1$.2f U delivered successfully + Target %1$s for %2$d minutes Target %1$s for %2$d minutes set successfully Temp Target canceled successfully - Allow remote commands via SMS - Loop has been disabled - Loop has been enabled - Loop is enabled - To connect pump reply with code %1$s - Connection to pump failed - To disconnect pump for %1$d minutes reply with code %2$s - Pump disconnected + Allow remote commands via SMS + Loop has been disabled + Loop has been enabled + Loop is enabled + To connect pump reply with code %1$s + Connection to pump failed + To disconnect pump for %1$d minutes reply with code %2$s + Pump disconnected Pump reconnected - Remote command is not allowed - Remote bolus not available. Try again later. - To start basal %1$.2f U/h for %2$d min reply with code %3$s - To switch profile to %1$s %2$d%% reply with code %3$s - To start extended bolus %1$.2f U for %2$d min reply with code %3$s - To enter %1$dg at %2$s reply with code %3$s - To start basal %1$d%% for %2$d min reply with code %3$s - To suspend loop for %1$d minutes reply with code %2$s - To resume loop reply with code %1$s - To enable loop reply with code %1$s - To disable loop reply with code %1$s - Temp basal %1$.2fU/h for %2$d min started successfully - Extended bolus %1$.2fU for %2$d min started successfully - Carbs %1$d g entered successfully - Entering %1$dg of carbs failed - Temp basal %1$d%% for %2$d min started successfully - Temp basal start failed - Extended bolus start failed - To stop temp basal reply with code %1$s - To stop extended bolus reply with code %1$s - Temp basal canceled - Extended bolus canceled - Canceling temp basal failed - Canceling extended bolus failed - Unknown command or wrong reply + Remote command is not allowed + Remote bolus not available. Try again later. + To start basal %1$.2f U/h for %2$d min reply with code %3$s + To switch profile to %1$s %2$d%% reply with code %3$s + To start extended bolus %1$.2f U for %2$d min reply with code %3$s + To enter %1$dg at %2$s reply with code %3$s + To start basal %1$d%% for %2$d min reply with code %3$s + To suspend loop for %1$d minutes reply with code %2$s + To resume loop reply with code %1$s + To enable loop reply with code %1$s + To disable loop reply with code %1$s + Temp basal %1$.2fU/h for %2$d min started successfully + Extended bolus %1$.2fU for %2$d min started successfully + Carbs %1$d g entered successfully + Entering %1$dg of carbs failed + Temp basal %1$d%% for %2$d min started successfully + Temp basal start failed + Extended bolus start failed + To stop temp basal reply with code %1$s + To stop extended bolus reply with code %1$s + Temp basal canceled + Extended bolus canceled + Canceling temp basal failed + Canceling extended bolus failed + Unknown command or wrong reply There is another bolus in queue. Try again later. - Wrong duration - Loop suspended - Loop resumed - Invalid SMS phone number - Calibration sent. Receiving must be enabled in xDrip+. - xDrip+ is not receiving calibrations - Invalid message body - Send SMS if unreachable pump event is triggered - Report pump unreachable + Wrong duration + Loop suspended + Loop resumed + Invalid SMS phone number + Calibration sent. Receiving must be enabled in xDrip+. + xDrip+ is not receiving calibrations + Invalid message body + Send SMS if unreachable pump event is triggered + Report pump unreachable Wrong format BG: Last BG: @@ -137,7 +137,7 @@ xdripstatus_showbgi xdripstatus_settings - + xDrip+ Statusline (watch) xds Show information about your loop on your xDrip+ watchface. @@ -153,10 +153,10 @@ Displays the food presets defined in Nightscout Filter Food - kJ - En - Pr - Fat + kJ + En + Pr + Fat Category Subcategory Calculator @@ -239,6 +239,244 @@ Time elapsed + statuslights_copy_ns + statuslights_overview_advanced + Snooze + Copy NS settings (if exists)? + show_statuslights + Show status lights on home screen + statuslights_cage_warning + Threshold warning cannula age [h] + statuslights_cage_critical + Threshold critical cannula age [h] + statuslights_iage_warning + Threshold warning insulin age [h] + statuslights_iage_critical + Threshold critical insulin age [h] + statuslights_sage_warning + Threshold warning sensor age [h] + statuslights_sage_critical + Threshold critical sensor age [h] + statuslights_sbat_warning + Threshold warning sensor battery level [%] + statuslights_sbat_critical + Threshold critical sensor battery level [%] + statuslights_bage_warning + Threshold warning pump battery age [h] + statuslights_bage_critical + Threshold critical pump battery age [h] + statuslights_res_warning + Threshold warning reservoir level [U] + statuslights_res_critical + Threshold critical reservoir level [U] + statuslights_bat_warning + Threshold warning pump battery level [%] + statuslights_bat_critical + Threshold critical pump battery level [%] + Status lights + Copy settings from NS + + + ns_client_autoscroll + ns_client_paused + ns_log_app_started_event + + NSCLIENT has no write permission. Wrong API secret? + NSClientV3 + NSV3 + NSClient + NSCI + URL: + Autoscroll + Restart + NSClient + Nightscout URL + Enter Your Nightscout URL + NS API secret + NS API secret + Enter NS API secret (min 12 chars) + NS access token + NS access token + Access token generated on NS admin page (min 17 chars) + Deliver now + Clear queue + Show queue + Queue: + Status: + Clear log + Full synchronization + Full synchronization? It may take many hours and until finish you\'ll not see new data in NS. + Synchronization + ns_upload + Profiles, boluses, carbs, temporary basals are uploaded to NS + Upload data to NS + Receive profile store + Synchronize profiles from NS profile editor + Receive temporary targets + Accept temporary targets entered through NS or NSClient + Receive profile switches + Accept profile switches entered through NS or NSClient + Receive APS offline events + Accept APS Offline events entered through NS or NSClient + Receive TBR and EB + Accept TBR and EB entered through another instance + Receive insulin + Accept insulin entered through NS or NSClient (it\'s not delivered, only calculated towards IOB) + Receive carbs + Accept carbs entered through NS or NSClient + ns_receive_tbr_eb + Receive therapy events + Accept therapy events (cannula, insulin, battery change etc) entered through NS or NSClient + ns_receive_cgm + Receive/backfill CGM data + Accept CGM data from NS + Run %s? + Slow down uploads + Alarm options + ns_announcements + ns_alarms + ns_alarm_stale_data_value + ns_alarm_urgent_stale_data_value + Create notifications from NS alarms + Create notifications from NS announcements + Stale data threshold [min] + Urgent stale data threshold [min] + Log app start to NS + Enable broadcasts to other apps (like xDrip+). Do not enable if you have more than one instance of AAPS or AAPSClient installed! + Enable local Broadcasts. + + + tidepool_username + tidepool_password + tidepool_dev_servers + tidepool_test_login + tidepool_only_while_charging + tidepool_only_while_unmetered + tidepool_last_end + tidepool_upload_profile + tidepool_upload_tbr + tidepool_upload_cgm + tidepool_upload_bolus + tidepool_upload_bg + + Your Tidepool login user name, normally your email address + Login User Name + Your Tidepool login password + Login Password + Test Tidepool Login + If enabled, uploads will go to https://int-app.tidepool.org instead of the regular https://app.tidepool.org/ + Use Integration (test) servers + Tidepool + TDP + Uploads data to Tidepool + Upload CGM data + Upload treatments (insulin, carbs) + Upload temporary basals + Upload profile switches, temp targets + Upload BG tests + Remove all + Reset start + + + virtualpump_uploadstatus + Virtual Pump Type + Pump Definition + Bolus: Step=%1$s\nExtended Bolus: [Step=%2$s, Duration=%3$smin-%4$sh]\nBasal: Step=%5$s\nTBR: %6$s (by %7$s), Duration=%8$smin-%9$sh\n%10$s + + Virtual Pump + VPUMP + Pump integration for pumps which don\'t have any driver yet (Open Loop) + VIRTUAL PUMP + Virtual pump settings + Upload status to NS + + + dexcomg5_nsupload + + NSClient BG + NS BG + Downloads BG data from Nightscout + xDrip+ + Receive BG values from xDrip+. + BYODA + BYODA + Receive BG values from the \'Build Your Own Dexcom App\'. + Eversense App (patched) + EVR + Receive BG values from the patched Eversense app. + Glimp + Receive BG values from Glimp. + MM640g + Receive BG values from the 600SeriesAndroidUploader. + Poctech + Receive BG values from Poctech app + Glunovo + Receive values from Glunovo app + Intelligo + Receive values from Intelligo app + Tomato (MiaoMiao) + Tomato + Receive BG values from Tomato app (MiaoMiao device) + GlucoRx Aidex + Aidex + Receive BG values from GlucoRx Aidex CGMS. + + Send BG data to xDrip+ + In xDrip+ select 640g/Eversense data source + Upload BG data to NS + BG upload settings + + + ns_temporary_target_last_sync + ns_glucose_value_last_sync + ns_food_last_sync + ns_therapy_event_last_sync + ns_bolus_calculator_result_last_synced_id + ns_carbs_last_synced_id + ns_bolus_last_synced_id + ns_device_status_last_synced_id + ns_temporary_basal_last_synced_id + ns_extended_bolus_last_synced_id + profile_switch_last_synced_id + ns_effective_profile_switch_last_synced_id + ns_offline_event_last_synced_id + ns_profile_store_last_synced_timestamp + ns_sync_slow + nsclient_token + key_ns_client_v3_last_modified + ns_create_announcements_from_carbs_req + ns_cellular + ns_wifi + ns_wifi_ssids + ns_allow_roaming + ns_battery + ns_charging + snoozedTo + + Use Cellular connection + Use WiFi connection + WiFi SSID + During charging + On battery + Connection settings + Allowed SSIDs (semicolon separated) + Allow connection in roaming + Create announcements from errors + Create announcements from carbs required alerts + Create Nightscout announcement for error dialogs and local alerts (also viewable in Careportal under Treatments) + Create Nightscout announcements for carbs required alerts + Synchronizes your data with Nightscout + Synchronizes your data with Nightscout using v3 API + Blocked by charging options + Blocked by connectivity options + Unsupported version of Nightscout + OAPS + UPLD + NSClient malfunction. Consider NS and NSClient restart. + + + ObjectivesbgIsAvailableInNS + ObjectivespumpStatusIsAvailableInNS \ No newline at end of file diff --git a/app/src/main/res/xml/pref_bgsource.xml b/plugins/src/main/res/xml/pref_bgsource.xml similarity index 100% rename from app/src/main/res/xml/pref_bgsource.xml rename to plugins/src/main/res/xml/pref_bgsource.xml diff --git a/app/src/main/res/xml/pref_nsclientinternal.xml b/plugins/src/main/res/xml/pref_ns_client.xml similarity index 85% rename from app/src/main/res/xml/pref_nsclientinternal.xml rename to plugins/src/main/res/xml/pref_ns_client.xml index fff4e93e93..9f7cd5160a 100644 --- a/app/src/main/res/xml/pref_nsclientinternal.xml +++ b/plugins/src/main/res/xml/pref_ns_client.xml @@ -4,25 +4,25 @@ xmlns:validate="http://schemas.android.com/apk/res-auto"> @@ -30,7 +30,7 @@ android:dialogMessage="@string/nsclient_token_dialog_message" android:dialogTitle="@string/nsclient_token_dialog_title" android:inputType="textPassword" - android:key="@string/key_nsclient_token" + android:key="@string/key_ns_client_token" android:title="@string/nsclient_token_title" validate:minLength="17" validate:testType="minLength"/> @@ -107,8 +107,8 @@ > + android:key="@string/ns_alarm_options" + android:title="@string/ns_alarm_options"> @@ -135,11 +135,11 @@ android:defaultValue="31" android:digits="0123456789" android:inputType="number" - android:key="@string/key_nsalarm_urgent_staledatavalue" + android:key="@string/key_ns_alarm_urgent_stale_data_value" android:maxLines="20" android:selectAllOnFocus="true" android:singleLine="true" - android:title="@string/nsalarm_urgent_staledatavalue_label" + android:title="@string/ns_alarm_urgent_stale_data_value_label" validate:maxNumber="180" validate:minNumber="30" validate:testType="numericRange" /> @@ -147,8 +147,8 @@ + android:key="@string/connection_settings_title" + android:title="@string/connection_settings_title"> + android:title="@string/ns_allow_roaming" /> + android:summary="@string/ns_local_broadcasts" + android:title="@string/ns_local_broadcasts_title" /> + android:title="@string/smscommunicator_remote_commands_allowed" /> @@ -45,8 +45,8 @@ + android:summary="@string/smscommunicator_report_pump_unreachable_summary" + android:title="@string/smscommunicator_pump_unreachable" /> diff --git a/app/src/main/res/xml/pref_tidepool.xml b/plugins/src/main/res/xml/pref_tidepool.xml similarity index 100% rename from app/src/main/res/xml/pref_tidepool.xml rename to plugins/src/main/res/xml/pref_tidepool.xml diff --git a/app/src/main/res/xml/pref_virtualpump.xml b/plugins/src/main/res/xml/pref_virtual_pump.xml similarity index 86% rename from app/src/main/res/xml/pref_virtualpump.xml rename to plugins/src/main/res/xml/pref_virtual_pump.xml index ad1e0344fa..97212112a2 100644 --- a/app/src/main/res/xml/pref_virtualpump.xml +++ b/plugins/src/main/res/xml/pref_virtual_pump.xml @@ -12,11 +12,11 @@ android:entries="@array/virtualPumpTypes" android:entryValues="@array/virtualPumpTypes" android:key="@string/key_virtualpump_type" - android:title="@string/virtualpump_type" /> + android:title="@string/virtual_pump_type" /> diff --git a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt index 3ef6e37b19..32b55291b1 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt @@ -173,81 +173,81 @@ class SmsCommunicatorPluginTest : TestBaseWithProfile() { `when`(otp.name()).thenReturn("User") `when`(otp.checkOTP(anyString())).thenReturn(OneTimePasswordValidationResult.OK) - `when`(rh.gs(R.string.smscommunicator_remotecommandnotallowed)).thenReturn("Remote command is not allowed") + `when`(rh.gs(R.string.smscommunicator_remote_command_not_allowed)).thenReturn("Remote command is not allowed") `when`(rh.gs(R.string.sms_wrong_code)).thenReturn("Wrong code. Command cancelled.") `when`(rh.gs(R.string.sms_iob)).thenReturn("IOB:") `when`(rh.gs(R.string.sms_last_bg)).thenReturn("Last BG:") `when`(rh.gs(R.string.sms_min_ago)).thenReturn("%1\$dmin ago") - `when`(rh.gs(R.string.smscommunicator_remotecommandnotallowed)).thenReturn("Remote command is not allowed") - `when`(rh.gs(R.string.smscommunicator_stopsmswithcode)).thenReturn("To disable the SMS Remote Service reply with code %1\$s.\\n\\nKeep in mind that you\\'ll able to reactivate it directly from the AAPS master smartphone only.") + `when`(rh.gs(R.string.smscommunicator_remote_command_not_allowed)).thenReturn("Remote command is not allowed") + `when`(rh.gs(R.string.smscommunicator_stops_ns_with_code)).thenReturn("To disable the SMS Remote Service reply with code %1\$s.\\n\\nKeep in mind that you\\'ll able to reactivate it directly from the AAPS master smartphone only.") `when`(rh.gs(R.string.smscommunicator_meal_bolus_reply_with_code)).thenReturn("To deliver meal bolus %1$.2fU reply with code %2\$s.") - `when`(rh.gs(R.string.smscommunicator_temptargetwithcode)).thenReturn("To set the Temp Target %1\$s reply with code %2\$s") - `when`(rh.gs(R.string.smscommunicator_temptargetcancel)).thenReturn("To cancel Temp Target reply with code %1\$s") - `when`(rh.gs(R.string.smscommunicator_stoppedsms)).thenReturn("SMS Remote Service stopped. To reactivate it, use AAPS on master smartphone.") + `when`(rh.gs(R.string.smscommunicator_temptarget_with_code)).thenReturn("To set the Temp Target %1\$s reply with code %2\$s") + `when`(rh.gs(R.string.smscommunicator_temptarget_cancel)).thenReturn("To cancel Temp Target reply with code %1\$s") + `when`(rh.gs(R.string.smscommunicator_stopped_sms)).thenReturn("SMS Remote Service stopped. To reactivate it, use AAPS on master smartphone.") `when`(rh.gs(R.string.smscommunicator_tt_set)).thenReturn("Target %1\$s for %2\$d minutes set successfully") `when`(rh.gs(R.string.smscommunicator_tt_canceled)).thenReturn("Temp Target canceled successfully") `when`(rh.gs(R.string.sms_loop_suspended_for)).thenReturn("Suspended (%1\$d m)") `when`(rh.gs(R.string.loopisdisabled)).thenReturn("Loop is disabled") - `when`(rh.gs(R.string.smscommunicator_loopisenabled)).thenReturn("Loop is enabled") + `when`(rh.gs(R.string.smscommunicator_loop_is_enabled)).thenReturn("Loop is enabled") `when`(rh.gs(R.string.wrong_format)).thenReturn("Wrong format") `when`(rh.gs(eq(R.string.sms_wrong_tbr_duration), ArgumentMatchers.any())).thenAnswer { i: InvocationOnMock -> "TBR duration must be a multiple of " + i.arguments[1] + " minutes and greater than " + "0." } - `when`(rh.gs(R.string.smscommunicator_loophasbeendisabled)).thenReturn("Loop has been disabled") - `when`(rh.gs(R.string.smscommunicator_loophasbeenenabled)).thenReturn("Loop has been enabled") - `when`(rh.gs(R.string.smscommunicator_tempbasalcanceled)).thenReturn("Temp basal canceled") - `when`(rh.gs(R.string.smscommunicator_loopresumed)).thenReturn("Loop resumed") - `when`(rh.gs(R.string.smscommunicator_wrongduration)).thenReturn("Wrong duration") - `when`(rh.gs(R.string.smscommunicator_suspendreplywithcode)).thenReturn("To suspend loop for %1\$d minutes reply with code %2\$s") - `when`(rh.gs(R.string.smscommunicator_loopsuspended)).thenReturn("Loop suspended") - `when`(rh.gs(R.string.smscommunicator_unknowncommand)).thenReturn("Unknown command or wrong reply") + `when`(rh.gs(R.string.smscommunicator_loop_has_been_disabled)).thenReturn("Loop has been disabled") + `when`(rh.gs(R.string.smscommunicator_loop_has_been_enabled)).thenReturn("Loop has been enabled") + `when`(rh.gs(R.string.smscommunicator_tempbasal_canceled)).thenReturn("Temp basal canceled") + `when`(rh.gs(R.string.smscommunicator_loop_resumed)).thenReturn("Loop resumed") + `when`(rh.gs(R.string.smscommunicator_wrong_duration)).thenReturn("Wrong duration") + `when`(rh.gs(R.string.smscommunicator_suspend_reply_with_code)).thenReturn("To suspend loop for %1\$d minutes reply with code %2\$s") + `when`(rh.gs(R.string.smscommunicator_loop_suspended)).thenReturn("Loop suspended") + `when`(rh.gs(R.string.smscommunicator_unknown_command)).thenReturn("Unknown command or wrong reply") `when`(rh.gs(R.string.notconfigured)).thenReturn("Not configured") - `when`(rh.gs(R.string.smscommunicator_profilereplywithcode)).thenReturn("To switch profile to %1\$s %2\$d%% reply with code %3\$s") + `when`(rh.gs(R.string.smscommunicator_profile_reply_with_code)).thenReturn("To switch profile to %1\$s %2\$d%% reply with code %3\$s") `when`(rh.gs(R.string.sms_profile_switch_created)).thenReturn("Profile switch created") - `when`(rh.gs(R.string.smscommunicator_basalstopreplywithcode)).thenReturn("To stop temp basal reply with code %1\$s") - `when`(rh.gs(R.string.smscommunicator_basalpctreplywithcode)).thenReturn("To start basal %1\$d%% for %2\$d min reply with code %3\$s") - `when`(rh.gs(R.string.smscommunicator_tempbasalset_percent)).thenReturn("Temp basal %1\$d%% for %2\$d min started successfully") - `when`(rh.gs(R.string.smscommunicator_basalreplywithcode)).thenReturn("To start basal %1$.2fU/h for %2\$d min reply with code %3\$s") - `when`(rh.gs(R.string.smscommunicator_tempbasalset)).thenReturn("Temp basal %1$.2fU/h for %2\$d min started successfully") - `when`(rh.gs(R.string.smscommunicator_extendedstopreplywithcode)).thenReturn("To stop extended bolus reply with code %1\$s") - `when`(rh.gs(R.string.smscommunicator_extendedcanceled)).thenReturn("Extended bolus canceled") - `when`(rh.gs(R.string.smscommunicator_extendedreplywithcode)).thenReturn("To start extended bolus %1$.2fU for %2\$d min reply with code %3\$s") - `when`(rh.gs(R.string.smscommunicator_extendedset)).thenReturn("Extended bolus %1$.2fU for %2\$d min started successfully") + `when`(rh.gs(R.string.smscommunicator_basal_stop_reply_with_code)).thenReturn("To stop temp basal reply with code %1\$s") + `when`(rh.gs(R.string.smscommunicator_basal_pct_reply_with_code)).thenReturn("To start basal %1\$d%% for %2\$d min reply with code %3\$s") + `when`(rh.gs(R.string.smscommunicator_tempbasal_set_percent)).thenReturn("Temp basal %1\$d%% for %2\$d min started successfully") + `when`(rh.gs(R.string.smscommunicator_basal_reply_with_code)).thenReturn("To start basal %1$.2fU/h for %2\$d min reply with code %3\$s") + `when`(rh.gs(R.string.smscommunicator_tempbasal_set)).thenReturn("Temp basal %1$.2fU/h for %2\$d min started successfully") + `when`(rh.gs(R.string.smscommunicator_extended_stop_reply_with_code)).thenReturn("To stop extended bolus reply with code %1\$s") + `when`(rh.gs(R.string.smscommunicator_extended_canceled)).thenReturn("Extended bolus canceled") + `when`(rh.gs(R.string.smscommunicator_extended_reply_with_code)).thenReturn("To start extended bolus %1$.2fU for %2\$d min reply with code %3\$s") + `when`(rh.gs(R.string.smscommunicator_extended_set)).thenReturn("Extended bolus %1$.2fU for %2\$d min started successfully") `when`(rh.gs(R.string.smscommunicator_bolus_reply_with_code)).thenReturn("To deliver bolus %1$.2fU reply with code %2\$s") - `when`(rh.gs(R.string.smscommunicator_bolusdelivered)).thenReturn("Bolus %1$.2fU delivered successfully") - `when`(rh.gs(R.string.smscommunicator_remotebolusnotallowed)).thenReturn("Remote bolus not available. Try again later.") - `when`(rh.gs(R.string.smscommunicator_calibrationreplywithcode)).thenReturn("To send calibration %1$.2f reply with code %2\$s") - `when`(rh.gs(R.string.smscommunicator_calibrationsent)).thenReturn("Calibration sent. Receiving must be enabled in xDrip.") - `when`(rh.gs(R.string.smscommunicator_carbsreplywithcode)).thenReturn("To enter %1\$dg at %2\$s reply with code %3\$s") - `when`(rh.gs(R.string.smscommunicator_carbsset)).thenReturn("Carbs %1\$dg entered successfully") + `when`(rh.gs(R.string.smscommunicator_bolus_delivered)).thenReturn("Bolus %1$.2fU delivered successfully") + `when`(rh.gs(R.string.smscommunicator_remote_bolus_not_allowed)).thenReturn("Remote bolus not available. Try again later.") + `when`(rh.gs(R.string.smscommunicator_calibration_reply_with_code)).thenReturn("To send calibration %1$.2f reply with code %2\$s") + `when`(rh.gs(R.string.smscommunicator_calibration_sent)).thenReturn("Calibration sent. Receiving must be enabled in xDrip.") + `when`(rh.gs(R.string.smscommunicator_carbs_reply_with_code)).thenReturn("To enter %1\$dg at %2\$s reply with code %3\$s") + `when`(rh.gs(R.string.smscommunicator_carbs_set)).thenReturn("Carbs %1\$dg entered successfully") `when`(rh.gs(R.string.noprofile)).thenReturn("No profile loaded from NS yet") `when`(rh.gs(R.string.pumpsuspended)).thenReturn("Pump suspended") `when`(rh.gs(R.string.sms_delta)).thenReturn("Delta:") `when`(rh.gs(R.string.sms_bolus)).thenReturn("Bolus:") `when`(rh.gs(R.string.sms_basal)).thenReturn("Basal:") `when`(rh.gs(R.string.cob)).thenReturn("COB") - `when`(rh.gs(R.string.smscommunicator_mealbolusdelivered)).thenReturn("Meal Bolus %1\$.2fU delivered successfully") - `when`(rh.gs(R.string.smscommunicator_mealbolusdelivered_tt)).thenReturn("Target %1\$s for %2\$d minutes") + `when`(rh.gs(R.string.smscommunicator_meal_bolus_delivered)).thenReturn("Meal Bolus %1\$.2fU delivered successfully") + `when`(rh.gs(R.string.smscommunicator_meal_bolus_delivered_tt)).thenReturn("Target %1\$s for %2\$d minutes") `when`(rh.gs(R.string.sms_actual_bg)).thenReturn("BG:") `when`(rh.gs(R.string.sms_last_bg)).thenReturn("Last BG:") - `when`(rh.gs(R.string.smscommunicator_loopdisablereplywithcode)).thenReturn("To disable loop reply with code %1\$s") - `when`(rh.gs(R.string.smscommunicator_loopenablereplywithcode)).thenReturn("To enable loop reply with code %1\$s") - `when`(rh.gs(R.string.smscommunicator_loopresumereplywithcode)).thenReturn("To resume loop reply with code %1\$s") - `when`(rh.gs(R.string.smscommunicator_pumpdisconnectwithcode)).thenReturn("To disconnect pump for %1d minutes reply with code %2\$s") - `when`(rh.gs(R.string.smscommunicator_pumpconnectwithcode)).thenReturn("To connect pump reply with code %1\$s") + `when`(rh.gs(R.string.smscommunicator_loop_disable_reply_with_code)).thenReturn("To disable loop reply with code %1\$s") + `when`(rh.gs(R.string.smscommunicator_loop_enable_reply_with_code)).thenReturn("To enable loop reply with code %1\$s") + `when`(rh.gs(R.string.smscommunicator_loop_resume_reply_with_code)).thenReturn("To resume loop reply with code %1\$s") + `when`(rh.gs(R.string.smscommunicator_pump_disconnect_with_code)).thenReturn("To disconnect pump for %1d minutes reply with code %2\$s") + `when`(rh.gs(R.string.smscommunicator_pump_connect_with_code)).thenReturn("To connect pump reply with code %1\$s") `when`(rh.gs(R.string.smscommunicator_reconnect)).thenReturn("Pump reconnected") - `when`(rh.gs(R.string.smscommunicator_pumpconnectfail)).thenReturn("Connection to pump failed") - `when`(rh.gs(R.string.smscommunicator_pumpdisconnected)).thenReturn("Pump disconnected") + `when`(rh.gs(R.string.smscommunicator_pump_connect_fail)).thenReturn("Connection to pump failed") + `when`(rh.gs(R.string.smscommunicator_pump_disconnected)).thenReturn("Pump disconnected") `when`(rh.gs(R.string.smscommunicator_code_from_authenticator_for)).thenReturn("from Authenticator app for: %1\$s followed by PIN") `when`(rh.gs(R.string.patient_name_default)).thenReturn("User") `when`(rh.gs(R.string.invalidprofile)).thenReturn("Invalid profile !!!") `when`(rh.gs(R.string.sms)).thenReturn("SMS") `when`(rh.gsNotLocalised(R.string.loopsuspended)).thenReturn("Loop suspended") - `when`(rh.gsNotLocalised(R.string.smscommunicator_stoppedsms)).thenReturn("SMS Remote Service stopped. To reactivate it, use AAPS on master smartphone.") + `when`(rh.gsNotLocalised(R.string.smscommunicator_stopped_sms)).thenReturn("SMS Remote Service stopped. To reactivate it, use AAPS on master smartphone.") `when`(rh.gsNotLocalised(R.string.sms_profile_switch_created)).thenReturn("Profile switch created") - `when`(rh.gsNotLocalised(R.string.smscommunicator_tempbasalcanceled)).thenReturn("Temp basal canceled") - `when`(rh.gsNotLocalised(R.string.smscommunicator_calibrationsent)).thenReturn("Calibration sent. Receiving must be enabled in xDrip+.") + `when`(rh.gsNotLocalised(R.string.smscommunicator_tempbasal_canceled)).thenReturn("Temp basal canceled") + `when`(rh.gsNotLocalised(R.string.smscommunicator_calibration_sent)).thenReturn("Calibration sent. Receiving must be enabled in xDrip+.") `when`(rh.gsNotLocalised(R.string.smscommunicator_tt_canceled)).thenReturn("Temp Target canceled successfully") } diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt similarity index 96% rename from app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt rename to plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt index 660339d5f3..9d5eceb551 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt @@ -1,19 +1,19 @@ -package info.nightscout.androidaps.plugins.pump.virtual +package info.nightscout.plugins.pump.virtual import dagger.android.AndroidInjector -import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt b/plugins/src/test/java/info/nightscout/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt similarity index 98% rename from app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt rename to plugins/src/test/java/info/nightscout/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt index f70a6aa7a1..9d3635d528 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt @@ -1,13 +1,13 @@ -package info.nightscout.androidaps.plugins.sync.nsclient +package info.nightscout.plugins.sync.nsclient import android.content.Context -import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.ReceiverStatusStore +import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventChargingState import info.nightscout.rx.events.EventNetworkChange +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/SessionTest.kt b/plugins/src/test/java/info/nightscout/plugins/sync/tidepool/comm/SessionTest.kt similarity index 80% rename from app/src/test/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/SessionTest.kt rename to plugins/src/test/java/info/nightscout/plugins/sync/tidepool/comm/SessionTest.kt index 4d9f61fbe0..2d6175f3c0 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/SessionTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/sync/tidepool/comm/SessionTest.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.plugins.sync.tidepool.comm +package info.nightscout.plugins.sync.tidepool.comm -import info.nightscout.androidaps.plugins.sync.tidepool.messages.AuthReplyMessage -import info.nightscout.androidaps.plugins.sync.tidepool.messages.DatasetReplyMessage +import info.nightscout.plugins.sync.tidepool.messages.AuthReplyMessage +import info.nightscout.plugins.sync.tidepool.messages.DatasetReplyMessage import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test diff --git a/pump/combo/src/main/res/layout/combopump_fragment.xml b/pump/combo/src/main/res/layout/combopump_fragment.xml index c8a812f256..e3b957c15a 100644 --- a/pump/combo/src/main/res/layout/combopump_fragment.xml +++ b/pump/combo/src/main/res/layout/combopump_fragment.xml @@ -317,7 +317,7 @@ android:layout_weight="1.5" android:paddingStart="0dp" android:paddingEnd="5dp" - android:text="@string/basebasalrate_label" + android:text="@string/base_basal_rate_label" android:textAlignment="viewEnd" android:textSize="14sp" /> diff --git a/pump/dana/src/main/res/layout/danar_fragment.xml b/pump/dana/src/main/res/layout/danar_fragment.xml index af8086bb8d..fbc1d8814d 100644 --- a/pump/dana/src/main/res/layout/danar_fragment.xml +++ b/pump/dana/src/main/res/layout/danar_fragment.xml @@ -320,7 +320,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:paddingEnd="5dp" - android:text="@string/basebasalrate_label" + android:text="@string/base_basal_rate_label" android:textAlignment="viewEnd" android:textSize="14sp" tools:ignore="RtlHardcoded,RtlSymmetry" /> @@ -416,7 +416,7 @@ android:layout_height="wrap_content" android:layout_weight="1" android:paddingEnd="5dp" - android:text="@string/virtualpump_extendedbolus_label" + android:text="@string/extended_bolus_label" android:textAlignment="viewEnd" android:textSize="14sp" tools:ignore="RtlSymmetry" /> diff --git a/pump/diaconn/src/main/res/layout/diaconn_g8_fragment.xml b/pump/diaconn/src/main/res/layout/diaconn_g8_fragment.xml index d7ed7049c7..3c82645cfd 100644 --- a/pump/diaconn/src/main/res/layout/diaconn_g8_fragment.xml +++ b/pump/diaconn/src/main/res/layout/diaconn_g8_fragment.xml @@ -348,7 +348,7 @@ android:layout_weight="1" android:paddingStart="0dp" android:paddingEnd="5dp" - android:text="@string/basebasalrate_label" + android:text="@string/base_basal_rate_label" android:textAlignment="viewEnd" android:textSize="14sp" /> @@ -444,7 +444,7 @@ android:layout_weight="1" android:paddingStart="0dp" android:paddingEnd="5dp" - android:text="@string/virtualpump_extendedbolus_label" + android:text="@string/extended_bolus_label" android:textAlignment="viewEnd" android:textSize="14sp" /> diff --git a/pump/medtronic/src/main/res/layout/medtronic_fragment.xml b/pump/medtronic/src/main/res/layout/medtronic_fragment.xml index 5af824b5c9..fe7d62f235 100644 --- a/pump/medtronic/src/main/res/layout/medtronic_fragment.xml +++ b/pump/medtronic/src/main/res/layout/medtronic_fragment.xml @@ -360,7 +360,7 @@ android:layout_weight="1.5" android:textAlignment="viewEnd" android:paddingEnd="5dp" - android:text="@string/basebasalrate_label" + android:text="@string/base_basal_rate_label" android:textSize="14sp" tools:ignore="RtlSymmetry" /> diff --git a/ui/src/main/res/values/strings.xml b/ui/src/main/res/values/strings.xml index d05a24345a..d70869f9d6 100644 --- a/ui/src/main/res/values/strings.xml +++ b/ui/src/main/res/values/strings.xml @@ -43,7 +43,6 @@ %1$s ISF: %2$.1f %1$.1fg IC: %2$.1f %1$.0fg IC: %2$.1f - %1$d%% Superbolus Total @@ -51,7 +50,6 @@ No records available Calc IOB: - INVALID Insulin: Carbs: Total IOB: