From ca977b1d33f243d445d35697efdf4edcd20e5d81 Mon Sep 17 00:00:00 2001 From: t_j_s Date: Fri, 9 Sep 2022 09:18:42 +0100 Subject: [PATCH 01/42] Introduction of DynISF into the prediction corves, lines 583, 587 and 617. --- .../assets/OpenAPSSMBDynamicISF/determine-basal.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js index f3ff906aac..74f442bbf1 100644 --- a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js +++ b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js @@ -579,9 +579,12 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ // for IOBpredBGs, predicted deviation impact drops linearly from current deviation down to zero // over 60 minutes (data points every 5m) var predDev = ci * ( 1 - Math.min(1,IOBpredBGs.length/(60/5)) ); - IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + predBGI + predDev; + //IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + predBGI + predDev; + IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD * (Math.log((Math.max( IOBpredBGs[IOBpredBGs.length-1],39) / ins_val ) + 1 ) ) )) * 5 ),2)) + // calculate predBGs with long zero temp without deviations - var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + predZTBGI; + //var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + predZTBGI; + var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + (round(( -iobTick.iobWithZeroTemp.activity * (1800 / ( TDD * (Math.log(( Math.max(ZTpredBGs[ZTpredBGs.length-1],39) / ins_val ) + 1 ) ) )) * 5 ), 2)); // for COBpredBGs, predicted carb impact drops linearly from current carb impact down to zero // eventually accounting for all carbs (if they can be absorbed over DIA) var predCI = Math.max(0, Math.max(0,ci) * ( 1 - COBpredBGs.length/Math.max(cid*2,1) ) ); @@ -610,7 +613,8 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ //console.error(UAMpredBGs.length,slopeFromDeviations, predUCI); UAMduration=round((UAMpredBGs.length+1)*5/60,1); } - UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + predBGI + Math.min(0, predDev) + predUCI; + //UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + predBGI + Math.min(0, predDev) + predUCI; + UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD * (Math.log(( Math.max(UAMpredBGs[UAMpredBGs.length-1],39) / ins_val ) + 1 ) ) )) * 5 ),2)) + Math.min(0, predDev) + predUCI; //console.error(predBGI, predCI, predUCI); // truncate all BG predictions at 4 hours if ( IOBpredBGs.length < 48) { IOBpredBGs.push(IOBpredBG); } From e729b2a81aea473645d7855c291c6c96181f3c68 Mon Sep 17 00:00:00 2001 From: t_j_s Date: Fri, 9 Sep 2022 13:05:20 +0100 Subject: [PATCH 02/42] COrrected Variable --- .../main/assets/OpenAPSSMBDynamicISF/determine-basal.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js index 74f442bbf1..5066bd1cac 100644 --- a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js +++ b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js @@ -580,11 +580,13 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ // over 60 minutes (data points every 5m) var predDev = ci * ( 1 - Math.min(1,IOBpredBGs.length/(60/5)) ); //IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + predBGI + predDev; - IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD * (Math.log((Math.max( IOBpredBGs[IOBpredBGs.length-1],39) / ins_val ) + 1 ) ) )) * 5 ),2)) + IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD * (Math.log((Math.max( IOBpredBGs[IOBpredBGs.length-1],39) / insulinDivisor ) + 1 ) ) )) + * 5 ),2)) // calculate predBGs with long zero temp without deviations //var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + predZTBGI; - var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + (round(( -iobTick.iobWithZeroTemp.activity * (1800 / ( TDD * (Math.log(( Math.max(ZTpredBGs[ZTpredBGs.length-1],39) / ins_val ) + 1 ) ) )) * 5 ), 2)); + var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + (round(( -iobTick.iobWithZeroTemp.activity * (1800 / ( TDD * (Math.log(( Math.max(ZTpredBGs[ZTpredBGs.length-1],39) / + insulinDivisor ) + 1 ) ) )) * 5 ), 2)); // for COBpredBGs, predicted carb impact drops linearly from current carb impact down to zero // eventually accounting for all carbs (if they can be absorbed over DIA) var predCI = Math.max(0, Math.max(0,ci) * ( 1 - COBpredBGs.length/Math.max(cid*2,1) ) ); @@ -614,7 +616,8 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ UAMduration=round((UAMpredBGs.length+1)*5/60,1); } //UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + predBGI + Math.min(0, predDev) + predUCI; - UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD * (Math.log(( Math.max(UAMpredBGs[UAMpredBGs.length-1],39) / ins_val ) + 1 ) ) )) * 5 ),2)) + Math.min(0, predDev) + predUCI; + UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD + * (Math.log(( Math.max(UAMpredBGs[UAMpredBGs.length-1],39) / insulinDivisor ) + 1 ) ) )) * 5 ),2)) + Math.min(0, predDev) + predUCI; //console.error(predBGI, predCI, predUCI); // truncate all BG predictions at 4 hours if ( IOBpredBGs.length < 48) { IOBpredBGs.push(IOBpredBG); } From 055a11dee0ea384c96013f7658d3576b71e407f1 Mon Sep 17 00:00:00 2001 From: t_j_s Date: Fri, 9 Sep 2022 13:26:25 +0100 Subject: [PATCH 03/42] COrrected Variable --- app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js index 5066bd1cac..ac7666ba87 100644 --- a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js +++ b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js @@ -208,7 +208,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ //********************************************************************************* console.error("---------------------------------------------------------"); - console.error( " Dynamic ISF version Beta 1.6.5 "); + console.error( " Dynamic ISF version Beta 2.0 "); console.error("---------------------------------------------------------"); var variable_sens = profile.variable_sens; From 786228189ff50a68ad1b92560253b329f8d1c4e7 Mon Sep 17 00:00:00 2001 From: Tim Street Date: Fri, 9 Sep 2022 17:41:59 +0100 Subject: [PATCH 04/42] Fixed missing semi-colon. --- app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js index ac7666ba87..1049113272 100644 --- a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js +++ b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js @@ -581,7 +581,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ var predDev = ci * ( 1 - Math.min(1,IOBpredBGs.length/(60/5)) ); //IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + predBGI + predDev; IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD * (Math.log((Math.max( IOBpredBGs[IOBpredBGs.length-1],39) / insulinDivisor ) + 1 ) ) )) - * 5 ),2)) + * 5 ),2)); // calculate predBGs with long zero temp without deviations //var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + predZTBGI; From 546ff7b1e04c86cbf16e21e076709866f3f5191e Mon Sep 17 00:00:00 2001 From: Tim Street Date: Tue, 13 Sep 2022 18:42:56 +0100 Subject: [PATCH 05/42] Missed +predDev from IOBPredBG. Re-added. --- app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js index 1049113272..fed911758e 100644 --- a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js +++ b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js @@ -581,7 +581,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ var predDev = ci * ( 1 - Math.min(1,IOBpredBGs.length/(60/5)) ); //IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + predBGI + predDev; IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD * (Math.log((Math.max( IOBpredBGs[IOBpredBGs.length-1],39) / insulinDivisor ) + 1 ) ) )) - * 5 ),2)); + * 5 ),2)) + predDev; // calculate predBGs with long zero temp without deviations //var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + predZTBGI; From e4d2e093b2dbd212260e391d15e74c9ebcff7b20 Mon Sep 17 00:00:00 2001 From: t_j_s Date: Fri, 9 Sep 2022 09:18:42 +0100 Subject: [PATCH 06/42] Missed +predDev from IOBPredBG. Re-added. Fixed missing semi-colon. COrrected Variable COrrected Variable Introduction of DynISF into the prediction corves, lines 583, 587 and 617. --- .../OpenAPSSMBDynamicISF/determine-basal.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js index f3ff906aac..fed911758e 100644 --- a/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js +++ b/app/src/main/assets/OpenAPSSMBDynamicISF/determine-basal.js @@ -208,7 +208,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ //********************************************************************************* console.error("---------------------------------------------------------"); - console.error( " Dynamic ISF version Beta 1.6.5 "); + console.error( " Dynamic ISF version Beta 2.0 "); console.error("---------------------------------------------------------"); var variable_sens = profile.variable_sens; @@ -579,9 +579,14 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ // for IOBpredBGs, predicted deviation impact drops linearly from current deviation down to zero // over 60 minutes (data points every 5m) var predDev = ci * ( 1 - Math.min(1,IOBpredBGs.length/(60/5)) ); - IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + predBGI + predDev; + //IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + predBGI + predDev; + IOBpredBG = IOBpredBGs[IOBpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD * (Math.log((Math.max( IOBpredBGs[IOBpredBGs.length-1],39) / insulinDivisor ) + 1 ) ) )) + * 5 ),2)) + predDev; + // calculate predBGs with long zero temp without deviations - var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + predZTBGI; + //var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + predZTBGI; + var ZTpredBG = ZTpredBGs[ZTpredBGs.length-1] + (round(( -iobTick.iobWithZeroTemp.activity * (1800 / ( TDD * (Math.log(( Math.max(ZTpredBGs[ZTpredBGs.length-1],39) / + insulinDivisor ) + 1 ) ) )) * 5 ), 2)); // for COBpredBGs, predicted carb impact drops linearly from current carb impact down to zero // eventually accounting for all carbs (if they can be absorbed over DIA) var predCI = Math.max(0, Math.max(0,ci) * ( 1 - COBpredBGs.length/Math.max(cid*2,1) ) ); @@ -610,7 +615,9 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ //console.error(UAMpredBGs.length,slopeFromDeviations, predUCI); UAMduration=round((UAMpredBGs.length+1)*5/60,1); } - UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + predBGI + Math.min(0, predDev) + predUCI; + //UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + predBGI + Math.min(0, predDev) + predUCI; + UAMpredBG = UAMpredBGs[UAMpredBGs.length-1] + (round(( -iobTick.activity * (1800 / ( TDD + * (Math.log(( Math.max(UAMpredBGs[UAMpredBGs.length-1],39) / insulinDivisor ) + 1 ) ) )) * 5 ),2)) + Math.min(0, predDev) + predUCI; //console.error(predBGI, predCI, predUCI); // truncate all BG predictions at 4 hours if ( IOBpredBGs.length < 48) { IOBpredBGs.push(IOBpredBG); } From 0540640548b9d708ea88d163a7ef44209404a065 Mon Sep 17 00:00:00 2001 From: Michael Kroes Date: Sun, 6 Nov 2022 12:21:46 +0100 Subject: [PATCH 07/42] Show correct icon when AutoSens data is available under AAPSClient --- .../androidaps/plugins/general/overview/OverviewFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 734a8661b9..9d00130dac 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 @@ -1102,7 +1102,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList private fun updateSensitivity() { _binding ?: return - if (constraintChecker.isAutosensModeEnabled().value()) { + if (constraintChecker.isAutosensModeEnabled().value() || !(config.NSCLIENT && overviewData.lastAutosensData(iobCobCalculator) == null)) { binding.infoLayout.sensitivityIcon.setImageResource(R.drawable.ic_swap_vert_black_48dp_green) } else { binding.infoLayout.sensitivityIcon.setImageResource(R.drawable.ic_x_swap_vert) From 16ada310f0108e597d3746aad1973deeeba5ac9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 08:03:14 +0000 Subject: [PATCH 08/42] chore(deps): bump rxandroidble from 1.16.0 to 1.17.0 Bumps [rxandroidble](https://github.com/dariuszseweryn/RxAndroidBle) from 1.16.0 to 1.17.0. - [Release notes](https://github.com/dariuszseweryn/RxAndroidBle/releases) - [Changelog](https://github.com/dariuszseweryn/RxAndroidBle/blob/master/CHANGELOG.md) - [Commits](https://github.com/dariuszseweryn/RxAndroidBle/commits) --- updated-dependencies: - dependency-name: com.polidea.rxandroidble3:rxandroidble dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pump/eopatch/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pump/eopatch/build.gradle b/pump/eopatch/build.gradle index ae89e54fdd..a10a3ed8a5 100644 --- a/pump/eopatch/build.gradle +++ b/pump/eopatch/build.gradle @@ -27,6 +27,6 @@ dependencies { implementation project(':interfaces') //RxAndroidBle - implementation "com.polidea.rxandroidble3:rxandroidble:1.16.0" + implementation "com.polidea.rxandroidble3:rxandroidble:1.17.0" implementation "com.jakewharton.rx3:replaying-share:3.0.0" } \ No newline at end of file From 774ed51e1bb4c06f17eabb2b158941bade719142 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Nov 2022 09:23:46 +0100 Subject: [PATCH 09/42] NSClient v3 initial work, NS v1 improvements * NSCv3 initial work * Allow only 1 NSC * read sgv * NSv3: Read Bolus, Carbs * NSCv3: more work * fix build * loading working * work on TT * TT working * TBR processing * EPS working * PS Sync * Process entries at once. Share code v1,v3 * BolusCalculatorWizard working * TherapyEvent working * process bg at once * improve sync * sdk -> ns-sdk * handle status per version * OffileEvents working * EB working * RemoteDeviceStatus * fix build * cleanup --- app-wear-shared/rx/build.gradle | 14 +- app-wear-shared/shared-impl/build.gradle | 14 +- app-wear-shared/shared/build.gradle | 17 +- app/build.gradle | 20 +- .../nightscout/androidaps/RealPumpTest.kt | 2 +- .../androidaps/SetupWizardActivityTest.kt | 2 +- app/src/main/AndroidManifest.xml | 2 +- .../nightscout/androidaps/MainActivity.kt | 2 +- .../info/nightscout/androidaps/MainApp.kt | 2 + .../activities/MyPreferenceFragment.kt | 17 +- .../nightscout/androidaps/di/AppModule.kt | 8 +- .../androidaps/di/FragmentsModule.kt | 4 +- .../androidaps/di/PluginsListModule.kt | 11 +- .../androidaps/di/ServicesModule.kt | 2 +- .../nightscout/androidaps/di/WorkersModule.kt | 24 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 16 +- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 2 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 2 +- .../configBuilder/ConfigBuilderFragment.kt | 3 +- .../configBuilder/ConfigBuilderPlugin.kt | 116 +-- .../plugins/configBuilder/PluginStore.kt | 24 +- .../configBuilder/ProfileFunctionImpl.kt | 14 +- .../configBuilder/RunningConfiguration.kt | 53 +- .../objectives/ObjectivesPlugin.kt | 64 +- .../objectives/objectives/Objective0.kt | 6 +- .../objectives/objectives/Objective3.kt | 17 +- .../dataBroadcaster/DataBroadcastPlugin.kt | 19 +- .../general/maintenance/MaintenancePlugin.kt | 2 +- .../nsclient/NSClientAddUpdateWorker.kt | 539 ------------- .../general/nsclient/data/DeviceStatusData.kt | 42 - .../general/nsclient/data/NSDeviceStatus.kt | 375 --------- .../nsclient/events/EventNSClientStatus.kt | 8 - .../nsclient/events/EventNSClientUpdateGUI.kt | 5 - .../general/overview/OverviewFragment.kt | 28 +- .../general/overview/StatusLightHandler.kt | 4 +- .../notifications/NotificationWithAction.kt | 4 +- .../plugins/general/wear/WearFragment.kt | 4 +- .../wear/wearintegration/DataHandlerMobile.kt | 45 +- .../sensitivity/SensitivityAAPSPlugin.kt | 11 +- .../sensitivity/SensitivityOref1Plugin.kt | 13 +- .../SensitivityWeightedAveragePlugin.kt | 28 +- .../plugins/source/NSClientSourcePlugin.kt | 101 +-- .../plugins/source/RandomBgPlugin.kt | 6 +- .../nsShared}/NSClientFragment.kt | 57 +- .../plugins/sync/nsShared/StoreDataForDb.kt | 719 ++++++++++++++++++ .../nsShared}/events/EventNSClientNewLog.kt | 5 +- .../nsShared}/events/EventNSClientResend.kt | 2 +- .../nsShared/events/EventNSClientStatus.kt | 9 + .../nsShared/events/EventNSClientUpdateGUI.kt | 5 + .../DataSyncSelectorImplementation.kt | 492 ++++++------ .../nsclient/NSClientAddAckWorker.kt | 63 +- .../sync/nsclient/NSClientAddUpdateWorker.kt | 180 +++++ .../nsclient/NSClientMbgWorker.kt | 31 +- .../nsclient/NSClientPlugin.kt | 116 +-- .../nsclient/NSClientUpdateRemoveAckWorker.kt | 31 +- .../nsclient/NsClientReceiverDelegate.kt | 2 +- .../nsclient/acks/NSAddAck.kt | 4 +- .../nsclient/acks/NSAuthAck.kt | 2 +- .../nsclient/acks/NSUpdateAck.kt | 2 +- .../nsclient/data/AlarmAck.java | 2 +- .../nsclient/data/NSAlarm.kt | 2 +- .../nsclient/data/NSDeviceStatusHandler.kt | 173 +++++ .../plugins/sync}/nsclient/data/NSMbg.kt | 2 +- .../nsclient/data/NSSettingsStatus.kt | 8 +- .../{general => sync}/nsclient/data/NSSgv.kt | 2 +- .../data/ProcessedDeviceStatusData.kt | 211 +++++ .../nsclient/services/NSClientService.kt | 190 ++--- .../sync/nsclientV3/NSClientV3Plugin.kt | 316 ++++++++ .../BolusCalculatorResultExtension.kt | 19 + .../nsclientV3/extensions/BolusExtension.kt | 24 + .../nsclientV3/extensions/CarbsExtension.kt | 16 + .../EffectiveProfileSwitchExtension.kt | 33 + .../extensions/ExtendedBolusExtension.kt | 16 + .../extensions/OfflineEventExtension.kt | 25 + .../extensions/ProfileSwitchExtension.kt | 36 + .../extensions/TemporaryBasalExtension.kt | 27 + .../extensions/TemporaryTargetExtension.kt | 28 + .../extensions/TherapyEventExtension.kt | 68 ++ .../sync/nsclientV3/workers/LoadBgWorker.kt | 100 +++ .../workers/LoadDeviceStatusWorker.kt | 58 ++ .../workers/LoadLastModificationWorker.kt | 39 + .../nsclientV3/workers/LoadStatusWorker.kt | 38 + .../workers/LoadTreatmentsWorker.kt | 97 +++ .../workers/ProcessTreatmentsWorker.kt | 158 ++++ .../tidepool/TidepoolFragment.kt | 20 +- .../tidepool/TidepoolPlugin.kt | 96 +-- .../tidepool/comm/InfoInterceptor.kt | 2 +- .../tidepool/comm/Session.kt | 6 +- .../tidepool/comm/TidepoolApiService.kt | 8 +- .../tidepool/comm/TidepoolCallback.kt | 7 +- .../tidepool/comm/TidepoolUploader.kt | 78 +- .../tidepool/comm/UploadChunk.kt | 20 +- .../tidepool/elements/BasalElement.kt | 2 +- .../tidepool/elements/BaseElement.kt | 2 +- .../tidepool/elements/BloodGlucoseElement.kt | 4 +- .../tidepool/elements/BolusElement.kt | 2 +- .../tidepool/elements/ProfileElement.kt | 5 +- .../tidepool/elements/SensorGlucoseElement.kt | 2 +- .../tidepool/elements/WizardElement.kt | 2 +- .../tidepool/events/EventTidepoolStatus.kt | 2 +- .../tidepool/events/EventTidepoolUpdateGUI.kt | 2 +- .../tidepool/messages/AuthReplyMessage.kt | 2 +- .../tidepool/messages/AuthRequestMessage.kt | 2 +- .../tidepool/messages/BaseMessage.kt | 4 +- .../messages/CloseDatasetRequestMessage.kt | 2 +- .../tidepool/messages/DatasetReplyMessage.kt | 2 +- .../messages/OpenDatasetRequestMessage.kt | 4 +- .../tidepool/messages/UploadReplyMessage.kt | 2 +- .../tidepool/utils/GsonInstance.kt | 2 +- .../tidepool/utils/RateLimit.kt | 2 +- .../androidaps/receivers/KeepAliveWorker.kt | 6 +- .../androidaps/setupwizard/SWDefinition.kt | 410 +++++----- .../setupwizard/SetupWizardActivity.kt | 29 +- .../setupwizard/elements/SWPlugin.kt | 4 +- .../extensions/DeviceStatusExtension.kt | 2 +- .../utils/extensions/TherapyEventExtension.kt | 12 + .../androidaps/utils/tabs/TabPageAdapter.kt | 2 + .../workflow/PreparePredictionsWorker.kt | 8 +- .../main/res/layout/ns_client_fragment.xml | 2 +- app/src/main/res/values/strings.xml | 19 +- .../main/res/xml/pref_nsclientinternal.xml | 9 + .../androidaps/TestBaseWithProfile.kt | 2 +- .../interfaces/ConstraintsCheckerTest.kt | 2 +- .../objectives/ObjectivesPluginTest.kt | 4 +- .../maintenance/MaintenancePluginTest.kt | 2 +- .../nsclient/NsClientReceiverDelegateTest.kt | 2 +- .../tidepool/comm/SessionTest.kt | 7 +- automation/build.gradle | 13 +- .../androidaps/TestBaseWithProfile.kt | 2 +- build.gradle | 1 + core/allopen_dependencies.gradle | 4 + core/android_dependencies.gradle | 4 - core/android_module_dependencies.gradle | 5 - core/build.gradle | 15 +- .../androidaps/dialogs/ProfileViewerDialog.kt | 53 +- .../androidaps/extensions/BolusExtension.kt | 59 +- .../extensions/ExtendedBolusExtension.kt | 94 +-- .../extensions/ProfileSwitchExtension.kt | 121 +-- .../extensions/TemporaryBasalExtension.kt | 70 +- .../extensions/TemporaryTargetExtension.kt | 76 +- .../extensions/TherapyEventExtension.kt | 95 --- .../androidaps/interfaces/ActivePlugin.kt | 11 + .../androidaps/interfaces/DataSyncSelector.kt | 24 +- .../androidaps/interfaces/NsClient.kt | 30 + .../androidaps/interfaces/PluginFragment.kt | 5 + .../androidaps/interfaces/ProfileStore.kt | 6 +- .../nightscout/androidaps/interfaces/Sync.kt | 8 + .../androidaps/logging/UserEntryLogger.kt | 38 +- .../androidaps/receivers/DataWorkerStorage.kt | 6 +- .../receivers/NetworkChangeReceiver.kt | 7 +- .../androidaps/TestBaseWithProfile.kt | 4 +- .../nightscout/androidaps/data/ProfileTest.kt | 29 +- database/build.gradle | 11 +- .../database/entities/TherapyEvent.kt | 56 +- .../transactions/CgmSourceTransaction.kt | 34 +- .../SyncNsBolusCalculatorResultTransaction.kt | 51 +- .../transactions/SyncNsBolusTransaction.kt | 63 +- .../transactions/SyncNsCarbsTransaction.kt | 65 +- ...SyncNsEffectiveProfileSwitchTransaction.kt | 50 +- .../SyncNsExtendedBolusTransaction.kt | 102 +-- .../SyncNsOfflineEventTransaction.kt | 92 +-- .../SyncNsProfileSwitchTransaction.kt | 50 +- .../SyncNsTemporaryBasalTransaction.kt | 78 +- .../SyncNsTemporaryTargetTransaction.kt | 93 +-- .../SyncNsTherapyEventTransaction.kt | 61 +- .../transactions/UserEntryTransaction.kt | 36 +- graphview/build.gradle | 8 +- implementation/build.gradle | 13 +- .../queue/CommandQueueImplementation.kt | 16 +- .../androidaps/TestBaseWithProfile.kt | 4 +- insight/build.gradle | 13 +- interfaces/build.gradle | 16 +- .../info/nightscout/interfaces/Constants.kt | 2 +- .../info/nightscout/interfaces/PluginType.kt | 2 +- ns-sdk/.gitignore | 1 + ns-sdk/build.gradle | 38 + ns-sdk/proguard-rules.pro | 21 + ns-sdk/src/main/AndroidManifest.xml | 4 + .../sdk/NSAndroidCallbackClientImpl.kt | 27 + .../nightscout/sdk/NSAndroidClientImpl.kt | 175 +++++ .../nightscout/sdk/NSAndroidRxClientImpl.kt | 23 + .../DateHeaderOutOfToleranceException.kt | 9 + .../exceptions/InvalidAccessTokenException.kt | 3 + .../sdk/exceptions/NightscoutException.kt | 10 + .../sdk/exceptions/TodoNightscoutException.kt | 3 + .../sdk/interfaces/NSAndroidCallbackClient.kt | 26 + .../sdk/interfaces/NSAndroidClient.kt | 21 + .../sdk/interfaces/NSAndroidRxClient.kt | 19 + .../sdk/localmodel/ApiPermission.kt | 11 + .../sdk/localmodel/ApiPermissions.kt | 10 + .../info/nightscout/sdk/localmodel/Status.kt | 9 + .../info/nightscout/sdk/localmodel/Storage.kt | 3 + .../sdk/localmodel/entry/Direction.kt | 51 ++ .../nightscout/sdk/localmodel/entry/Entry.kt | 13 + .../sdk/localmodel/entry/NSSgvV3.kt | 20 + .../sdk/localmodel/entry/NsUnits.kt | 12 + .../sdk/localmodel/treatment/EventType.kt | 43 ++ .../sdk/localmodel/treatment/GlucoseType.kt | 9 + .../sdk/localmodel/treatment/NSBolus.kt | 36 + .../sdk/localmodel/treatment/NSBolusWizard.kt | 25 + .../sdk/localmodel/treatment/NSCarbs.kt | 24 + .../treatment/NSEffectiveProfileSwitch.kt | 31 + .../localmodel/treatment/NSExtendedBolus.kt | 25 + .../localmodel/treatment/NSOfflineEvent.kt | 39 + .../localmodel/treatment/NSProfileSwitch.kt | 30 + .../localmodel/treatment/NSTemporaryBasal.kt | 43 ++ .../localmodel/treatment/NSTemporaryTarget.kt | 45 ++ .../localmodel/treatment/NSTherapyEvent.kt | 40 + .../sdk/localmodel/treatment/NSTreatment.kt | 29 + .../sdk/mapper/ApiPermissionMapper.kt | 32 + .../sdk/mapper/StatusResponseMapper.kt | 12 + .../nightscout/sdk/mapper/StorageMapper.kt | 6 + .../info/nightscout/sdk/mapper/SvgMapper.kt | 34 + .../nightscout/sdk/mapper/TreatmentMapper.kt | 338 ++++++++ .../sdk/networking/NSAuthInterceptor.kt | 68 ++ .../sdk/networking/NetworkStackBuilder.kt | 93 +++ .../NightscoutAuthRefreshService.kt | 16 + .../sdk/networking/NightscoutRemoteService.kt | 51 ++ .../info/nightscout/sdk/networking/Status.kt | 6 + .../sdk/remotemodel/LastModified.kt | 23 + .../sdk/remotemodel/RemoteAuthResponse.kt | 3 + .../sdk/remotemodel/RemoteDeviceStatus.kt | 67 ++ .../nightscout/sdk/remotemodel/RemoteEntry.kt | 37 + .../sdk/remotemodel/RemoteStatusResponse.kt | 47 ++ .../sdk/remotemodel/RemoteTreatment.kt | 97 +++ .../nightscout/sdk/remotemodel/examples.json | 490 ++++++++++++ .../nightscout/sdk/utils/CoroutineUtils.kt | 22 + .../info/nightscout/sdk/utils/ListUtils.kt | 4 + openhumans/build.gradle | 13 +- plugins/build.gradle | 13 +- .../plugins/general/autotune/AutotuneIob.kt | 80 +- .../general/autotune/AutotunePlugin.kt | 2 +- .../general/autotune/data/ATProfile.kt | 6 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 18 +- .../xdripStatusline/StatusLinePlugin.kt | 2 +- .../plugins/profile/ProfilePlugin.kt | 2 +- .../nsclient/extensions/BolusExtension.kt | 52 ++ .../nsclient}/extensions/CarbsExtension.kt | 15 +- .../EffectiveProfileSwitchExtension.kt | 3 +- .../extensions/ExtendedBolusExtension.kt | 74 ++ .../extensions/OfflineEventExtension.kt | 4 +- .../extensions/ProfileSwitchExtension.kt | 96 +++ .../extensions/TemporaryBasalExtension.kt | 74 ++ .../extensions/TemporaryTargetExtension.kt | 66 ++ .../extensions/TherapyEventExtension.kt | 87 +++ .../androidaps/TestBaseWithProfile.kt | 4 +- pump/combo/build.gradle | 13 +- pump/dana/build.gradle | 13 +- .../androidaps/TestBaseWithProfile.kt | 2 +- pump/danar/build.gradle | 13 +- .../danaRKorean/DanaRKoreanPlugin.kt | 21 +- .../androidaps/danar/DanaRPlugin.java | 2 +- .../androidaps/TestBaseWithProfile.kt | 2 +- pump/danars/build.gradle | 13 +- .../androidaps/TestBaseWithProfile.kt | 2 +- pump/diaconn/build.gradle | 13 +- pump/eopatch/build.gradle | 12 +- pump/medtronic/build.gradle | 13 +- pump/omnipod-common/build.gradle | 14 +- pump/omnipod-dash/build.gradle | 17 +- pump/omnipod-eros/build.gradle | 13 +- pump/pump-common/build.gradle | 13 +- pump/rileylink/build.gradle | 13 +- settings.gradle | 1 + ui/build.gradle | 13 +- .../fragments/TreatmentsBolusCarbsFragment.kt | 2 +- .../fragments/TreatmentsCareportalFragment.kt | 25 +- .../TreatmentsProfileSwitchFragment.kt | 13 +- .../fragments/TreatmentsTempTargetFragment.kt | 2 +- .../ui/defaultProfile/DefaultProfile.kt | 2 +- .../ui/defaultProfile/DefaultProfileDPV.kt | 2 +- .../info/nightscout/ui/dialogs/CareDialog.kt | 69 +- .../nightscout/ui/dialogs/WizardInfoDialog.kt | 2 +- .../androidaps/TestBaseWithProfile.kt | 8 +- wear/build.gradle | 13 +- 275 files changed, 7493 insertions(+), 3433 deletions(-) rename {core => app}/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt (74%) delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/DeviceStatusData.kt delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSDeviceStatus.kt delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientStatus.kt delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientUpdateGUI.kt rename app/src/main/java/info/nightscout/androidaps/plugins/{general/nsclient => sync/nsShared}/NSClientFragment.kt (67%) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt rename {core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient => app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared}/events/EventNSClientNewLog.kt (71%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general/nsclient => sync/nsShared}/events/EventNSClientResend.kt (58%) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/DataSyncSelectorImplementation.kt (69%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/NSClientAddAckWorker.kt (89%) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/NSClientMbgWorker.kt (54%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/NSClientPlugin.kt (71%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/NSClientUpdateRemoveAckWorker.kt (89%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/NsClientReceiverDelegate.kt (98%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/acks/NSAddAck.kt (94%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/acks/NSAuthAck.kt (89%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/acks/NSUpdateAck.kt (94%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/data/AlarmAck.java (72%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/data/NSAlarm.kt (94%) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt rename {core/src/main/java/info/nightscout/androidaps/plugins/general => app/src/main/java/info/nightscout/androidaps/plugins/sync}/nsclient/data/NSMbg.kt (86%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/data/NSSettingsStatus.kt (97%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/data/NSSgv.kt (94%) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/services/NSClientService.kt (80%) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/TidepoolFragment.kt (78%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/TidepoolPlugin.kt (62%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/comm/InfoInterceptor.kt (92%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/comm/Session.kt (81%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/comm/TidepoolApiService.kt (85%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/comm/TidepoolCallback.kt (87%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/comm/TidepoolUploader.kt (77%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/comm/UploadChunk.kt (89%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/elements/BasalElement.kt (93%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/elements/BaseElement.kt (91%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/elements/BloodGlucoseElement.kt (91%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/elements/BolusElement.kt (89%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/elements/ProfileElement.kt (94%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/elements/SensorGlucoseElement.kt (93%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/elements/WizardElement.kt (96%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/events/EventTidepoolStatus.kt (90%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/events/EventTidepoolUpdateGUI.kt (54%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/messages/AuthReplyMessage.kt (89%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/messages/AuthRequestMessage.kt (88%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/messages/BaseMessage.kt (72%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/messages/CloseDatasetRequestMessage.kt (67%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/messages/DatasetReplyMessage.kt (94%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/messages/OpenDatasetRequestMessage.kt (91%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/messages/UploadReplyMessage.kt (52%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/utils/GsonInstance.kt (85%) rename app/src/main/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/utils/RateLimit.kt (93%) rename {core/src/main/java/info/nightscout/androidaps => app/src/main/java/info/nightscout/androidaps/utils}/extensions/DeviceStatusExtension.kt (99%) create mode 100644 app/src/main/java/info/nightscout/androidaps/utils/extensions/TherapyEventExtension.kt rename app/src/test/java/info/nightscout/androidaps/plugins/{general => sync}/nsclient/NsClientReceiverDelegateTest.kt (98%) rename app/src/test/java/info/nightscout/androidaps/plugins/{general => sync}/tidepool/comm/SessionTest.kt (80%) create mode 100644 core/allopen_dependencies.gradle create mode 100644 core/src/main/java/info/nightscout/androidaps/interfaces/NsClient.kt create mode 100644 core/src/main/java/info/nightscout/androidaps/interfaces/PluginFragment.kt create mode 100644 core/src/main/java/info/nightscout/androidaps/interfaces/Sync.kt create mode 100644 ns-sdk/.gitignore create mode 100644 ns-sdk/build.gradle create mode 100644 ns-sdk/proguard-rules.pro create mode 100644 ns-sdk/src/main/AndroidManifest.xml create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidCallbackClientImpl.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidClientImpl.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidRxClientImpl.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/exceptions/DateHeaderOutOfToleranceException.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/exceptions/InvalidAccessTokenException.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/exceptions/NightscoutException.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/exceptions/TodoNightscoutException.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidCallbackClient.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidClient.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidRxClient.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/ApiPermission.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/ApiPermissions.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/Status.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/Storage.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/Direction.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/Entry.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/NSSgvV3.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/NsUnits.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/EventType.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/GlucoseType.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSBolus.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSBolusWizard.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSCarbs.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSEffectiveProfileSwitch.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSExtendedBolus.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSOfflineEvent.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSProfileSwitch.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTemporaryBasal.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTemporaryTarget.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTherapyEvent.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTreatment.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/mapper/ApiPermissionMapper.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/mapper/StatusResponseMapper.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/mapper/StorageMapper.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/mapper/SvgMapper.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/mapper/TreatmentMapper.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/networking/NSAuthInterceptor.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/networking/NetworkStackBuilder.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/networking/NightscoutAuthRefreshService.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/networking/NightscoutRemoteService.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/networking/Status.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/LastModified.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteAuthResponse.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteDeviceStatus.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteEntry.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteStatusResponse.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteTreatment.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/examples.json create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/utils/CoroutineUtils.kt create mode 100644 ns-sdk/src/main/java/info/nightscout/sdk/utils/ListUtils.kt create mode 100644 plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt rename {core/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout/plugins/sync/nsclient}/extensions/CarbsExtension.kt (86%) rename {core/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout/plugins/sync/nsclient}/extensions/EffectiveProfileSwitchExtension.kt (97%) create mode 100644 plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt rename {core/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout/plugins/sync/nsclient}/extensions/OfflineEventExtension.kt (97%) create mode 100644 plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt create mode 100644 plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt create mode 100644 plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt create mode 100644 plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt diff --git a/app-wear-shared/rx/build.gradle b/app-wear-shared/rx/build.gradle index 0a7785a55e..feff93f500 100644 --- a/app-wear-shared/rx/build.gradle +++ b/app-wear-shared/rx/build.gradle @@ -1,9 +1,11 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' -apply plugin: 'kotlinx-serialization' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' + id 'kotlinx-serialization' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" diff --git a/app-wear-shared/shared-impl/build.gradle b/app-wear-shared/shared-impl/build.gradle index aec0dc99b4..ada8320490 100644 --- a/app-wear-shared/shared-impl/build.gradle +++ b/app-wear-shared/shared-impl/build.gradle @@ -1,9 +1,11 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' -apply plugin: 'kotlinx-serialization' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' + id 'kotlinx-serialization' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" diff --git a/app-wear-shared/shared/build.gradle b/app-wear-shared/shared/build.gradle index 43ccc223c5..8556ce1965 100644 --- a/app-wear-shared/shared/build.gradle +++ b/app-wear-shared/shared/build.gradle @@ -1,12 +1,15 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' -apply plugin: 'kotlinx-serialization' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlinx-serialization' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" @@ -31,7 +34,7 @@ dependencies { api 'org.slf4j:slf4j-api:1.7.36' // 2.0.x breaks logging. Code change needed api 'com.github.tony19:logback-android:2.0.0' - api "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1" + api "org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version" api "org.apache.commons:commons-lang3:$commonslang3_version" //RxBus diff --git a/app/build.gradle b/app/build.gradle index 07aabedd6a..45ae641bf4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,10 +1,13 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.google.gms.google-services' -apply plugin: 'com.hiya.jacoco-android' -apply plugin: 'com.google.firebase.crashlytics' +plugins { + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' + id 'kotlinx-serialization' + id 'com.google.gms.google-services' + id 'com.google.firebase.crashlytics' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" @@ -105,7 +108,7 @@ android { defaultConfig { multiDexEnabled true versionCode 1500 - version "3.1.0.3-dev-c" + version "3.1.0.3-dev-c-nscv3" buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' @@ -178,6 +181,7 @@ dependencies { // https://github.com/nightscout/iconify.git implementation project(':graphview') implementation project(':libraries') + implementation project(':ns-sdk') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared-impl') diff --git a/app/src/androidTest/java/info/nightscout/androidaps/RealPumpTest.kt b/app/src/androidTest/java/info/nightscout/androidaps/RealPumpTest.kt index 75ae0caa20..43ff3c41e7 100644 --- a/app/src/androidTest/java/info/nightscout/androidaps/RealPumpTest.kt +++ b/app/src/androidTest/java/info/nightscout/androidaps/RealPumpTest.kt @@ -77,7 +77,7 @@ class RealPumpTest { configBuilderPlugin.performPluginSwitch(loopPlugin, true, PluginType.LOOP) // Enable common - configBuilderPlugin.performPluginSwitch(actionsPlugin, true, PluginType.GENERAL) + configBuilderPlugin.performPluginSwitch(actionsPlugin, true, ) // Disable unneeded MainApp.getPluginsList().remove(objectivesPlugin) diff --git a/app/src/androidTest/java/info/nightscout/androidaps/SetupWizardActivityTest.kt b/app/src/androidTest/java/info/nightscout/androidaps/SetupWizardActivityTest.kt index f20eed392a..ba6a794cab 100644 --- a/app/src/androidTest/java/info/nightscout/androidaps/SetupWizardActivityTest.kt +++ b/app/src/androidTest/java/info/nightscout/androidaps/SetupWizardActivityTest.kt @@ -169,7 +169,7 @@ adb shell settings put global animator_duration_scale 0 & Assert.assertEquals(1.1, p.getBasalTimeFromMidnight(0), 0.0001) Assert.assertEquals(6.0 * Constants.MMOLL_TO_MGDL, p.targetLowMgdl, 0.0001) Assert.assertTrue(VirtualPumpPlugin.getPlugin().isEnabled(PluginType.PUMP)) - Assert.assertTrue(OpenAPSSMBPlugin.getPlugin().isEnabled(PluginType.APS)) + Assert.assertTrue(OpenAPSSMBPlugin.getPlugin().isEnabled()) Assert.assertTrue(LoopPlugin.getPlugin().isEnabled(PluginType.LOOP)) Assert.assertTrue(SensitivityOref1Plugin.getPlugin().isEnabled(PluginType.SENSITIVITY)) Assert.assertTrue(ObjectivesPlugin.objectives[0].isStarted) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ca9466e1ea..93f9a92669 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -172,7 +172,7 @@ { 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 8d3db01287..759c30d795 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -36,9 +36,6 @@ import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDyn import info.nightscout.androidaps.plugins.configBuilder.PluginStore import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin -import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus -import info.nightscout.androidaps.plugins.general.tidepool.TidepoolPlugin import info.nightscout.androidaps.plugins.general.wear.WearPlugin import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin import info.nightscout.androidaps.plugins.pump.eopatch.EopatchPumpPlugin @@ -56,6 +53,10 @@ 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 @@ -97,6 +98,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang @Inject lateinit var localInsightPlugin: LocalInsightPlugin @Inject lateinit var medtronicPumpPlugin: MedtronicPumpPlugin @Inject lateinit var nsClientPlugin: NSClientPlugin + @Inject lateinit var nsClientV3Plugin: NSClientV3Plugin @Inject lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin @Inject lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin @Inject lateinit var openAPSSMBDynamicISFPlugin: OpenAPSSMBDynamicISFPlugin @@ -212,6 +214,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang addPreferencesFromResourceIfEnabled(virtualPumpPlugin, rootKey) addPreferencesFromResourceIfEnabled(insulinOrefFreePeakPlugin, rootKey) addPreferencesFromResourceIfEnabled(nsClientPlugin, rootKey) + addPreferencesFromResourceIfEnabled(nsClientV3Plugin, rootKey) addPreferencesFromResourceIfEnabled(tidepoolPlugin, rootKey) addPreferencesFromResourceIfEnabled(smsCommunicatorPlugin, rootKey) addPreferencesFromResourceIfEnabled(automationPlugin, rootKey) @@ -328,13 +331,11 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang var visible = false if (p is PreferenceGroup) { - for (i in 0 until p.preferenceCount) { + for (i in 0 until p.preferenceCount) visible = updateFilterVisibility(filter, p.getPreference(i)) || visible - } - if (visible && p is PreferenceCategory) { - p.initialExpandedChildrenCount = Int.MAX_VALUE - } + if (visible && p is PreferenceCategory) p.initialExpandedChildrenCount = Int.MAX_VALUE } else { + @Suppress("KotlinConstantConditions") visible = visible || p.key?.contains(filter, true) == true visible = visible || p.title?.contains(filter, true) == true visible = visible || p.summary?.contains(filter, true) == true 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 35789d6948..df429cd091 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -43,10 +43,10 @@ import info.nightscout.androidaps.plugins.configBuilder.PluginStore 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.general.nsclient.DataSyncSelectorImplementation -import info.nightscout.androidaps.plugins.general.nsclient.data.DeviceStatusData 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.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits @@ -115,11 +115,11 @@ open class AppModule { aapsLogger: AAPSLogger, sp: SP, rxBus: RxBus, rh: ResourceHelper, activePlugin: ActivePlugin, repository: AppRepository, dateUtil: DateUtil, config: Config, hardLimits: HardLimits, - aapsSchedulers: AapsSchedulers, fabricPrivacy: FabricPrivacy, deviceStatusData: DeviceStatusData + aapsSchedulers: AapsSchedulers, fabricPrivacy: FabricPrivacy, processedDeviceStatusData: ProcessedDeviceStatusData ): ProfileFunction = ProfileFunctionImpl( aapsLogger, sp, rxBus, rh, activePlugin, repository, dateUtil, - config, hardLimits, aapsSchedulers, fabricPrivacy, deviceStatusData + config, hardLimits, aapsSchedulers, fabricPrivacy, processedDeviceStatusData ) @Provides 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 756d619ac5..5765478431 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/FragmentsModule.kt @@ -20,13 +20,13 @@ import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragm import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog import info.nightscout.androidaps.plugins.general.actions.ActionsFragment import info.nightscout.androidaps.plugins.general.maintenance.MaintenanceFragment -import info.nightscout.androidaps.plugins.general.nsclient.NSClientFragment import info.nightscout.androidaps.plugins.general.overview.OverviewFragment import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog -import info.nightscout.androidaps.plugins.general.tidepool.TidepoolFragment 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 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 81af39bf17..a8eecb1e3d 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt @@ -21,10 +21,8 @@ import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin import info.nightscout.androidaps.plugins.general.actions.ActionsPlugin import info.nightscout.androidaps.plugins.general.dataBroadcaster.DataBroadcastPlugin import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin -import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin import info.nightscout.androidaps.plugins.general.overview.OverviewPlugin import info.nightscout.androidaps.plugins.general.persistentNotification.PersistentNotificationPlugin -import info.nightscout.androidaps.plugins.general.tidepool.TidepoolPlugin import info.nightscout.androidaps.plugins.general.wear.WearPlugin import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.androidaps.plugins.pump.combo.ComboPlugin @@ -48,6 +46,9 @@ 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 @@ -316,6 +317,12 @@ abstract class PluginsListModule { @IntKey(368) abstract fun bindTidepoolPlugin(plugin: TidepoolPlugin): PluginBase + @Binds + @Unfinished + @IntoMap + @IntKey(362) + abstract fun bindNSClientV3Plugin(plugin: NSClientV3Plugin): PluginBase + @Binds @AllConfigs @IntoMap 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 83dcefc853..dab1c764e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.di import dagger.Module import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.plugins.general.nsclient.services.NSClientService +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 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 a4cf47a767..ad9b25c340 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/WorkersModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/WorkersModule.kt @@ -3,11 +3,6 @@ package info.nightscout.androidaps.di import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.plugins.general.maintenance.ImportExportPrefsImpl -import info.nightscout.androidaps.plugins.general.nsclient.NSClientAddAckWorker -import info.nightscout.androidaps.plugins.general.nsclient.NSClientAddUpdateWorker -import info.nightscout.androidaps.plugins.general.nsclient.NSClientMbgWorker -import info.nightscout.androidaps.plugins.general.nsclient.NSClientUpdateRemoveAckWorker -import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.androidaps.plugins.source.AidexPlugin import info.nightscout.androidaps.plugins.source.DexcomPlugin import info.nightscout.androidaps.plugins.source.EversensePlugin @@ -17,6 +12,18 @@ 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 @Suppress("unused") @@ -37,4 +44,11 @@ abstract class WorkersModule { @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 271bb0a073..5a34e252df 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 @@ -13,7 +13,6 @@ import android.os.SystemClock import androidx.core.app.NotificationCompat import dagger.android.HasAndroidInjector import info.nightscout.androidaps.BuildConfig -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting @@ -27,22 +26,17 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.androidaps.extensions.buildDeviceStatus import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.extensions.plannedRemainingMinutes 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.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Loop.LastRun 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.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpDescription @@ -55,14 +49,20 @@ import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotifi 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.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.extensions.buildDeviceStatus +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAcceptOpenLoopChange diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index 9fe186b0a7..14797d64db 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -100,7 +100,7 @@ class OpenAPSAMAPlugin @Inject constructor( aapsLogger.debug(LTag.APS, rh.gs(R.string.noprofileset)) return } - if (!isEnabled(PluginType.APS)) { + if (!isEnabled()) { rxBus.send(EventOpenAPSUpdateResultGui(rh.gs(R.string.openapsma_disabled))) aapsLogger.debug(LTag.APS, rh.gs(R.string.openapsma_disabled)) return diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index dec26786ee..5d70de8377 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -109,7 +109,7 @@ class OpenAPSSMBPlugin @Inject constructor( aapsLogger.debug(LTag.APS, rh.gs(R.string.noprofileset)) return } - if (!isEnabled(PluginType.APS)) { + if (!isEnabled()) { rxBus.send(EventOpenAPSUpdateResultGui(rh.gs(R.string.openapsma_disabled))) aapsLogger.debug(LTag.APS, rh.gs(R.string.openapsma_disabled)) return diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt index e68d37f28a..ba1cd689fe 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt @@ -114,6 +114,7 @@ class ConfigBuilderFragment : DaggerFragment() { createViewsForPlugins(R.string.configbuilder_loop, R.string.configbuilder_loop_description, PluginType.LOOP, activePlugin.getSpecificPluginsVisibleInList(PluginType.LOOP)) createViewsForPlugins(R.string.constraints, R.string.configbuilder_constraints_description, PluginType.CONSTRAINTS, activePlugin.getSpecificPluginsVisibleInList(PluginType.CONSTRAINTS)) } + createViewsForPlugins(R.string.configbuilder_sync, R.string.configbuilder_sync_description, PluginType.SYNC, activePlugin.getSpecificPluginsVisibleInList(PluginType.SYNC)) createViewsForPlugins(R.string.configbuilder_general, R.string.configbuilder_general_description, PluginType.GENERAL, activePlugin.getSpecificPluginsVisibleInList(PluginType.GENERAL)) } @@ -208,7 +209,7 @@ class ConfigBuilderFragment : DaggerFragment() { } private fun areMultipleSelectionsAllowed(type: PluginType): Boolean { - return type == PluginType.GENERAL || type == PluginType.CONSTRAINTS || type == PluginType.LOOP + return type == PluginType.GENERAL || type == PluginType.CONSTRAINTS || type == PluginType.LOOP || type == PluginType.SYNC } } 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 2cceb145b4..c22ac4fbc5 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 @@ -11,9 +11,8 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Insulin +import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpSync @@ -22,6 +21,8 @@ import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppInitialized import info.nightscout.rx.events.EventConfigBuilderChange @@ -44,15 +45,15 @@ class ConfigBuilderPlugin @Inject constructor( private val pumpSync: PumpSync ) : PluginBase( PluginDescription() - .mainType(PluginType.GENERAL) - .fragmentClass(ConfigBuilderFragment::class.java.name) - .showInList(true) - .alwaysEnabled(true) - .alwaysVisible(false) - .pluginIcon(R.drawable.ic_cogs) - .pluginName(R.string.configbuilder) - .shortName(R.string.configbuilder_shortname) - .description(R.string.description_config_builder), + .mainType(PluginType.GENERAL) + .fragmentClass(ConfigBuilderFragment::class.java.name) + .showInList(true) + .alwaysEnabled(true) + .alwaysVisible(false) + .pluginIcon(R.drawable.ic_cogs) + .pluginName(R.string.configbuilder) + .shortName(R.string.configbuilder_shortname) + .description(R.string.description_config_builder), aapsLogger, rh, injector ), ConfigBuilder { @@ -77,58 +78,60 @@ class ConfigBuilderPlugin @Inject constructor( val type = p.getType() if (p.pluginDescription.alwaysEnabled && p.pluginDescription.alwaysVisible) continue if (p.pluginDescription.alwaysEnabled && p.pluginDescription.neverVisible) continue - savePref(p, type, true) + savePref(p, type) } } - private fun savePref(p: PluginBase, type: PluginType, storeVisible: Boolean) { + private fun savePref(p: PluginBase, type: PluginType) { val settingEnabled = "ConfigBuilder_" + type.name + "_" + p.javaClass.simpleName + "_Enabled" sp.putBoolean(settingEnabled, p.isEnabled()) aapsLogger.debug(LTag.CONFIGBUILDER, "Storing: " + settingEnabled + ":" + p.isEnabled()) - if (storeVisible) { - val settingVisible = "ConfigBuilder_" + type.name + "_" + p.javaClass.simpleName + "_Visible" - sp.putBoolean(settingVisible, p.isFragmentVisible()) - aapsLogger.debug(LTag.CONFIGBUILDER, "Storing: " + settingVisible + ":" + p.isFragmentVisible()) - } + val settingVisible = "ConfigBuilder_" + type.name + "_" + p.javaClass.simpleName + "_Visible" + sp.putBoolean(settingVisible, p.isFragmentVisible()) + aapsLogger.debug(LTag.CONFIGBUILDER, "Storing: " + settingVisible + ":" + p.isFragmentVisible()) } private fun loadSettings() { aapsLogger.debug(LTag.CONFIGBUILDER, "Loading stored settings") for (p in activePlugin.getPluginsList()) { val type = p.getType() - loadPref(p, type, true) + loadPref(p, type) } activePlugin.verifySelectionInCategories() } - private fun loadPref(p: PluginBase, type: PluginType, loadVisible: Boolean) { + private fun loadPref(p: PluginBase, type: PluginType) { val settingEnabled = "ConfigBuilder_" + type.name + "_" + p.javaClass.simpleName + "_Enabled" - if (sp.contains(settingEnabled)) p.setPluginEnabled(type, sp.getBoolean(settingEnabled, false)) else if (p.getType() == type && (p.pluginDescription.enableByDefault || p.pluginDescription.alwaysEnabled)) { + if (sp.contains(settingEnabled)) p.setPluginEnabled( + type, + sp.getBoolean(settingEnabled, false) + ) else if (p.getType() == type && (p.pluginDescription.enableByDefault || p.pluginDescription.alwaysEnabled)) { p.setPluginEnabled(type, true) } aapsLogger.debug(LTag.CONFIGBUILDER, "Loaded: " + settingEnabled + ":" + p.isEnabled(type)) - if (loadVisible) { - val settingVisible = "ConfigBuilder_" + type.name + "_" + p.javaClass.simpleName + "_Visible" - if (sp.contains(settingVisible)) p.setFragmentVisible(type, sp.getBoolean(settingVisible, false) && sp.getBoolean(settingEnabled, false)) else if (p.getType() == type && p.pluginDescription.visibleByDefault) { - p.setFragmentVisible(type, true) - } - aapsLogger.debug(LTag.CONFIGBUILDER, "Loaded: " + settingVisible + ":" + p.isFragmentVisible()) + val settingVisible = "ConfigBuilder_" + type.name + "_" + p.javaClass.simpleName + "_Visible" + if (sp.contains(settingVisible)) p.setFragmentVisible( + type, + sp.getBoolean(settingVisible, false) && sp.getBoolean(settingEnabled, false) + ) else if (p.getType() == type && p.pluginDescription.visibleByDefault) { + p.setFragmentVisible(type, true) } + aapsLogger.debug(LTag.CONFIGBUILDER, "Loaded: " + settingVisible + ":" + p.isFragmentVisible()) } fun logPluginStatus() { for (p in activePlugin.getPluginsList()) { aapsLogger.debug( LTag.CONFIGBUILDER, p.name + ":" + - (if (p.isEnabled(PluginType.GENERAL)) " GENERAL" else "") + - (if (p.isEnabled(PluginType.SENSITIVITY)) " SENSITIVITY" else "") + - (if (p.isEnabled(PluginType.PROFILE)) " PROFILE" else "") + - (if (p.isEnabled(PluginType.APS)) " APS" else "") + - (if (p.isEnabled(PluginType.PUMP)) " PUMP" else "") + - (if (p.isEnabled(PluginType.CONSTRAINTS)) " CONSTRAINTS" else "") + - (if (p.isEnabled(PluginType.LOOP)) " LOOP" else "") + - (if (p.isEnabled(PluginType.BGSOURCE)) " BGSOURCE" else "") + - if (p.isEnabled(PluginType.INSULIN)) " INSULIN" else "" + (if (p.isEnabled(PluginType.GENERAL)) " GENERAL" else "") + + (if (p.isEnabled(PluginType.SENSITIVITY)) " SENSITIVITY" else "") + + (if (p.isEnabled(PluginType.PROFILE)) " PROFILE" else "") + + (if (p.isEnabled(PluginType.APS)) " APS" else "") + + (if (p.isEnabled(PluginType.PUMP)) " PUMP" else "") + + (if (p.isEnabled(PluginType.CONSTRAINTS)) " CONSTRAINTS" else "") + + (if (p.isEnabled(PluginType.LOOP)) " LOOP" else "") + + (if (p.isEnabled(PluginType.BGSOURCE)) " BGSOURCE" else "") + + if (p.isEnabled(PluginType.INSULIN)) " INSULIN" else "" ) } } @@ -153,36 +156,41 @@ class ConfigBuilderPlugin @Inject constructor( performPluginSwitch(changedPlugin, newState, type) pumpSync.connectNewPump() sp.putBoolean("allow_hardware_pump", true) - uel.log(Action.HW_PUMP_ALLOWED, Sources.ConfigBuilder, rh.gs(changedPlugin.pluginDescription.pluginName), - ValueWithUnit.SimpleString(rh.gsNotLocalised(changedPlugin.pluginDescription.pluginName))) + uel.log( + Action.HW_PUMP_ALLOWED, Sources.ConfigBuilder, rh.gs(changedPlugin.pluginDescription.pluginName), + ValueWithUnit.SimpleString(rh.gsNotLocalised(changedPlugin.pluginDescription.pluginName)) + ) aapsLogger.debug(LTag.PUMP, "First time HW pump allowed!") }, { - rxBus.send(EventConfigBuilderUpdateGui()) - aapsLogger.debug(LTag.PUMP, "User does not allow switching to HW pump!") - }) + rxBus.send(EventConfigBuilderUpdateGui()) + aapsLogger.debug(LTag.PUMP, "User does not allow switching to HW pump!") + }) } } override fun performPluginSwitch(changedPlugin: PluginBase, enabled: Boolean, type: PluginType) { - if(enabled && !changedPlugin.isEnabled()) { - uel.log(Action.PLUGIN_ENABLED, Sources.ConfigBuilder, rh.gs(changedPlugin.pluginDescription.pluginName), - ValueWithUnit.SimpleString(rh.gsNotLocalised(changedPlugin.pluginDescription.pluginName))) - } - else if(!enabled) { - uel.log(Action.PLUGIN_DISABLED, Sources.ConfigBuilder, rh.gs(changedPlugin.pluginDescription.pluginName), - ValueWithUnit.SimpleString(rh.gsNotLocalised(changedPlugin.pluginDescription.pluginName))) + if (enabled && !changedPlugin.isEnabled()) { + uel.log( + Action.PLUGIN_ENABLED, Sources.ConfigBuilder, rh.gs(changedPlugin.pluginDescription.pluginName), + ValueWithUnit.SimpleString(rh.gsNotLocalised(changedPlugin.pluginDescription.pluginName)) + ) + } else if (!enabled) { + uel.log( + Action.PLUGIN_DISABLED, Sources.ConfigBuilder, rh.gs(changedPlugin.pluginDescription.pluginName), + ValueWithUnit.SimpleString(rh.gsNotLocalised(changedPlugin.pluginDescription.pluginName)) + ) } changedPlugin.setPluginEnabled(type, enabled) changedPlugin.setFragmentVisible(type, enabled) processOnEnabledCategoryChanged(changedPlugin, type) - storeSettings("CheckedCheckboxEnabled") + storeSettings("RemoteConfiguration") rxBus.send(EventRebuildTabs()) rxBus.send(EventConfigBuilderChange()) rxBus.send(EventConfigBuilderUpdateGui()) logPluginStatus() } - fun processOnEnabledCategoryChanged(changedPlugin: PluginBase, type: PluginType?) { + fun processOnEnabledCategoryChanged(changedPlugin: PluginBase, type: PluginType) { var pluginsInCategory: ArrayList? = null when (type) { PluginType.INSULIN -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(Insulin::class.java) @@ -191,12 +199,14 @@ class ConfigBuilderPlugin @Inject constructor( PluginType.PROFILE -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(ProfileSource::class.java) PluginType.BGSOURCE -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(BgSource::class.java) PluginType.PUMP -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(Pump::class.java) + // Process only NSClients + PluginType.SYNC -> pluginsInCategory = activePlugin.getSpecificPluginsListByInterface(NsClient::class.java) else -> { } } if (pluginsInCategory != null) { - val newSelection = changedPlugin.isEnabled(type!!) + val newSelection = changedPlugin.isEnabled(type) if (newSelection) { // new plugin selected -> disable others for (p in pluginsInCategory) { if (p.name == changedPlugin.name) { @@ -206,7 +216,9 @@ class ConfigBuilderPlugin @Inject constructor( p.setFragmentVisible(type, false) } } - } else { // enable first plugin in list + } else if (type != PluginType.SYNC) { + // enable first plugin in list + // NSC must not be selected pluginsInCategory[0].setPluginEnabled(type, true) } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt index d00bd1f231..a800d7e8b1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt @@ -3,16 +3,18 @@ package info.nightscout.androidaps.plugins.configBuilder import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.IobCobCalculator +import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.Overview import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.Safety import info.nightscout.androidaps.interfaces.Sensitivity +import info.nightscout.androidaps.interfaces.Sync +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.Safety import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import javax.inject.Inject @@ -133,8 +135,9 @@ class PluginStore @Inject constructor( setFragmentVisibilities((activePumpStore as PluginBase).name, pluginsInCategory, PluginType.PUMP) } - private fun setFragmentVisibilities(activePluginName: String, pluginsInCategory: ArrayList, - pluginType: PluginType + private fun setFragmentVisibilities( + activePluginName: String, pluginsInCategory: ArrayList, + pluginType: PluginType ) { aapsLogger.debug(LTag.CONFIGBUILDER, "Selected interface: $activePluginName") for (p in pluginsInCategory) @@ -185,6 +188,17 @@ class PluginStore @Inject constructor( override val activeIobCobCalculator: IobCobCalculator get() = getSpecificPluginsListByInterface(IobCobCalculator::class.java).first() as IobCobCalculator + override val activeNsClient: NsClient? + get() = getTheOneEnabledInArray(getSpecificPluginsListByInterface(NsClient::class.java), PluginType.SYNC) as NsClient? + + @Suppress("UNCHECKED_CAST") + override val firstActiveSync: Sync? + get() = (getSpecificPluginsList(PluginType.SYNC) as ArrayList).firstOrNull { it.connected } + + @Suppress("UNCHECKED_CAST") + override val activeSyncs: ArrayList + get() = getSpecificPluginsList(PluginType.SYNC) as ArrayList + override fun getPluginsList(): ArrayList = ArrayList(plugins) } 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 f00593b60c..cd028221c4 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 @@ -1,6 +1,5 @@ package info.nightscout.androidaps.plugins.configBuilder -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.core.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository @@ -8,19 +7,20 @@ import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.database.transactions.InsertOrUpdateProfileSwitch import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged -import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config 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.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.nsclient.data.DeviceStatusData +import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.extensions.fromConstant +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger @@ -45,7 +45,7 @@ class ProfileFunctionImpl @Inject constructor( private val hardLimits: HardLimits, aapsSchedulers: AapsSchedulers, private val fabricPrivacy: FabricPrivacy, - private val deviceStatusData: DeviceStatusData + private val processedDeviceStatusData: ProcessedDeviceStatusData ) : ProfileFunction { private var cache = ConcurrentHashMap() @@ -117,7 +117,7 @@ class ProfileFunctionImpl @Inject constructor( // Try to get it from device status // Remove this code after switch to api v3 if (config.NSCLIENT && ps is ValueWrapper.Absent) { - deviceStatusData.pumpData?.activeProfileName?.let { activeProfile -> + processedDeviceStatusData.pumpData?.activeProfileName?.let { activeProfile -> activePlugin.activeProfileSource.profile?.getSpecificProfile(activeProfile)?.let { ap -> val sealed = ProfileSealed.Pure(ap) synchronized(cache) { @@ -183,7 +183,7 @@ class ProfileFunctionImpl @Inject constructor( val profileStore = activePlugin.activeProfileSource.profile ?: return false val ps = buildProfileSwitch(profileStore, profile.profileName, durationInMinutes, percentage, 0, dateUtil.now()) ?: return false val validity = ProfileSealed.PS(ps).isValid( - rh.gs(info.nightscout.automation.R.string.careportal_profileswitch), + rh.gs(R.string.careportal_profileswitch), activePlugin.activePump, config, rh, diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt similarity index 74% rename from core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt index e48d0434ee..4d1db04996 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt @@ -2,21 +2,22 @@ package info.nightscout.androidaps.plugins.configBuilder import info.nightscout.androidaps.core.R import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.interfaces.PluginType +import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientNewLog 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.interfaces.utils.JsonHelper +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.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.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject @@ -66,17 +67,16 @@ class RunningConfiguration @Inject constructor( } // called in NSClient mode only - fun apply(configuration: JSONObject) { + fun apply(configuration: RemoteDeviceStatus.Configuration, version: NsClient.Version) { assert(config.NSCLIENT) - if (configuration.has("version")) { - rxBus.send(EventNSClientNewLog("VERSION", "Received AndroidAPS version ${configuration.getString("version")}")) - if (config.VERSION_NAME.startsWith(configuration.getString("version")).not()) { + configuration.version?.let { + rxBus.send(EventNSClientNewLog("VERSION", "Received AndroidAPS version $it", version)) + if (config.VERSION_NAME.startsWith(it).not()) rxBus.send(EventNewNotification(Notification(Notification.NSCLIENT_VERSION_DOES_NOT_MATCH, rh.gs(R.string.nsclient_version_does_not_match), Notification.NORMAL))) - } } - if (configuration.has("insulin")) { - val insulin = Insulin.InsulinType.fromInt(JsonHelper.safeGetInt(configuration, "insulin", Insulin.InsulinType.UNKNOWN.value)) + configuration.insulin?.let { + val insulin = Insulin.InsulinType.fromInt(it) for (p in activePlugin.getSpecificPluginsListByInterface(Insulin::class.java)) { val insulinPlugin = p as Insulin if (insulinPlugin.id == insulin) { @@ -84,13 +84,13 @@ class RunningConfiguration @Inject constructor( aapsLogger.debug(LTag.CORE, "Changing insulin plugin to ${insulin.name}") configBuilder.performPluginSwitch(p, true, PluginType.INSULIN) } - insulinPlugin.applyConfiguration(configuration.getJSONObject("insulinConfiguration")) + configuration.insulinConfiguration?.let { ic -> insulinPlugin.applyConfiguration(ic) } } } } - if (configuration.has("sensitivity")) { - val sensitivity = Sensitivity.SensitivityType.fromInt(JsonHelper.safeGetInt(configuration, "sensitivity", Sensitivity.SensitivityType.UNKNOWN.value)) + configuration.sensitivity?.let { + val sensitivity = Sensitivity.SensitivityType.fromInt(it) for (p in activePlugin.getSpecificPluginsListByInterface(Sensitivity::class.java)) { val sensitivityPlugin = p as Sensitivity if (sensitivityPlugin.id == sensitivity) { @@ -98,25 +98,26 @@ class RunningConfiguration @Inject constructor( aapsLogger.debug(LTag.CORE, "Changing sensitivity plugin to ${sensitivity.name}") configBuilder.performPluginSwitch(p, true, PluginType.SENSITIVITY) } - sensitivityPlugin.applyConfiguration(configuration.getJSONObject("sensitivityConfiguration")) + configuration.sensitivityConfiguration?.let { sc -> sensitivityPlugin.applyConfiguration(sc) } } } } - if (configuration.has("pump")) { - val pumpType = JsonHelper.safeGetString(configuration, "pump", PumpType.GENERIC_AAPS.description) - if (sp.getString(R.string.key_virtualpump_type, "fake") != pumpType) { - sp.putString(R.string.key_virtualpump_type, pumpType) - activePlugin.activePump.pumpDescription.fillFor(PumpType.getByDescription(pumpType)) + configuration.pump?.let { + if (sp.getString(R.string.key_virtualpump_type, "fake") != it) { + sp.putString(R.string.key_virtualpump_type, it) + activePlugin.activePump.pumpDescription.fillFor(PumpType.getByDescription(it)) pumpSync.connectNewPump(endRunning = false) // do not end running TBRs, we call this only to accept data properly - aapsLogger.debug(LTag.CORE, "Changing pump type to $pumpType") + aapsLogger.debug(LTag.CORE, "Changing pump type to $it") } } - if (configuration.has("overviewConfiguration")) - activePlugin.activeOverview.applyConfiguration(configuration.getJSONObject("overviewConfiguration")) + configuration.overviewConfiguration?.let { + activePlugin.activeOverview.applyConfiguration(it) + } - if (configuration.has("safetyConfiguration")) - activePlugin.activeSafety.applyConfiguration(configuration.getJSONObject("safetyConfiguration")) + configuration.safetyConfiguration?.let { + activePlugin.activeSafety.applyConfiguration(it) + } } } \ No newline at end of file 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 32db320167..94e02b782f 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 @@ -1,22 +1,12 @@ package info.nightscout.androidaps.plugins.constraints.objectives -import androidx.fragment.app.FragmentActivity -import com.google.common.base.Charsets -import com.google.common.hash.Hashing import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.logging.UserEntryLogger 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 @@ -28,11 +18,11 @@ import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Obje import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective6 import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective7 import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective9 -import info.nightscout.androidaps.utils.DateUtil -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.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP -import java.util.Locale import javax.inject.Inject import javax.inject.Singleton @@ -43,19 +33,17 @@ class ObjectivesPlugin @Inject constructor( rh: ResourceHelper, private val activePlugin: ActivePlugin, private val sp: SP, - config: Config, - private val dateUtil: DateUtil, - private val uel: UserEntryLogger + config: Config ) : PluginBase( PluginDescription() - .mainType(PluginType.CONSTRAINTS) - .fragmentClass(ObjectivesFragment::class.qualifiedName) - .alwaysEnabled(config.APS) - .showInList(config.APS) - .pluginIcon(R.drawable.ic_graduation) - .pluginName(R.string.objectives) - .shortName(R.string.objectives_shortname) - .description(R.string.description_objectives), + .mainType(PluginType.CONSTRAINTS) + .fragmentClass(ObjectivesFragment::class.qualifiedName) + .alwaysEnabled(config.APS) + .showInList(config.APS) + .pluginIcon(R.drawable.ic_graduation) + .pluginName(R.string.objectives) + .shortName(R.string.objectives_shortname) + .description(R.string.description_objectives), aapsLogger, rh, injector ), Constraints { @@ -115,34 +103,6 @@ class ObjectivesPlugin @Inject constructor( sp.putBoolean(R.string.key_objectiveusescale, false) } - fun completeObjectives(activity: FragmentActivity, request: String) { - val requestCode = sp.getString(R.string.key_objectives_request_code, "") - var url = sp.getString(R.string.key_nsclientinternal_url, "").lowercase(Locale.getDefault()) - if (!url.endsWith("/")) url = "$url/" - @Suppress("DEPRECATION", "UnstableApiUsage") val hashNS = Hashing.sha1().hashString(url + BuildConfig.APPLICATION_ID + "/" + requestCode, Charsets.UTF_8).toString() - if (request.equals(hashNS.substring(0, 10), ignoreCase = true)) { - sp.putLong("Objectives_" + "openloop" + "_started", dateUtil.now()) - sp.putLong("Objectives_" + "openloop" + "_accomplished", dateUtil.now()) - sp.putLong("Objectives_" + "maxbasal" + "_started", dateUtil.now()) - sp.putLong("Objectives_" + "maxbasal" + "_accomplished", dateUtil.now()) - sp.putLong("Objectives_" + "maxiobzero" + "_started", dateUtil.now()) - sp.putLong("Objectives_" + "maxiobzero" + "_accomplished", dateUtil.now()) - sp.putLong("Objectives_" + "maxiob" + "_started", dateUtil.now()) - sp.putLong("Objectives_" + "maxiob" + "_accomplished", dateUtil.now()) - sp.putLong("Objectives_" + "autosens" + "_started", dateUtil.now()) - sp.putLong("Objectives_" + "autosens" + "_accomplished", dateUtil.now()) - sp.putLong("Objectives_" + "smb" + "_started", dateUtil.now()) - sp.putLong("Objectives_" + "smb" + "_accomplished", dateUtil.now()) - sp.putLong("Objectives_" + "auto" + "_started", dateUtil.now()) - sp.putLong("Objectives_" + "auto" + "_accomplished", dateUtil.now()) - setupObjectives() - OKDialog.show(activity, rh.gs(R.string.objectives), rh.gs(R.string.codeaccepted)) - uel.log(Action.OBJECTIVES_SKIPPED, Sources.Objectives) - } else { - OKDialog.show(activity, rh.gs(R.string.objectives), rh.gs(R.string.codeinvalid)) - } - } - fun allPriorAccomplished(position: Int): Boolean { var accomplished = true for (i in 0 until position) { 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 bd2eb4d345..9071d4eda3 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,6 @@ 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.general.nsclient.NSClientPlugin import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import javax.inject.Inject @@ -18,7 +17,6 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R @Inject lateinit var virtualPumpPlugin: VirtualPumpPlugin @Inject lateinit var repository: AppRepository @Inject lateinit var loop: Loop - @Inject lateinit var nsClientPlugin: NSClientPlugin @Inject lateinit var iobCobCalculator: IobCobCalculator init { @@ -27,9 +25,9 @@ class Objective0(injector: HasAndroidInjector) : Objective(injector, "config", R return sp.getBoolean(R.string.key_ObjectivesbgIsAvailableInNS, false) } }) - tasks.add(object : Task(this, R.string.nsclienthaswritepermission) { + tasks.add(object : Task(this, R.string.synchaswritepermission) { override fun isCompleted(): Boolean { - return nsClientPlugin.hasWritePermission() + return activePlugin.firstActiveSync?.hasWritePermission == true } }) tasks.add(object : Task(this, R.string.virtualpump_uploadstatus_title) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt index 1808666fad..5a89f50ff9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt @@ -1,18 +1,15 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives -import androidx.fragment.app.FragmentActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin -import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin +import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.utils.T import javax.inject.Inject @Suppress("SpellCheckingInspection") class Objective3 @Inject constructor(injector: HasAndroidInjector) : Objective(injector, "openloop", R.string.objectives_openloop_objective, R.string.objectives_openloop_gate) { - @Inject lateinit var objectivesPlugin: ObjectivesPlugin - @Inject lateinit var nsClientPlugin: NSClientPlugin + @Inject lateinit var activePlugin: ActivePlugin init { tasks.add(MinimumDurationTask(this, T.days(7).msecs())) @@ -22,17 +19,11 @@ class Objective3 @Inject constructor(injector: HasAndroidInjector) : Objective(i } override val progress: String - get() = if (sp.getInt(R.string.key_ObjectivesmanualEnacts, 0) >= MANUAL_ENACTS_NEEDED) rh.gs(R.string.completed_well_done) else sp.getInt(R.string.key_ObjectivesmanualEnacts, 0).toString() + " / " + MANUAL_ENACTS_NEEDED + get() = if (sp.getInt(R.string.key_ObjectivesmanualEnacts, 0) >= MANUAL_ENACTS_NEEDED) rh.gs(R.string.completed_well_done) else sp.getInt(R.string.key_ObjectivesmanualEnacts, 0) + .toString() + " / " + MANUAL_ENACTS_NEEDED }) } - override fun specialActionEnabled(): Boolean = - nsClientPlugin.nsClientService?.isConnected == true && nsClientPlugin.nsClientService?.hasWriteAuth == true - - override fun specialAction(activity: FragmentActivity, input: String) { - objectivesPlugin.completeObjectives(activity, input) - } - companion object { private const val MANUAL_ENACTS_NEEDED = 20 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 696e688c8a..6a9e7a9307 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 @@ -10,28 +10,27 @@ import info.nightscout.androidaps.extensions.durationInMinutes import info.nightscout.androidaps.extensions.safeQueryBroadcastReceivers import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui -import info.nightscout.androidaps.plugins.general.nsclient.data.DeviceStatusData -import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus -import info.nightscout.rx.events.EventOverviewBolusProgress 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.androidaps.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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event import info.nightscout.rx.events.EventAutosensCalculationFinished +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import io.reactivex.rxjava3.disposables.CompositeDisposable @@ -52,14 +51,12 @@ class DataBroadcastPlugin @Inject constructor( private val iobCobCalculator: IobCobCalculator, private val profileFunction: ProfileFunction, private val defaultValueHelper: DefaultValueHelper, - private val nsDeviceStatus: NSDeviceStatus, - private val deviceStatusData: DeviceStatusData, + private val processedDeviceStatusData: ProcessedDeviceStatusData, private val loop: Loop, private val activePlugin: ActivePlugin, private var receiverStatusStore: ReceiverStatusStore, private val config: Config, private val glucoseStatusProvider: GlucoseStatusProvider - ) : PluginBase( PluginDescription() .mainType(PluginType.GENERAL) @@ -143,7 +140,7 @@ class DataBroadcastPlugin @Inject constructor( private fun loopStatus(bundle: Bundle) { //batteries bundle.putInt("phoneBattery", receiverStatusStore.batteryLevel) - bundle.putInt("rigBattery", nsDeviceStatus.uploaderStatus.replace("%", "").trim { it <= ' ' }.toInt()) + bundle.putInt("rigBattery", processedDeviceStatusData.uploaderStatus.replace("%", "").trim { it <= ' ' }.toInt()) if (config.APS && loop.lastRun?.lastTBREnact != 0L) { //we are AndroidAPS bundle.putLong("suggestedTimeStamp", loop.lastRun?.lastAPSRun ?: -1L) @@ -156,7 +153,7 @@ class DataBroadcastPlugin @Inject constructor( bundle.putString("enacted", loop.lastRun?.request?.json().toString()) } } else { //NSClient or remote - val data = deviceStatusData.openAPSData + val data = processedDeviceStatusData.openAPSData if (data.clockSuggested != 0L && data.suggested != null) { bundle.putLong("suggestedTimeStamp", data.clockSuggested) bundle.putString("suggested", data.suggested.toString()) 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 2e41632ca9..418624b6d4 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 @@ -13,7 +13,7 @@ import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus +import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.plugins.general.maintenance.LoggerUtils import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt deleted file mode 100644 index c61ecbc596..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt +++ /dev/null @@ -1,539 +0,0 @@ -package info.nightscout.androidaps.plugins.general.nsclient - -import android.content.Context -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.TherapyEvent -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.SyncNsBolusCalculatorResultTransaction -import info.nightscout.androidaps.database.transactions.SyncNsBolusTransaction -import info.nightscout.androidaps.database.transactions.SyncNsCarbsTransaction -import info.nightscout.androidaps.database.transactions.SyncNsEffectiveProfileSwitchTransaction -import info.nightscout.androidaps.database.transactions.SyncNsExtendedBolusTransaction -import info.nightscout.androidaps.database.transactions.SyncNsOfflineEventTransaction -import info.nightscout.androidaps.database.transactions.SyncNsProfileSwitchTransaction -import info.nightscout.androidaps.database.transactions.SyncNsTemporaryBasalTransaction -import info.nightscout.androidaps.database.transactions.SyncNsTemporaryTargetTransaction -import info.nightscout.androidaps.database.transactions.SyncNsTherapyEventTransaction -import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson -import info.nightscout.androidaps.extensions.bolusFromJson -import info.nightscout.androidaps.extensions.carbsFromJson -import info.nightscout.androidaps.extensions.effectiveProfileSwitchFromJson -import info.nightscout.androidaps.extensions.extendedBolusFromJson -import info.nightscout.androidaps.extensions.isEffectiveProfileSwitch -import info.nightscout.androidaps.extensions.offlineEventFromJson -import info.nightscout.androidaps.extensions.profileSwitchFromJson -import info.nightscout.androidaps.extensions.temporaryBasalFromJson -import info.nightscout.androidaps.extensions.temporaryTargetFromJson -import info.nightscout.androidaps.extensions.therapyEventFromJson -import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.XDripBroadcast -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.virtual.VirtualPumpPlugin -import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.interfaces.utils.JsonHelper.safeGetLong -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 java.util.concurrent.TimeUnit -import javax.inject.Inject - -class NSClientAddUpdateWorker( - context: Context, - params: WorkerParameters -) : Worker(context, params) { - - @Inject lateinit var nsClientPlugin: NSClientPlugin - @Inject lateinit var dataWorkerStorage: DataWorkerStorage - @Inject lateinit var aapsLogger: AAPSLogger - @Inject lateinit var buildHelper: BuildHelper - @Inject lateinit var sp: SP - @Inject lateinit var dateUtil: DateUtil - @Inject lateinit var config: Config - @Inject lateinit var repository: AppRepository - @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 - - override fun doWork(): Result { - val treatments = dataWorkerStorage.pickupJSONArray(inputData.getLong(DataWorkerStorage.STORE_KEY, -1)) - ?: return Result.failure(workDataOf("Error" to "missing input data")) - - var ret = Result.success() - var latestDateInReceivedData = 0L - - for (i in 0 until treatments.length()) { - var json = treatments.getJSONObject(i) - aapsLogger.debug(LTag.DATABASE, "Received NS treatment: $json") - - val insulin = JsonHelper.safeGetDouble(json, "insulin") - val carbs = JsonHelper.safeGetDouble(json, "carbs") - var eventType = JsonHelper.safeGetString(json, "eventType") - if (eventType == null) { - aapsLogger.debug(LTag.NSCLIENT, "Wrong treatment. Ignoring : $json") - continue - } - - //Find latest date in treatment - val mills = safeGetLong(json, "mills") - if (mills != 0L && mills < dateUtil.now()) - if (mills > latestDateInReceivedData) latestDateInReceivedData = mills - - if (insulin > 0) { - if (sp.getBoolean(R.string.key_ns_receive_insulin, false) || config.NSCLIENT) { - bolusFromJson(json)?.let { bolus -> - repository.runTransactionForResult(SyncNsBolusTransaction(bolus)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving bolus", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { - uel.log( - Action.BOLUS, Sources.NSClient, it.notes, - ValueWithUnit.Timestamp(it.timestamp), - ValueWithUnit.Insulin(it.amount) - ) - aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it") - } - result.invalidated.forEach { - uel.log( - Action.BOLUS_REMOVED, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - ValueWithUnit.Insulin(it.amount) - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated bolus $it") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId of bolus $it") - } - result.updated.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated amount of bolus $it") - } - } - } ?: aapsLogger.error("Error parsing bolus json $json") - } - } - if (carbs > 0) { - if (sp.getBoolean(R.string.key_ns_receive_carbs, false) || config.NSCLIENT) { - carbsFromJson(json)?.let { carb -> - repository.runTransactionForResult(SyncNsCarbsTransaction(carb)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { - uel.log( - Action.CARBS, Sources.NSClient, it.notes, - ValueWithUnit.Timestamp(it.timestamp), - ValueWithUnit.Gram(it.amount.toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it") - } - result.invalidated.forEach { - uel.log( - Action.CARBS_REMOVED, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - ValueWithUnit.Gram(it.amount.toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated carbs $it") - } - result.updated.forEach { - uel.log( - Action.CARBS, Sources.NSClient, it.notes, - ValueWithUnit.Timestamp(it.timestamp), - ValueWithUnit.Gram(it.amount.toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Updated carbs $it") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId carbs $it") - } - } - } ?: aapsLogger.error("Error parsing bolus json $json") - } - } - // Convert back emulated TBR -> EB - if (eventType == TherapyEvent.Type.TEMPORARY_BASAL.text && json.has("extendedEmulated")) { - val ebJson = json.getJSONObject("extendedEmulated") - ebJson.put("_id", json.getString("_id")) - ebJson.put("isValid", json.getBoolean("isValid")) - ebJson.put("mills", mills) - json = ebJson - eventType = JsonHelper.safeGetString(json, "eventType") - virtualPumpPlugin.fakeDataDetected = true - } - when { - insulin > 0 || carbs > 0 -> Any() - eventType == TherapyEvent.Type.TEMPORARY_TARGET.text -> - if (sp.getBoolean(R.string.key_ns_receive_temp_target, false) || config.NSCLIENT) { - temporaryTargetFromJson(json)?.let { temporaryTarget -> - repository.runTransactionForResult(SyncNsTemporaryTargetTransaction(temporaryTarget)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving temporary target", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { tt -> - uel.log( - Action.TT, Sources.NSClient, - ValueWithUnit.TherapyEventTTReason(tt.reason), - ValueWithUnit.fromGlucoseUnit(tt.lowTarget, Constants.MGDL), - ValueWithUnit.fromGlucoseUnit(tt.highTarget, Constants.MGDL).takeIf { tt.lowTarget != tt.highTarget }, - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryTarget $tt") - } - result.invalidated.forEach { tt -> - uel.log( - Action.TT_REMOVED, Sources.NSClient, - ValueWithUnit.TherapyEventTTReason(tt.reason), - ValueWithUnit.Mgdl(tt.lowTarget), - ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget }, - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated TemporaryTarget $tt") - } - result.ended.forEach { tt -> - uel.log( - Action.CANCEL_TT, Sources.NSClient, - ValueWithUnit.TherapyEventTTReason(tt.reason), - ValueWithUnit.Mgdl(tt.lowTarget), - ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget }, - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Updated TemporaryTarget $tt") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId TemporaryTarget $it") - } - result.updatedDuration.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated duration TemporaryTarget $it") - } - } - } ?: aapsLogger.error("Error parsing TT json $json") - } - eventType == TherapyEvent.Type.NOTE.text && json.isEffectiveProfileSwitch() -> // replace this by new Type when available in NS - if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) { - effectiveProfileSwitchFromJson(json, dateUtil)?.let { effectiveProfileSwitch -> - repository.runTransactionForResult(SyncNsEffectiveProfileSwitchTransaction(effectiveProfileSwitch)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving EffectiveProfileSwitch", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { - uel.log( - Action.PROFILE_SWITCH, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp) - ) - aapsLogger.debug(LTag.DATABASE, "Inserted EffectiveProfileSwitch $it") - } - result.invalidated.forEach { - uel.log( - Action.PROFILE_SWITCH_REMOVED, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp) - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated EffectiveProfileSwitch $it") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId EffectiveProfileSwitch $it") - } - } - } ?: aapsLogger.error("Error parsing EffectiveProfileSwitch json $json") - } - eventType == TherapyEvent.Type.BOLUS_WIZARD.text -> - bolusCalculatorResultFromJson(json)?.let { bolusCalculatorResult -> - repository.runTransactionForResult(SyncNsBolusCalculatorResultTransaction(bolusCalculatorResult)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving BolusCalculatorResult", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { - uel.log( - Action.BOLUS_CALCULATOR_RESULT, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - ) - aapsLogger.debug(LTag.DATABASE, "Inserted BolusCalculatorResult $it") - } - result.invalidated.forEach { - uel.log( - Action.BOLUS_CALCULATOR_RESULT_REMOVED, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated BolusCalculatorResult $it") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId BolusCalculatorResult $it") - } - } - } ?: aapsLogger.error("Error parsing BolusCalculatorResult json $json") - eventType == TherapyEvent.Type.CANNULA_CHANGE.text || - eventType == TherapyEvent.Type.INSULIN_CHANGE.text || - eventType == TherapyEvent.Type.SENSOR_CHANGE.text || - eventType == TherapyEvent.Type.FINGER_STICK_BG_VALUE.text || - eventType == TherapyEvent.Type.NONE.text || - eventType == TherapyEvent.Type.ANNOUNCEMENT.text || - eventType == TherapyEvent.Type.QUESTION.text || - eventType == TherapyEvent.Type.EXERCISE.text || - eventType == TherapyEvent.Type.NOTE.text || - eventType == TherapyEvent.Type.PUMP_BATTERY_CHANGE.text -> - if (sp.getBoolean(R.string.key_ns_receive_therapy_events, false) || config.NSCLIENT) { - therapyEventFromJson(json)?.let { therapyEvent -> - repository.runTransactionForResult(SyncNsTherapyEventTransaction(therapyEvent)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving therapy event", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - val action = when (eventType) { - TherapyEvent.Type.CANNULA_CHANGE.text -> Action.SITE_CHANGE - TherapyEvent.Type.INSULIN_CHANGE.text -> Action.RESERVOIR_CHANGE - else -> Action.CAREPORTAL - } - result.inserted.forEach { therapyEvent -> - uel.log(action, Sources.NSClient, - therapyEvent.note ?: "", - ValueWithUnit.Timestamp(therapyEvent.timestamp), - ValueWithUnit.TherapyEventType(therapyEvent.type), - ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null } - ) - aapsLogger.debug(LTag.DATABASE, "Inserted TherapyEvent $therapyEvent") - } - result.invalidated.forEach { therapyEvent -> - uel.log(Action.CAREPORTAL_REMOVED, Sources.NSClient, - therapyEvent.note ?: "", - ValueWithUnit.Timestamp(therapyEvent.timestamp), - ValueWithUnit.TherapyEventType(therapyEvent.type), - ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null } - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated TherapyEvent $therapyEvent") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId TherapyEvent $it") - } - result.updatedDuration.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId TherapyEvent $it") - } - } - } ?: aapsLogger.error("Error parsing TherapyEvent json $json") - } - eventType == TherapyEvent.Type.COMBO_BOLUS.text -> - if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) { - extendedBolusFromJson(json)?.let { extendedBolus -> - repository.runTransactionForResult(SyncNsExtendedBolusTransaction(extendedBolus)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving extended bolus", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { - uel.log( - Action.EXTENDED_BOLUS, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - ValueWithUnit.Insulin(it.amount), - ValueWithUnit.UnitPerHour(it.rate), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Inserted ExtendedBolus $it") - } - result.invalidated.forEach { - uel.log( - Action.EXTENDED_BOLUS_REMOVED, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - ValueWithUnit.Insulin(it.amount), - ValueWithUnit.UnitPerHour(it.rate), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated ExtendedBolus $it") - } - result.ended.forEach { - uel.log( - Action.CANCEL_EXTENDED_BOLUS, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - ValueWithUnit.Insulin(it.amount), - ValueWithUnit.UnitPerHour(it.rate), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Updated ExtendedBolus $it") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId ExtendedBolus $it") - } - result.updatedDuration.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated duration ExtendedBolus $it") - } - } - } ?: aapsLogger.error("Error parsing ExtendedBolus json $json") - } - eventType == TherapyEvent.Type.TEMPORARY_BASAL.text -> - if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) { - temporaryBasalFromJson(json)?.let { temporaryBasal -> - repository.runTransactionForResult(SyncNsTemporaryBasalTransaction(temporaryBasal)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving temporary basal", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { - uel.log( - Action.TEMP_BASAL, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryBasal $it") - } - result.invalidated.forEach { - uel.log( - Action.TEMP_BASAL_REMOVED, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated TemporaryBasal $it") - } - result.ended.forEach { - uel.log( - Action.CANCEL_TEMP_BASAL, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp), - if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Ended TemporaryBasal $it") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId TemporaryBasal $it") - } - result.updatedDuration.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated duration TemporaryBasal $it") - } - } - } ?: aapsLogger.error("Error parsing TemporaryBasal json $json") - } - eventType == TherapyEvent.Type.PROFILE_SWITCH.text -> - if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) { - profileSwitchFromJson(json, dateUtil, activePlugin)?.let { profileSwitch -> - repository.runTransactionForResult(SyncNsProfileSwitchTransaction(profileSwitch)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving ProfileSwitch", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { - uel.log( - Action.PROFILE_SWITCH, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp) - ) - aapsLogger.debug(LTag.DATABASE, "Inserted ProfileSwitch $it") - } - result.invalidated.forEach { - uel.log( - Action.PROFILE_SWITCH_REMOVED, Sources.NSClient, - ValueWithUnit.Timestamp(it.timestamp) - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated ProfileSwitch $it") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId ProfileSwitch $it") - } - } - } ?: aapsLogger.error("Error parsing ProfileSwitch json $json") - } - eventType == TherapyEvent.Type.APS_OFFLINE.text -> - if (sp.getBoolean(R.string.key_ns_receive_offline_event, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) { - offlineEventFromJson(json)?.let { offlineEvent -> - repository.runTransactionForResult(SyncNsOfflineEventTransaction(offlineEvent)) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving OfflineEvent", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.inserted.forEach { oe -> - uel.log( - Action.LOOP_CHANGE, Sources.NSClient, - ValueWithUnit.OfflineEventReason(oe.reason), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Inserted OfflineEvent $oe") - } - result.invalidated.forEach { oe -> - uel.log( - Action.LOOP_REMOVED, Sources.NSClient, - ValueWithUnit.OfflineEventReason(oe.reason), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Invalidated OfflineEvent $oe") - } - result.ended.forEach { oe -> - uel.log( - Action.LOOP_CHANGE, Sources.NSClient, - ValueWithUnit.OfflineEventReason(oe.reason), - ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) - ) - aapsLogger.debug(LTag.DATABASE, "Updated OfflineEvent $oe") - } - result.updatedNsId.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated nsId OfflineEvent $it") - } - result.updatedDuration.forEach { - aapsLogger.debug(LTag.DATABASE, "Updated duration OfflineEvent $it") - } - } - } ?: aapsLogger.error("Error parsing OfflineEvent json $json") - } - } - if (sp.getBoolean(R.string.key_ns_receive_therapy_events, false) || config.NSCLIENT) - if (eventType == TherapyEvent.Type.ANNOUNCEMENT.text) { - val date = safeGetLong(json, "mills") - val now = System.currentTimeMillis() - val enteredBy = JsonHelper.safeGetString(json, "enteredBy", "") - val notes = JsonHelper.safeGetString(json, "notes", "") - if (date > now - 15 * 60 * 1000L && notes.isNotEmpty() - && enteredBy != sp.getString("careportal_enteredby", "AndroidAPS") - ) { - val defaultVal = config.NSCLIENT - if (sp.getBoolean(R.string.key_ns_announcements, defaultVal)) { - val announcement = Notification(Notification.NS_ANNOUNCEMENT, notes, Notification.ANNOUNCEMENT, 60) - rxBus.send(EventNewNotification(announcement)) - } - } - } - } - nsClientPlugin.updateLatestDateReceivedIfNewer(latestDateInReceivedData) - xDripBroadcast.sendTreatments(treatments) - return ret - } - - init { - (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) - } -} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/DeviceStatusData.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/DeviceStatusData.kt deleted file mode 100644 index a4b1b7ff7e..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/DeviceStatusData.kt +++ /dev/null @@ -1,42 +0,0 @@ -package info.nightscout.androidaps.plugins.general.nsclient.data - -import android.text.Spanned -import org.json.JSONObject -import java.util.HashMap -import javax.inject.Inject -import javax.inject.Singleton - -@Singleton -class DeviceStatusData @Inject constructor() { - - class PumpData { - var clock = 0L - var isPercent = false - var percent = 0 - var voltage = 0.0 - var status = "N/A" - var reservoir = 0.0 - var reservoirDisplayOverride = "" - var extended: Spanned? = null - var activeProfileName: String? = null - } - - var pumpData: PumpData? = null - - class Uploader { - var clock = 0L - var battery = 0 - } - - val uploaderMap = HashMap() - - class OpenAPSData { - var clockSuggested = 0L - var clockEnacted = 0L - var suggested: JSONObject? = null - var enacted: JSONObject? = null - } - - var openAPSData = OpenAPSData() -} - diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSDeviceStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSDeviceStatus.kt deleted file mode 100644 index 88d65bd314..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSDeviceStatus.kt +++ /dev/null @@ -1,375 +0,0 @@ -package info.nightscout.androidaps.plugins.general.nsclient.data - -import android.text.Spanned -import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.R -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.aps.loop.APSResult -import info.nightscout.androidaps.plugins.configBuilder.RunningConfiguration -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.interfaces.utils.HtmlHelper.fromHtml -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.utils.T -import info.nightscout.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag -import info.nightscout.shared.sharedPreferences.SP -import org.json.JSONArray -import org.json.JSONException -import org.json.JSONObject -import javax.inject.Inject -import javax.inject.Singleton - -/* -{ - "_id": "594fdcec327b83c81b6b8c0f", - "device": "openaps://Sony D5803", - "pump": { - "battery": { - "percent": 100 - }, - "status": { - "status": "normal", - "timestamp": "2017-06-25T15:50:14Z" - }, - "extended": { - "Version": "1.5-ac98852-2017.06.25", - "PumpIOB": 1.13, - "LastBolus": "25. 6. 2017 17:25:00", - "LastBolusAmount": 0.3, - "BaseBasalRate": 0.4, - "ActiveProfile": "2016 +30%" - }, - "reservoir": 109, - "clock": "2017-06-25T15:55:10Z" - }, - "openaps": { - "suggested": { - "temp": "absolute", - "bg": 115.9, - "tick": "+5", - "eventualBG": 105, - "snoozeBG": 105, - "predBGs": { - "IOB": [116, 114, 112, 110, 109, 107, 106, 105, 105, 104, 104, 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 107] - }, - "sensitivityRatio": 0.81, - "variable_sens": 137.3, - "COB": 0, - "IOB": -0.035, - "reason": "COB: 0, Dev: -18, BGI: 0.43, ISF: 216, Target: 99; Eventual BG 105 > 99 but Min. Delta -2.60 < Exp. Delta 0.1; setting current basal of 0.4 as temp. Suggested rate is same as profile rate, no temp basal is active, doing nothing", - "timestamp": "2017-06-25T15:55:10Z" - }, - "iob": { - "iob": -0.035, - "basaliob": -0.035, - "activity": -0.0004, - "time": "2017-06-25T15:55:10Z" - } - }, - "uploaderBattery": 93, - "created_at": "2017-06-25T15:55:10Z", - "NSCLIENT_ID": 1498406118857 -} - */ -@Suppress("SpellCheckingInspection") -@Singleton -class NSDeviceStatus @Inject constructor( - private val aapsLogger: AAPSLogger, - private val sp: SP, - private val rh: ResourceHelper, - private val nsSettingsStatus: NSSettingsStatus, - private val config: Config, - private val dateUtil: DateUtil, - private val runningConfiguration: RunningConfiguration, - private val deviceStatusData: DeviceStatusData -) { - - private var data: JSONObject? = null - fun handleNewData(deviceStatuses: JSONArray) { - aapsLogger.debug(LTag.NSCLIENT, "Got NS deviceStatus: \$deviceStatuses") - try { - for (i in deviceStatuses.length() - 1 downTo 0) { - val devicestatusJson = deviceStatuses.getJSONObject(i) - if (devicestatusJson != null) { - setData(devicestatusJson) - if (devicestatusJson.has("pump")) { - // Objectives 0 - sp.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, true) - } - if (devicestatusJson.has("configuration") && config.NSCLIENT) { - // copy configuration of Insulin and Sensitivity from main AAPS - runningConfiguration.apply(devicestatusJson.getJSONObject("configuration")) - break - } - } - } - } catch (jsonException: JSONException) { - jsonException.printStackTrace() - } - } - - private fun setData(obj: JSONObject): NSDeviceStatus { - data = obj - updatePumpData() - updateOpenApsData(obj) - updateUploaderData(obj) - return this - } - - val device: String - get() { - try { - if (data!!.has("device")) { - var device = data!!.getString("device") - if (device.startsWith("openaps://")) { - device = device.substring(10) - return device - } - } - } catch (e: JSONException) { - aapsLogger.error("Unhandled exception", e) - } - return "" - } - - enum class Levels(val level: Int) { - - URGENT(2), - WARN(1), - INFO(0); - - fun toColor(): String = - when (level) { - INFO.level -> "white" - WARN.level -> "yellow" - URGENT.level -> "red" - else -> "white" - } - } - - val extendedPumpStatus: Spanned - get() = deviceStatusData.pumpData?.extended ?: fromHtml("") - - val pumpStatus: Spanned - // test warning level // color - get() { - val pumpData = deviceStatusData.pumpData ?: return fromHtml("") - - //String[] ALL_STATUS_FIELDS = {"reservoir", "battery", "clock", "status", "device"}; - val string = StringBuilder() - .append("") - .append(rh.gs(R.string.pump)) - .append(": ") - - // test warning level - val level = when { - pumpData.clock + nsSettingsStatus.extendedPumpSettings("urgentClock") * 60 * 1000L < dateUtil.now() -> Levels.URGENT - pumpData.reservoir < nsSettingsStatus.extendedPumpSettings("urgentRes") -> Levels.URGENT - pumpData.isPercent && pumpData.percent < nsSettingsStatus.extendedPumpSettings("urgentBattP") -> Levels.URGENT - !pumpData.isPercent && pumpData.voltage > 0 && pumpData.voltage < nsSettingsStatus.extendedPumpSettings("urgentBattV") -> Levels.URGENT - pumpData.clock + nsSettingsStatus.extendedPumpSettings("warnClock") * 60 * 1000L < dateUtil.now() -> Levels.WARN - pumpData.reservoir < nsSettingsStatus.extendedPumpSettings("warnRes") -> Levels.WARN - pumpData.isPercent && pumpData.percent < nsSettingsStatus.extendedPumpSettings("warnBattP") -> Levels.WARN - !pumpData.isPercent && pumpData.voltage > 0 && pumpData.voltage < nsSettingsStatus.extendedPumpSettings("warnBattV") -> Levels.WARN - else -> Levels.INFO - } - string.append("") - val insulinUnit = rh.gs(R.string.insulin_unit_shortname) - val fields = nsSettingsStatus.pumpExtendedSettingsFields() - if (pumpData.reservoirDisplayOverride != "") { - string.append(pumpData.reservoirDisplayOverride).append("$insulinUnit ") - } - else if (fields.contains("reservoir")) string.append(pumpData.reservoir.toInt()).append("$insulinUnit ") - if (fields.contains("battery") && pumpData.isPercent) string.append(pumpData.percent).append("% ") - if (fields.contains("battery") && !pumpData.isPercent) string.append(Round.roundTo(pumpData.voltage, 0.001)).append(" ") - if (fields.contains("clock")) string.append(dateUtil.minAgo(rh, pumpData.clock)).append(" ") - if (fields.contains("status")) string.append(pumpData.status).append(" ") - if (fields.contains("device")) string.append(device).append(" ") - string.append("") // color - return fromHtml(string.toString()) - } - - private fun updatePumpData() { - try { - val data = this.data ?: return - val pump = if (data.has("pump")) data.getJSONObject("pump") else JSONObject() - val clock = if (pump.has("clock")) dateUtil.fromISODateString(pump.getString("clock")) else 0L - // check if this is new data - if (clock == 0L || deviceStatusData.pumpData != null && clock < deviceStatusData.pumpData!!.clock) return - - // create new status and process data - val deviceStatusPumpData = DeviceStatusData.PumpData() - deviceStatusPumpData.clock = clock - if (pump.has("status") && pump.getJSONObject("status").has("status")) deviceStatusPumpData.status = pump.getJSONObject("status").getString("status") - if (pump.has("reservoir")) deviceStatusPumpData.reservoir = pump.getDouble("reservoir") - if (pump.has("reservoir_display_override")) deviceStatusPumpData.reservoirDisplayOverride = pump.getString("reservoir_display_override") - if (pump.has("battery") && pump.getJSONObject("battery").has("percent")) { - deviceStatusPumpData.isPercent = true - deviceStatusPumpData.percent = pump.getJSONObject("battery").getInt("percent") - } else if (pump.has("battery") && pump.getJSONObject("battery").has("voltage")) { - deviceStatusPumpData.isPercent = false - deviceStatusPumpData.voltage = pump.getJSONObject("battery").getDouble("voltage") - } - if (pump.has("extended")) { - val extendedJson = pump.getJSONObject("extended") - val extended = StringBuilder() - val keys: Iterator<*> = extendedJson.keys() - while (keys.hasNext()) { - val key = keys.next() as String - val value = extendedJson.getString(key) - extended.append("").append(key).append(": ").append(value).append("
") - } - deviceStatusPumpData.extended = fromHtml(extended.toString()) - deviceStatusPumpData.activeProfileName = JsonHelper.safeGetStringAllowNull(extendedJson, "ActiveProfile", null) - } - deviceStatusData.pumpData = deviceStatusPumpData - } catch (e: Exception) { - aapsLogger.error("Unhandled exception", e) - } - } - - private fun updateOpenApsData(jsonObject: JSONObject) { - try { - val openAps = if (jsonObject.has("openaps")) jsonObject.getJSONObject("openaps") else JSONObject() - val suggested = if (openAps.has("suggested")) openAps.getJSONObject("suggested") else JSONObject() - val enacted = if (openAps.has("enacted")) openAps.getJSONObject("enacted") else JSONObject() - var clock = if (suggested.has("timestamp")) dateUtil.fromISODateString(suggested.getString("timestamp")) else 0L - // check if this is new data - if (clock != 0L && clock > deviceStatusData.openAPSData.clockSuggested) { - deviceStatusData.openAPSData.suggested = suggested - deviceStatusData.openAPSData.clockSuggested = clock - } - clock = if (enacted.has("timestamp")) dateUtil.fromISODateString(enacted.getString("timestamp")) else 0L - // check if this is new data - if (clock != 0L && clock > deviceStatusData.openAPSData.clockEnacted) { - deviceStatusData.openAPSData.enacted = enacted - deviceStatusData.openAPSData.clockEnacted = clock - } - } catch (e: Exception) { - aapsLogger.error("Unhandled exception", e) - } - } - - val openApsStatus: Spanned - get() { - val string = StringBuilder() - .append("") - .append(rh.gs(R.string.openaps_short)) - .append(": ") - - // test warning level - val level = when { - deviceStatusData.openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_nsalarm_urgent_staledatavalue, 31)).msecs() < dateUtil.now() -> Levels.URGENT - deviceStatusData.openAPSData.clockSuggested + T.mins(sp.getLong(R.string.key_nsalarm_staledatavalue, 16)).msecs() < dateUtil.now() -> Levels.WARN - else -> Levels.INFO - } - string.append("") - if (deviceStatusData.openAPSData.clockSuggested != 0L) string.append(dateUtil.minAgo(rh, deviceStatusData.openAPSData.clockSuggested)).append(" ") - string.append("") // color - return fromHtml(string.toString()) - } - - val extendedOpenApsStatus: Spanned - get() { - val string = StringBuilder() - try { - if (deviceStatusData.openAPSData.enacted != null && deviceStatusData.openAPSData.clockEnacted != deviceStatusData.openAPSData.clockSuggested) string.append("") - .append(dateUtil.minAgo(rh, deviceStatusData.openAPSData.clockEnacted)).append(" ").append(deviceStatusData.openAPSData.enacted!!.getString("reason")).append("
") - if (deviceStatusData.openAPSData.suggested != null) string.append("").append(dateUtil.minAgo(rh, deviceStatusData.openAPSData.clockSuggested)).append(" ") - .append(deviceStatusData.openAPSData.suggested!!.getString("reason")).append("
") - return fromHtml(string.toString()) - } catch (e: JSONException) { - aapsLogger.error("Unhandled exception", e) - } - return fromHtml("") - } - - private fun updateUploaderData(jsonObject: JSONObject) { - try { - val clock = - when { - jsonObject.has("mills") -> jsonObject.getLong("mills") - jsonObject.has("created_at") -> dateUtil.fromISODateString(jsonObject.getString("created_at")) - else -> 0L - } - val device = device - val battery: Int = - when { - jsonObject.has("uploaderBattery") -> jsonObject.getInt("uploaderBattery") - jsonObject.has("uploader") && jsonObject.getJSONObject("uploader").has("battery") -> jsonObject.getJSONObject("uploader").getInt("battery") - else -> 0 - } - - var uploader = deviceStatusData.uploaderMap[device] - // check if this is new data - if (clock != 0L && battery != 0 && (uploader == null || clock > uploader.clock)) { - if (uploader == null) uploader = DeviceStatusData.Uploader() - uploader.battery = battery - uploader.clock = clock - deviceStatusData.uploaderMap[device] = uploader - } - } catch (e: Exception) { - aapsLogger.error("Unhandled exception", e) - } - } - - val uploaderStatus: String - get() { - val iterator: Iterator<*> = deviceStatusData.uploaderMap.entries.iterator() - var minBattery = 100 - while (iterator.hasNext()) { - val pair = iterator.next() as Map.Entry<*, *> - val uploader = pair.value as DeviceStatusData.Uploader - if (minBattery > uploader.battery) minBattery = uploader.battery - } - return "$minBattery%" - } - - val uploaderStatusSpanned: Spanned - get() { - val string = StringBuilder() - string.append("") - string.append(rh.gs(R.string.uploader_short)) - string.append(": ") - val iterator: Iterator<*> = deviceStatusData.uploaderMap.entries.iterator() - var minBattery = 100 - while (iterator.hasNext()) { - val pair = iterator.next() as Map.Entry<*, *> - val uploader = pair.value as DeviceStatusData.Uploader - if (minBattery > uploader.battery) minBattery = uploader.battery - } - string.append(minBattery) - string.append("%") - return fromHtml(string.toString()) - } - - val extendedUploaderStatus: Spanned - get() { - val string = StringBuilder() - val iterator: Iterator<*> = deviceStatusData.uploaderMap.entries.iterator() - while (iterator.hasNext()) { - val pair = iterator.next() as Map.Entry<*, *> - val uploader = pair.value as DeviceStatusData.Uploader - val device = pair.key as String - string.append("").append(device).append(": ").append(uploader.battery).append("%
") - } - return fromHtml(string.toString()) - } - - val openApsTimestamp: Long - get() = - if (deviceStatusData.openAPSData.clockSuggested != 0L) { - deviceStatusData.openAPSData.clockSuggested - } else { - -1 - } - - fun getAPSResult(injector: HasAndroidInjector): APSResult { - val result = APSResult(injector) - result.json = deviceStatusData.openAPSData.suggested - result.date = deviceStatusData.openAPSData.clockSuggested - return result - } -} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientStatus.kt deleted file mode 100644 index abee8602e4..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientStatus.kt +++ /dev/null @@ -1,8 +0,0 @@ -package info.nightscout.androidaps.plugins.general.nsclient.events - -import info.nightscout.androidaps.events.EventStatus -import info.nightscout.androidaps.interfaces.ResourceHelper - -class EventNSClientStatus(var text: String) : EventStatus() { - override fun getStatus(rh: ResourceHelper): String = text -} diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientUpdateGUI.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientUpdateGUI.kt deleted file mode 100644 index 66ecdc7787..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientUpdateGUI.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.androidaps.plugins.general.nsclient.events - -import info.nightscout.rx.events.EventUpdateGui - -class EventNSClientUpdateGUI : EventUpdateGui() 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 5b2af79806..26aa62ac2d 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 @@ -27,7 +27,6 @@ import androidx.recyclerview.widget.LinearLayoutManager import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository @@ -51,9 +50,7 @@ import info.nightscout.androidaps.extensions.runOnUiThread import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.GlucoseUnit @@ -67,7 +64,6 @@ import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotification import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB -import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph @@ -81,11 +77,12 @@ 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.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck @@ -93,6 +90,10 @@ import info.nightscout.androidaps.utils.ui.SingleClickButton import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.automation.AutomationPlugin +import info.nightscout.interfaces.BuildHelper +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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -128,7 +129,8 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList @Inject lateinit var profileFunction: ProfileFunction @Inject lateinit var constraintChecker: Constraints @Inject lateinit var statusLightHandler: StatusLightHandler - @Inject lateinit var nsDeviceStatus: NSDeviceStatus + @Inject lateinit var processedDeviceStatusData: ProcessedDeviceStatusData + @Inject lateinit var nsSettingsStatus: NSSettingsStatus @Inject lateinit var loop: Loop @Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var iobCobCalculator: IobCobCalculator @@ -722,16 +724,16 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList } // pump status from ns - binding.pump.text = nsDeviceStatus.pumpStatus - binding.pump.setOnClickListener { activity?.let { OKDialog.show(it, rh.gs(R.string.pump), nsDeviceStatus.extendedPumpStatus) } } + binding.pump.text = processedDeviceStatusData.pumpStatus(nsSettingsStatus) + binding.pump.setOnClickListener { activity?.let { OKDialog.show(it, rh.gs(R.string.pump), processedDeviceStatusData.extendedPumpStatus) } } // OpenAPS status from ns - binding.openaps.text = nsDeviceStatus.openApsStatus - binding.openaps.setOnClickListener { activity?.let { OKDialog.show(it, rh.gs(R.string.openaps), nsDeviceStatus.extendedOpenApsStatus) } } + binding.openaps.text = processedDeviceStatusData.openApsStatus + binding.openaps.setOnClickListener { activity?.let { OKDialog.show(it, rh.gs(R.string.openaps), processedDeviceStatusData.extendedOpenApsStatus) } } // Uploader status from ns - binding.uploader.text = nsDeviceStatus.uploaderStatusSpanned - binding.uploader.setOnClickListener { activity?.let { OKDialog.show(it, rh.gs(R.string.uploader), nsDeviceStatus.extendedUploaderStatus) } } + binding.uploader.text = processedDeviceStatusData.uploaderStatusSpanned + binding.uploader.setOnClickListener { activity?.let { OKDialog.show(it, rh.gs(R.string.uploader), processedDeviceStatusData.extendedUploaderStatus) } } } } @@ -1118,7 +1120,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList val isfMgdl = profile?.getIsfMgdl() val variableSens = if (config.APS && request is DetermineBasalResultSMB) request.variableSens ?: 0.0 - else if (config.NSCLIENT) JsonHelper.safeGetDouble(nsDeviceStatus.getAPSResult(injector).json, "variable_sens") + else if (config.NSCLIENT) JsonHelper.safeGetDouble(processedDeviceStatusData.getAPSResult(injector).json, "variable_sens") else 0.0 if (variableSens != isfMgdl && variableSens != 0.0 && isfMgdl != null) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt index c33faafdc5..2ad816f816 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt @@ -6,17 +6,15 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.extensions.age +import info.nightscout.plugins.sync.nsclient.extensions.age import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.pump.eopatch.AppConstant 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/general/overview/notifications/NotificationWithAction.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt index dcd758ea16..1aa1a7e0b1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.general.overview.notifications import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.general.nsclient.data.NSAlarm +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.androidaps.utils.T import info.nightscout.interfaces.notifications.Notification 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 67864710ff..37f6193315 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,7 +6,7 @@ import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.databinding.WearFragmentBinding -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientUpdateGUI +import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientUpdateGUI import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers @@ -65,7 +65,7 @@ class WearFragment : DaggerFragment() { _binding = null } - fun updateGui() { + private fun updateGui() { _binding ?: return binding.connectedDevice.text = wearPlugin.connectedDevice } 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 58f4618744..dbb01a3e57 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 @@ -3,12 +3,17 @@ package info.nightscout.androidaps.plugins.general.wear.wearintegration import android.app.NotificationManager import android.content.Context import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.* +import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.androidaps.database.entities.TemporaryTarget +import info.nightscout.androidaps.database.entities.TotalDailyDose +import info.nightscout.androidaps.database.entities.UserEntry +import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction @@ -18,19 +23,37 @@ import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.extensions.total import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.extensions.valueToUnitsString -import info.nightscout.androidaps.interfaces.* +import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.interfaces.CommandQueue +import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.androidaps.interfaces.IobCobCalculator +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.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus import info.nightscout.androidaps.plugins.general.overview.graphExtensions.GlucoseValueDataPoint import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.interfaces.queue.Callback +import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.androidaps.utils.* +import info.nightscout.androidaps.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.androidaps.utils.T +import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.androidaps.utils.wizard.QuickWizard 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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventMobileToWear @@ -43,7 +66,9 @@ import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DateFormat import java.text.SimpleDateFormat -import java.util.* +import java.util.Date +import java.util.LinkedList +import java.util.Locale import java.util.concurrent.TimeUnit import java.util.stream.Collectors import javax.inject.Inject @@ -66,7 +91,7 @@ class DataHandlerMobile @Inject constructor( private val glucoseStatusProvider: GlucoseStatusProvider, private val profileFunction: ProfileFunction, private val loop: Loop, - private val nsDeviceStatus: NSDeviceStatus, + private val processedDeviceStatusData: ProcessedDeviceStatusData, private val receiverStatusStore: ReceiverStatusStore, private val quickWizard: QuickWizard, private val defaultValueHelper: DefaultValueHelper, @@ -872,11 +897,11 @@ class DataHandlerMobile @Inject constructor( //batteries val phoneBattery = receiverStatusStore.batteryLevel - val rigBattery = nsDeviceStatus.uploaderStatus.trim { it <= ' ' } + val rigBattery = processedDeviceStatusData.uploaderStatus.trim { it <= ' ' } //OpenAPS status val openApsStatus = if (config.APS) loop.lastRun?.let { if (it.lastTBREnact != 0L) it.lastTBREnact else -1 } ?: -1 - else nsDeviceStatus.openApsTimestamp + else processedDeviceStatusData.openApsTimestamp rxBus.send( EventMobileToWear( diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt index f1b93bc12a..2f3d6cd790 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt @@ -1,26 +1,25 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.extensions.isPSEvent5minBack -import info.nightscout.androidaps.extensions.isTherapyEventEvent5minBack -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.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult +import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType import info.nightscout.plugins.utils.Percentile import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt index 30a97b3bd5..8e56dd9433 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt @@ -1,27 +1,26 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.extensions.isPSEvent5minBack -import info.nightscout.androidaps.extensions.isTherapyEventEvent5minBack -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.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType -import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult +import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.plugins.utils.Percentile import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt index fba1e6e97d..91cfd402ce 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -2,22 +2,22 @@ package info.nightscout.androidaps.plugins.sensitivity import androidx.collection.LongSparseArray import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.extensions.isPSEvent5minBack -import info.nightscout.androidaps.extensions.isTherapyEventEvent5minBack -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.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult +import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP @@ -147,13 +147,16 @@ class SensitivityWeightedAveragePlugin @Inject constructor( else -> "Sensitivity normal" } aapsLogger.debug(LTag.AUTOSENS, sensResult) - val output = fillResult(ratio, current.cob, pastSensitivity, ratioLimit, - sensResult, data.size()) + val output = fillResult( + ratio, current.cob, pastSensitivity, ratioLimit, + sensResult, data.size() + ) aapsLogger.debug( LTag.AUTOSENS, "Sensitivity to: " - + dateUtil.dateAndTimeString(toTime) + - " ratio: " + output.ratio - + " mealCOB: " + current.cob) + + dateUtil.dateAndTimeString(toTime) + + " ratio: " + output.ratio + + " mealCOB: " + current.cob + ) return output } @@ -178,7 +181,10 @@ class SensitivityWeightedAveragePlugin @Inject constructor( override fun applyConfiguration(configuration: JSONObject) { try { if (configuration.has(rh.gs(R.string.key_absorption_maxtime))) sp.putDouble(R.string.key_absorption_maxtime, configuration.getDouble(rh.gs(R.string.key_absorption_maxtime))) - if (configuration.has(rh.gs(R.string.key_openapsama_autosens_period))) sp.putDouble(R.string.key_openapsama_autosens_period, configuration.getDouble(rh.gs(R.string.key_openapsama_autosens_period))) + if (configuration.has(rh.gs(R.string.key_openapsama_autosens_period))) sp.putDouble( + R.string.key_openapsama_autosens_period, + configuration.getDouble(rh.gs(R.string.key_openapsama_autosens_period)) + ) if (configuration.has(rh.gs(R.string.key_openapsama_autosens_max))) sp.getDouble(R.string.key_openapsama_autosens_max, configuration.getDouble(rh.gs(R.string.key_openapsama_autosens_max))) if (configuration.has(rh.gs(R.string.key_openapsama_autosens_min))) sp.getDouble(R.string.key_openapsama_autosens_min, configuration.getDouble(rh.gs(R.string.key_openapsama_autosens_min))) } catch (e: JSONException) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt index c54f90cdd2..0fd10c3c76 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt @@ -9,24 +9,27 @@ 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.interfaces.Config import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast -import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.general.nsclient.data.NSSgv import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification -import info.nightscout.interfaces.notifications.Notification +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.androidaps.utils.DateUtil import info.nightscout.androidaps.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.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.sharedPreferences.SP +import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton @@ -39,12 +42,12 @@ class NSClientSourcePlugin @Inject constructor( config: Config ) : PluginBase( PluginDescription() - .mainType(PluginType.BGSOURCE) - .fragmentClass(BGSourceFragment::class.java.name) - .pluginIcon(R.drawable.ic_nsclient_bg) - .pluginName(R.string.nsclientbg) - .shortName(R.string.nsclientbgshort) - .description(R.string.description_source_ns_client), + .mainType(PluginType.BGSOURCE) + .fragmentClass(BGSourceFragment::class.java.name) + .pluginIcon(R.drawable.ic_nsclient_bg) + .pluginName(R.string.nsclientbg) + .shortName(R.string.nsclientbgshort) + .description(R.string.description_source_ns_client), aapsLogger, rh, injector ), BgSource { @@ -65,7 +68,7 @@ class NSClientSourcePlugin @Inject constructor( override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean = false - private fun detectSource(glucoseValue: GlucoseValue) { + internal fun detectSource(glucoseValue: GlucoseValue) { if (glucoseValue.timestamp > lastBGTimeStamp) { isAdvancedFilteringEnabled = arrayOf( GlucoseValue.SourceSensor.DEXCOM_NATIVE_UNKNOWN, @@ -93,8 +96,8 @@ class NSClientSourcePlugin @Inject constructor( @Inject lateinit var dataWorkerStorage: DataWorkerStorage @Inject lateinit var repository: AppRepository @Inject lateinit var xDripBroadcast: XDripBroadcast - @Inject lateinit var dexcomPlugin: DexcomPlugin - @Inject lateinit var nsClientPlugin: NSClientPlugin + @Inject lateinit var activePlugin: ActivePlugin + @Inject lateinit var storeDataForDb: StoreDataForDb init { (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) @@ -113,52 +116,60 @@ class NSClientSourcePlugin @Inject constructor( ) } + private fun toGv(sgv: NSSgvV3): CgmSourceTransaction.TransactionGlucoseValue { + return CgmSourceTransaction.TransactionGlucoseValue( + timestamp = sgv.date, + value = sgv.sgv, + noise = sgv.noise?.toDouble(), + raw = sgv.filtered ?: sgv.sgv, + trendArrow = GlucoseValue.TrendArrow.fromString(sgv.direction.nsName), + nightscoutId = sgv.identifier, + sourceSensor = GlucoseValue.SourceSensor.fromString(sgv.device), + isValid = sgv.isValid + ) + } + @Suppress("SpellCheckingInspection") override fun doWork(): Result { var ret = Result.success() - val sgvs = dataWorkerStorage.pickupJSONArray(inputData.getLong(DataWorkerStorage.STORE_KEY, -1)) + val sgvs = dataWorkerStorage.pickupObject(inputData.getLong(DataWorkerStorage.STORE_KEY, -1)) ?: return Result.failure(workDataOf("Error" to "missing input data")) - xDripBroadcast.sendSgvs(sgvs) + if (!nsClientSourcePlugin.isEnabled() && !sp.getBoolean(R.string.key_ns_receive_cgm, false)) return Result.success(workDataOf("Result" to "Sync not enabled")) - try { - var latestDateInReceivedData: Long = 0 + var latestDateInReceivedData: Long = 0 + aapsLogger.debug(LTag.BGSOURCE, "Received NS Data: $sgvs") + val glucoseValues = mutableListOf() - aapsLogger.debug(LTag.BGSOURCE, "Received NS Data: $sgvs") - val glucoseValues = mutableListOf() - for (i in 0 until sgvs.length()) { - val sgv = toGv(sgvs.getJSONObject(i)) ?: continue - if (sgv.timestamp < dateUtil.now() && sgv.timestamp > latestDateInReceivedData) latestDateInReceivedData = sgv.timestamp - glucoseValues += sgv + try { + if (sgvs is JSONArray) { // V1 client + xDripBroadcast.sendSgvs(sgvs) + + for (i in 0 until sgvs.length()) { + val sgv = toGv(sgvs.getJSONObject(i)) ?: continue + if (sgv.timestamp < dateUtil.now() && sgv.timestamp > latestDateInReceivedData) latestDateInReceivedData = sgv.timestamp + glucoseValues += sgv + } + + } else if (sgvs is List<*>) { // V3 client +// xDripBroadcast.sendSgvs(sgvs) + + for (i in 0 until sgvs.size) { + val sgv = toGv(sgvs[i] as NSSgvV3) + if (sgv.timestamp < dateUtil.now() && sgv.timestamp > latestDateInReceivedData) latestDateInReceivedData = sgv.timestamp + glucoseValues += sgv + } } + activePlugin.activeNsClient?.updateLatestBgReceivedIfNewer(latestDateInReceivedData) // Was that sgv more less 5 mins ago ? if (T.msecs(dateUtil.now() - latestDateInReceivedData).mins() < 5L) { rxBus.send(EventDismissNotification(Notification.NS_ALARM)) rxBus.send(EventDismissNotification(Notification.NS_URGENT_ALARM)) } - nsClientPlugin.updateLatestDateReceivedIfNewer(latestDateInReceivedData) - - repository.runTransactionForResult(CgmSourceTransaction(glucoseValues, emptyList(), null, !nsClientSourcePlugin.isEnabled())) - .doOnError { - aapsLogger.error(LTag.DATABASE, "Error while saving values from NSClient App", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { result -> - result.updated.forEach { - xDripBroadcast.send(it) - nsClientSourcePlugin.detectSource(it) - aapsLogger.debug(LTag.DATABASE, "Updated bg $it") - } - result.inserted.forEach { - xDripBroadcast.send(it) - nsClientSourcePlugin.detectSource(it) - aapsLogger.debug(LTag.DATABASE, "Inserted bg $it") - } - } + storeDataForDb.glucoseValues.addAll(glucoseValues) } catch (e: Exception) { aapsLogger.error("Unhandled exception", e) ret = Result.failure(workDataOf("Error" to e.toString())) 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 d40347341f..2865dc34df 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 @@ -9,15 +9,15 @@ 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.androidaps.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.androidaps.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.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt similarity index 67% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientFragment.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt index d86d3951bf..83823bf94b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt @@ -1,6 +1,8 @@ -package info.nightscout.androidaps.plugins.general.nsclient +package info.nightscout.androidaps.plugins.sync.nsShared import android.os.Bundle +import android.os.Handler +import android.os.HandlerThread import android.view.LayoutInflater import android.view.Menu import android.view.MenuInflater @@ -12,26 +14,30 @@ 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.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources +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.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientUpdateGUI +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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventNSClientRestart +import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject -class NSClientFragment : DaggerFragment(), MenuProvider { +class NSClientFragment : DaggerFragment(), MenuProvider, PluginFragment { - @Inject lateinit var nsClientPlugin: NSClientPlugin @Inject lateinit var sp: SP @Inject lateinit var rh: ResourceHelper @Inject lateinit var rxBus: RxBus @@ -39,6 +45,8 @@ class NSClientFragment : DaggerFragment(), MenuProvider { @Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var dataSyncSelector: DataSyncSelector @Inject lateinit var uel: UserEntryLogger + @Inject lateinit var aapsLogger: AAPSLogger + @Inject lateinit var activePlugin: ActivePlugin companion object { @@ -46,10 +54,17 @@ class NSClientFragment : DaggerFragment(), MenuProvider { const val ID_MENU_RESTART = 508 const val ID_MENU_SEND_NOW = 509 const val ID_MENU_FULL_SYNC = 510 + const val ID_MENU_TEST = 601 } + override var plugin: PluginBase? = null + private val nsClientPlugin + get() = activePlugin.activeNsClient + private val version: NsClient.Version get() = nsClientPlugin?.version ?: NsClient.Version.NONE + private val disposable = CompositeDisposable() + private var handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper) private var _binding: NsClientFragmentBinding? = null // This property is only valid between onCreateView and @@ -65,22 +80,22 @@ class NSClientFragment : DaggerFragment(), MenuProvider { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - binding.autoscroll.isChecked = nsClientPlugin.autoscroll + binding.autoscroll.isChecked = sp.getBoolean(R.string.key_nsclientinternal_autoscroll, true) binding.autoscroll.setOnCheckedChangeListener { _, isChecked -> sp.putBoolean(R.string.key_nsclientinternal_autoscroll, isChecked) - nsClientPlugin.autoscroll = isChecked updateGui() } - binding.paused.isChecked = nsClientPlugin.paused + binding.paused.isChecked = sp.getBoolean(R.string.key_nsclientinternal_paused, false) binding.paused.setOnCheckedChangeListener { _, isChecked -> - uel.log(if (isChecked) Action.NS_PAUSED else Action.NS_RESUME, Sources.NSClient) - nsClientPlugin.pause(isChecked) + uel.log(if (isChecked) UserEntry.Action.NS_PAUSED else UserEntry.Action.NS_RESUME, UserEntry.Sources.NSClient) + nsClientPlugin?.pause(isChecked) updateGui() } } 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) 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) @@ -91,7 +106,7 @@ class NSClientFragment : DaggerFragment(), MenuProvider { override fun onMenuItemSelected(item: MenuItem): Boolean = when (item.itemId) { ID_MENU_CLEAR_LOG -> { - nsClientPlugin.clearLog() + nsClientPlugin?.clearLog() true } @@ -101,7 +116,7 @@ class NSClientFragment : DaggerFragment(), MenuProvider { } ID_MENU_SEND_NOW -> { - nsClientPlugin.resend("GUI") + nsClientPlugin?.resend("GUI") true } @@ -109,12 +124,17 @@ class NSClientFragment : DaggerFragment(), MenuProvider { context?.let { context -> OKDialog.showConfirmation( context, rh.gs(R.string.nsclientinternal), rh.gs(R.string.full_sync_comment), - Runnable { dataSyncSelector.resetToNextFullSync() } + Runnable { nsClientPlugin?.resetToFullSync() } ) } true } + ID_MENU_TEST -> { + nsClientPlugin?.let { plugin -> if (plugin is NSClientV3Plugin) handler.post { plugin.test() } } + true + } + else -> false } @@ -134,12 +154,11 @@ class NSClientFragment : DaggerFragment(), MenuProvider { private fun updateGui() { if (_binding == null) return - nsClientPlugin.updateLog() binding.paused.isChecked = sp.getBoolean(R.string.key_nsclientinternal_paused, false) - binding.log.text = nsClientPlugin.textLog - if (nsClientPlugin.autoscroll) binding.logScrollview.fullScroll(ScrollView.FOCUS_DOWN) - binding.url.text = nsClientPlugin.url() - binding.status.text = nsClientPlugin.status + binding.log.text = nsClientPlugin?.textLog() + if (sp.getBoolean(R.string.key_nsclientinternal_autoscroll, true)) binding.logScrollview.fullScroll(ScrollView.FOCUS_DOWN) + binding.url.text = nsClientPlugin?.address + binding.status.text = nsClientPlugin?.status val size = dataSyncSelector.queueSize() binding.queue.text = if (size >= 0) size.toString() else rh.gs(R.string.value_unavailable_short) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt new file mode 100644 index 0000000000..3028832d48 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt @@ -0,0 +1,719 @@ +package info.nightscout.androidaps.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 +import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch +import info.nightscout.androidaps.database.entities.ExtendedBolus +import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.androidaps.database.entities.OfflineEvent +import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.androidaps.database.entities.TemporaryTarget +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.androidaps.database.transactions.SyncNsBolusCalculatorResultTransaction +import info.nightscout.androidaps.database.transactions.SyncNsBolusTransaction +import info.nightscout.androidaps.database.transactions.SyncNsCarbsTransaction +import info.nightscout.androidaps.database.transactions.SyncNsEffectiveProfileSwitchTransaction +import info.nightscout.androidaps.database.transactions.SyncNsExtendedBolusTransaction +import info.nightscout.androidaps.database.transactions.SyncNsOfflineEventTransaction +import info.nightscout.androidaps.database.transactions.SyncNsProfileSwitchTransaction +import info.nightscout.androidaps.database.transactions.SyncNsTemporaryBasalTransaction +import info.nightscout.androidaps.database.transactions.SyncNsTemporaryTargetTransaction +import info.nightscout.androidaps.database.transactions.SyncNsTherapyEventTransaction +import info.nightscout.androidaps.database.transactions.UserEntryTransaction +import info.nightscout.androidaps.interfaces.ActivePlugin +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.androidaps.utils.DateUtil +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +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.sdk.localmodel.treatment.NSBolus +import info.nightscout.sdk.localmodel.treatment.NSBolusWizard +import info.nightscout.sdk.localmodel.treatment.NSCarbs +import info.nightscout.sdk.localmodel.treatment.NSEffectiveProfileSwitch +import info.nightscout.sdk.localmodel.treatment.NSExtendedBolus +import info.nightscout.sdk.localmodel.treatment.NSOfflineEvent +import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch +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 java.util.concurrent.TimeUnit +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +class StoreDataForDb @Inject constructor( + private val aapsLogger: AAPSLogger, + private val rxBus: RxBus, + private val repository: AppRepository, + private val sp: SP, + private val uel: UserEntryLogger, + private val dateUtil: DateUtil, + private val activePlugin: ActivePlugin, + private val config: Config, + private val nsClientSourcePlugin: NSClientSourcePlugin, + private val xDripBroadcast: XDripBroadcast, + private val virtualPumpPlugin: VirtualPumpPlugin +) { + + val glucoseValues: MutableList = mutableListOf() + + val boluses: MutableList = mutableListOf() + val carbs: MutableList = mutableListOf() + val temporaryTargets: MutableList = mutableListOf() + val effectiveProfileSwitches: MutableList = mutableListOf() + val bolusCalculatorResults: MutableList = mutableListOf() + val therapyEvents: MutableList = mutableListOf() + val extendedBoluses: MutableList = mutableListOf() + val temporaryBasals: MutableList = mutableListOf() + val profileSwitches: MutableList = mutableListOf() + val offlineEvents: MutableList = mutableListOf() + + private val userEntries: MutableList = mutableListOf() + + private val inserted = HashMap() + private val updated = HashMap() + private val invalidated = HashMap() + private val nsIdUpdated = HashMap() + private val durationUpdated = HashMap() + private val ended = HashMap() + + private val pause = 1000L // to slow down db operations + + class StoreBgWorker( + context: Context, + params: WorkerParameters + ) : Worker(context, params) { + + @Inject lateinit var storeDataForDb: StoreDataForDb + + override fun doWork(): Result { + storeDataForDb.storeGlucoseValuesToDb() + return Result.success() + } + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } + } + + fun HashMap.inc(key: T) = + if (containsKey(key)) merge(key, 1, Long::plus) + else put(key, 1) + + private fun storeGlucoseValuesToDb() { + rxBus.send(EventNSClientNewLog("PROCESSING BG", "", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + + if (glucoseValues.isNotEmpty()) + repository.runTransactionForResult(CgmSourceTransaction(glucoseValues, emptyList(), null)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving values from NSClient App", it) + } + .blockingGet() + .also { result -> + glucoseValues.clear() + result.updated.forEach { + xDripBroadcast.send(it) + nsClientSourcePlugin.detectSource(it) + aapsLogger.debug(LTag.DATABASE, "Updated bg $it") + updated.inc(GlucoseValue::class.java.simpleName) + } + result.inserted.forEach { + xDripBroadcast.send(it) + nsClientSourcePlugin.detectSource(it) + aapsLogger.debug(LTag.DATABASE, "Inserted bg $it") + inserted.inc(GlucoseValue::class.java.simpleName) + } + result.updatedNsId.forEach { + xDripBroadcast.send(it) + nsClientSourcePlugin.detectSource(it) + aapsLogger.debug(LTag.DATABASE, "Updated nsId bg $it") + nsIdUpdated.inc(GlucoseValue::class.java.simpleName) + } + } + + sendLog("GlucoseValue", GlucoseValue::class.java.simpleName) + SystemClock.sleep(pause) + rxBus.send(EventNSClientNewLog("DONE BG", "", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + } + + fun storeTreatmentsToDb() { + rxBus.send(EventNSClientNewLog("PROCESSING TR", "", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + + if (boluses.isNotEmpty()) + repository.runTransactionForResult(SyncNsBolusTransaction(boluses)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving bolus", it) + } + .blockingGet() + .also { result -> + boluses.clear() + result.inserted.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.BOLUS, UserEntry.Sources.NSClient, it.notes ?: "", + listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount)) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Inserted bolus $it") + inserted.inc(NSBolus::class.java.simpleName) + } + result.invalidated.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.BOLUS_REMOVED, UserEntry.Sources.NSClient, "", + listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Insulin(it.amount)) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated bolus $it") + invalidated.inc(NSBolus::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId of bolus $it") + nsIdUpdated.inc(NSBolus::class.java.simpleName) + } + result.updated.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated amount of bolus $it") + updated.inc(NSBolus::class.java.simpleName) + } + } + + sendLog("Bolus", NSBolus::class.java.simpleName) + SystemClock.sleep(pause) + + if (carbs.isNotEmpty()) + repository.runTransactionForResult(SyncNsCarbsTransaction(carbs)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) + } + .blockingGet() + .also { result -> + carbs.clear() + result.inserted.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.CARBS, UserEntry.Sources.NSClient, it.notes ?: "", + listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it") + inserted.inc(NSCarbs::class.java.simpleName) + } + result.invalidated.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.CARBS_REMOVED, UserEntry.Sources.NSClient, "", + listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated carbs $it") + invalidated.inc(NSCarbs::class.java.simpleName) + } + result.updated.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.CARBS, UserEntry.Sources.NSClient, it.notes ?: "", + listOf(ValueWithUnit.Timestamp(it.timestamp), ValueWithUnit.Gram(it.amount.toInt())) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Updated carbs $it") + updated.inc(NSCarbs::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId carbs $it") + nsIdUpdated.inc(NSCarbs::class.java.simpleName) + } + + } + + sendLog("Carbs", NSCarbs::class.java.simpleName) + SystemClock.sleep(pause) + + if (temporaryTargets.isNotEmpty()) + repository.runTransactionForResult(SyncNsTemporaryTargetTransaction(temporaryTargets)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving temporary target", it) + } + .blockingGet() + .also { result -> + temporaryTargets.clear() + result.inserted.forEach { tt -> + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.TT, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.TherapyEventTTReason(tt.reason), + ValueWithUnit.fromGlucoseUnit(tt.lowTarget, Constants.MGDL), + ValueWithUnit.fromGlucoseUnit(tt.highTarget, Constants.MGDL).takeIf { tt.lowTarget != tt.highTarget }, + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryTarget $tt") + inserted.inc(NSTemporaryTarget::class.java.simpleName) + } + result.invalidated.forEach { tt -> + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.TT_REMOVED, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.TherapyEventTTReason(tt.reason), + ValueWithUnit.Mgdl(tt.lowTarget), + ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget }, + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated TemporaryTarget $tt") + invalidated.inc(NSTemporaryTarget::class.java.simpleName) + } + result.ended.forEach { tt -> + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.CANCEL_TT, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.TherapyEventTTReason(tt.reason), + ValueWithUnit.Mgdl(tt.lowTarget), + ValueWithUnit.Mgdl(tt.highTarget).takeIf { tt.lowTarget != tt.highTarget }, + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(tt.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Updated TemporaryTarget $tt") + ended.inc(NSTemporaryTarget::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId TemporaryTarget $it") + nsIdUpdated.inc(NSTemporaryTarget::class.java.simpleName) + } + result.updatedDuration.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated duration TemporaryTarget $it") + durationUpdated.inc(NSTemporaryTarget::class.java.simpleName) + } + } + + sendLog("TemporaryTarget", NSTemporaryTarget::class.java.simpleName) + SystemClock.sleep(pause) + + if (temporaryBasals.isNotEmpty()) + repository.runTransactionForResult(SyncNsTemporaryBasalTransaction(temporaryBasals)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving temporary basal", it) + } + .blockingGet() + .also { result -> + temporaryBasals.clear() + result.inserted.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.TEMP_BASAL, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.Timestamp(it.timestamp), + if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Inserted TemporaryBasal $it") + inserted.inc(NSTemporaryBasal::class.java.simpleName) + } + result.invalidated.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.TEMP_BASAL_REMOVED, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.Timestamp(it.timestamp), + if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated TemporaryBasal $it") + invalidated.inc(NSTemporaryBasal::class.java.simpleName) + } + result.ended.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.CANCEL_TEMP_BASAL, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.Timestamp(it.timestamp), + if (it.isAbsolute) ValueWithUnit.UnitPerHour(it.rate) else ValueWithUnit.Percent(it.rate.toInt()), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Ended TemporaryBasal $it") + ended.inc(NSTemporaryBasal::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId TemporaryBasal $it") + nsIdUpdated.inc(NSTemporaryBasal::class.java.simpleName) + } + result.updatedDuration.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated duration TemporaryBasal $it") + durationUpdated.inc(NSTemporaryBasal::class.java.simpleName) + } + } + + sendLog("TemporaryBasal", NSTemporaryBasal::class.java.simpleName) + SystemClock.sleep(pause) + + if (effectiveProfileSwitches.isNotEmpty()) + repository.runTransactionForResult(SyncNsEffectiveProfileSwitchTransaction(effectiveProfileSwitches)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving EffectiveProfileSwitch", it) + } + .blockingGet() + .also { result -> + effectiveProfileSwitches.clear() + result.inserted.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.PROFILE_SWITCH, UserEntry.Sources.NSClient, "", + listOf(ValueWithUnit.Timestamp(it.timestamp)) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Inserted EffectiveProfileSwitch $it") + inserted.inc(NSEffectiveProfileSwitch::class.java.simpleName) + } + result.invalidated.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.PROFILE_SWITCH_REMOVED, UserEntry.Sources.NSClient, "", + listOf(ValueWithUnit.Timestamp(it.timestamp)) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated EffectiveProfileSwitch $it") + invalidated.inc(NSEffectiveProfileSwitch::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId EffectiveProfileSwitch $it") + nsIdUpdated.inc(NSEffectiveProfileSwitch::class.java.simpleName) + } + } + + sendLog("EffectiveProfileSwitch", NSEffectiveProfileSwitch::class.java.simpleName) + SystemClock.sleep(pause) + + if (profileSwitches.isNotEmpty()) + repository.runTransactionForResult(SyncNsProfileSwitchTransaction(profileSwitches)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving ProfileSwitch", it) + } + .blockingGet() + .also { result -> + profileSwitches.clear() + result.inserted.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.PROFILE_SWITCH, UserEntry.Sources.NSClient, "", + listOf(ValueWithUnit.Timestamp(it.timestamp)) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Inserted ProfileSwitch $it") + inserted.inc(NSProfileSwitch::class.java.simpleName) + } + result.invalidated.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.PROFILE_SWITCH_REMOVED, UserEntry.Sources.NSClient, "", + listOf(ValueWithUnit.Timestamp(it.timestamp)) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated ProfileSwitch $it") + invalidated.inc(NSProfileSwitch::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId ProfileSwitch $it") + nsIdUpdated.inc(NSProfileSwitch::class.java.simpleName) + } + } + + sendLog("ProfileSwitch", NSProfileSwitch::class.java.simpleName) + SystemClock.sleep(pause) + + if (bolusCalculatorResults.isNotEmpty()) + repository.runTransactionForResult(SyncNsBolusCalculatorResultTransaction(bolusCalculatorResults)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving BolusCalculatorResult", it) + } + .blockingGet() + .also { result -> + bolusCalculatorResults.clear() + result.inserted.forEach { + aapsLogger.debug(LTag.DATABASE, "Inserted BolusCalculatorResult $it") + inserted.inc(NSBolusWizard::class.java.simpleName) + } + result.invalidated.forEach { + aapsLogger.debug(LTag.DATABASE, "Invalidated BolusCalculatorResult $it") + invalidated.inc(NSBolusWizard::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId BolusCalculatorResult $it") + nsIdUpdated.inc(NSBolusWizard::class.java.simpleName) + } + } + + sendLog("BolusCalculatorResult", NSBolusWizard::class.java.simpleName) + SystemClock.sleep(pause) + + if (sp.getBoolean(R.string.key_ns_receive_therapy_events, false) || config.NSCLIENT) + therapyEvents.filter { it.type == TherapyEvent.Type.ANNOUNCEMENT }.forEach { + if (it.timestamp > dateUtil.now() - 15 * 60 * 1000L && + it.note?.isNotEmpty() == true && + it.enteredBy != sp.getString("careportal_enteredby", "AndroidAPS") + ) { + if (sp.getBoolean(R.string.key_ns_announcements, config.NSCLIENT)) + rxBus.send(EventNewNotification(Notification(Notification.NS_ANNOUNCEMENT, it.note ?: "", Notification.ANNOUNCEMENT, 60))) + } + } + if (therapyEvents.isNotEmpty()) + repository.runTransactionForResult(SyncNsTherapyEventTransaction(therapyEvents)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving therapy event", it) + } + .blockingGet() + .also { result -> + therapyEvents.clear() + result.inserted.forEach { therapyEvent -> + val action = when (therapyEvent.type) { + TherapyEvent.Type.CANNULA_CHANGE -> UserEntry.Action.SITE_CHANGE + TherapyEvent.Type.INSULIN_CHANGE -> UserEntry.Action.RESERVOIR_CHANGE + else -> UserEntry.Action.CAREPORTAL + } + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + action, UserEntry.Sources.NSClient, therapyEvent.note ?: "", + listOf(ValueWithUnit.Timestamp(therapyEvent.timestamp), + ValueWithUnit.TherapyEventType(therapyEvent.type), + ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Inserted TherapyEvent $therapyEvent") + inserted.inc(NSTherapyEvent::class.java.simpleName) + } + result.invalidated.forEach { therapyEvent -> + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.CAREPORTAL_REMOVED, UserEntry.Sources.NSClient, therapyEvent.note ?: "", + listOf(ValueWithUnit.Timestamp(therapyEvent.timestamp), + ValueWithUnit.TherapyEventType(therapyEvent.type), + ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated TherapyEvent $therapyEvent") + invalidated.inc(NSTherapyEvent::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId TherapyEvent $it") + nsIdUpdated.inc(NSTherapyEvent::class.java.simpleName) + } + result.updatedDuration.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId TherapyEvent $it") + durationUpdated.inc(NSTherapyEvent::class.java.simpleName) + } + } + + sendLog("TherapyEvent", NSTherapyEvent::class.java.simpleName) + SystemClock.sleep(pause) + + if (offlineEvents.isNotEmpty()) + repository.runTransactionForResult(SyncNsOfflineEventTransaction(offlineEvents)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving OfflineEvent", it) + } + .blockingGet() + .also { result -> + result.inserted.forEach { oe -> + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.LOOP_CHANGE, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.OfflineEventReason(oe.reason), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Inserted OfflineEvent $oe") + inserted.inc(NSOfflineEvent::class.java.simpleName) + } + result.invalidated.forEach { oe -> + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.LOOP_REMOVED, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.OfflineEventReason(oe.reason), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated OfflineEvent $oe") + invalidated.inc(NSOfflineEvent::class.java.simpleName) + } + result.ended.forEach { oe -> + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.LOOP_CHANGE, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.OfflineEventReason(oe.reason), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(oe.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Updated OfflineEvent $oe") + ended.inc(NSOfflineEvent::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId OfflineEvent $it") + nsIdUpdated.inc(NSOfflineEvent::class.java.simpleName) + } + result.updatedDuration.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated duration OfflineEvent $it") + durationUpdated.inc(NSOfflineEvent::class.java.simpleName) + } + } + + sendLog("OfflineEvent", NSOfflineEvent::class.java.simpleName) + SystemClock.sleep(pause) + + if (extendedBoluses.isNotEmpty()) + repository.runTransactionForResult(SyncNsExtendedBolusTransaction(extendedBoluses)) + .doOnError { + aapsLogger.error(LTag.DATABASE, "Error while saving extended bolus", it) + } + .blockingGet() + .also { result -> + result.inserted.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.EXTENDED_BOLUS, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.Timestamp(it.timestamp), + ValueWithUnit.Insulin(it.amount), + ValueWithUnit.UnitPerHour(it.rate), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) + ) + ) + ) + if (it.isEmulatingTempBasal) virtualPumpPlugin.fakeDataDetected = true + aapsLogger.debug(LTag.DATABASE, "Inserted ExtendedBolus $it") + inserted.inc(NSExtendedBolus::class.java.simpleName) + } + result.invalidated.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.EXTENDED_BOLUS_REMOVED, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.Timestamp(it.timestamp), + ValueWithUnit.Insulin(it.amount), + ValueWithUnit.UnitPerHour(it.rate), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Invalidated ExtendedBolus $it") + invalidated.inc(NSExtendedBolus::class.java.simpleName) + } + result.ended.forEach { + if (config.NSCLIENT.not()) userEntries.add( + UserEntryTransaction.Entry( + dateUtil.now(), + UserEntry.Action.CANCEL_EXTENDED_BOLUS, UserEntry.Sources.NSClient, "", + listOf( + ValueWithUnit.Timestamp(it.timestamp), + ValueWithUnit.Insulin(it.amount), + ValueWithUnit.UnitPerHour(it.rate), + ValueWithUnit.Minute(TimeUnit.MILLISECONDS.toMinutes(it.duration).toInt()) + ) + ) + ) + aapsLogger.debug(LTag.DATABASE, "Updated ExtendedBolus $it") + ended.inc(NSExtendedBolus::class.java.simpleName) + } + result.updatedNsId.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated nsId ExtendedBolus $it") + nsIdUpdated.inc(NSExtendedBolus::class.java.simpleName) + } + result.updatedDuration.forEach { + aapsLogger.debug(LTag.DATABASE, "Updated duration ExtendedBolus $it") + durationUpdated.inc(NSExtendedBolus::class.java.simpleName) + } + } + + sendLog("ExtendedBolus", NSExtendedBolus::class.java.simpleName) + SystemClock.sleep(pause) + + uel.log(userEntries) + rxBus.send(EventNSClientNewLog("DONE TR", "", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + } + + private fun sendLog(item: String, clazz: String) { + inserted[clazz]?.let { + rxBus.send(EventNSClientNewLog("INSERT", "$item $it", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + } + inserted.remove(clazz) + updated[clazz]?.let { + rxBus.send(EventNSClientNewLog("UPDATE", "$item $it", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + } + updated.remove(clazz) + invalidated[clazz]?.let { + rxBus.send(EventNSClientNewLog("INVALIDATE", "$item $it", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + } + invalidated.remove(clazz) + nsIdUpdated[clazz]?.let { + rxBus.send(EventNSClientNewLog("NS_ID", "$item $it", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + } + nsIdUpdated.remove(clazz) + durationUpdated[clazz]?.let { + rxBus.send(EventNSClientNewLog("DURATION", "$item $it", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + } + durationUpdated.remove(clazz) + ended[clazz]?.let { + rxBus.send(EventNSClientNewLog("CUT", "$item $it", activePlugin.activeNsClient?.version ?: NsClient.Version.V3)) + } + ended.remove(clazz) + } +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientNewLog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientNewLog.kt similarity index 71% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientNewLog.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientNewLog.kt index db499d6296..ecef80a645 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientNewLog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientNewLog.kt @@ -1,10 +1,11 @@ -package info.nightscout.androidaps.plugins.general.nsclient.events +package info.nightscout.androidaps.plugins.sync.nsShared.events +import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.rx.events.Event import java.text.SimpleDateFormat import java.util.Locale -class EventNSClientNewLog(var action: String, var logText: String) : Event() { +class EventNSClientNewLog(val action: String, val logText: String, val version: NsClient.Version) : Event() { var date = System.currentTimeMillis() private var timeFormat = SimpleDateFormat("HH:mm:ss", Locale.getDefault()) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientResend.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientResend.kt similarity index 58% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientResend.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientResend.kt index 51b2528229..5c34cf5b68 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/events/EventNSClientResend.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientResend.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.events +package info.nightscout.androidaps.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/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt new file mode 100644 index 0000000000..e83c862a99 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt @@ -0,0 +1,9 @@ +package info.nightscout.androidaps.plugins.sync.nsShared.events + +import info.nightscout.androidaps.events.EventStatus +import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.androidaps.interfaces.ResourceHelper + +class EventNSClientStatus(var text: String, val version: NsClient.Version) : EventStatus() { + override fun getStatus(rh: ResourceHelper): String = text +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt new file mode 100644 index 0000000000..af08d1acaa --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientUpdateGUI.kt @@ -0,0 +1,5 @@ +package info.nightscout.androidaps.plugins.sync.nsShared.events + +import info.nightscout.rx.events.EventUpdateGui + +class EventNSClientUpdateGUI : EventUpdateGui() \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/DataSyncSelectorImplementation.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt similarity index 69% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/DataSyncSelectorImplementation.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt index 8ef4968ab8..0fe20d456f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/DataSyncSelectorImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient +package info.nightscout.androidaps.plugins.sync.nsclient import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository @@ -20,7 +20,9 @@ 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.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.extensions.toJson import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -34,7 +36,6 @@ class DataSyncSelectorImplementation @Inject constructor( private val aapsLogger: AAPSLogger, private val dateUtil: DateUtil, private val profileFunction: ProfileFunction, - private val nsClientPlugin: NSClientPlugin, private val activePlugin: ActivePlugin, private val appRepository: AppRepository, private val profilePlugin: ProfilePlugin @@ -96,30 +97,10 @@ class DataSyncSelectorImplementation @Inject constructor( } override fun resetToNextFullSync() { - appRepository.getLastGlucoseValueIdWrapped().blockingGet().run { - val currentLast = if (this is ValueWrapper.Existing) this.value else 0L - sp.putLong(R.string.key_ns_glucose_value_new_data_id, currentLast) - } sp.remove(R.string.key_ns_glucose_value_last_synced_id) - - appRepository.getLastTemporaryBasalIdWrapped().blockingGet().run { - val currentLast = if (this is ValueWrapper.Existing) this.value else 0L - sp.putLong(R.string.key_ns_temporary_basal_new_data_id, currentLast) - } sp.remove(R.string.key_ns_temporary_basal_last_synced_id) - - appRepository.getLastTempTargetIdWrapped().blockingGet().run { - val currentLast = if (this is ValueWrapper.Existing) this.value else 0L - sp.putLong(R.string.key_ns_temporary_target_new_data_id, currentLast) - } sp.remove(R.string.key_ns_temporary_target_last_synced_id) - - appRepository.getLastExtendedBolusIdWrapped().blockingGet().run { - val currentLast = if (this is ValueWrapper.Existing) this.value else 0L - sp.putLong(R.string.key_ns_extended_bolus_new_data_id, currentLast) - } sp.remove(R.string.key_ns_extended_bolus_last_synced_id) - sp.remove(R.string.key_ns_food_last_synced_id) sp.remove(R.string.key_ns_bolus_last_synced_id) sp.remove(R.string.key_ns_carbs_last_synced_id) @@ -137,7 +118,7 @@ class DataSyncSelectorImplementation @Inject constructor( override fun confirmLastBolusIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_bolus_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting Bolus data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting Bolus data sync from $lastSynced") sp.putLong(R.string.key_ns_bolus_last_synced_id, lastSynced) } } @@ -153,9 +134,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastBolusId = -1L - //private var lastBolusTime = -1L - override fun processChangedBolusesCompat(): Boolean { + override tailrec fun processChangedBolusesCompat() { val lastDbIdWrapped = appRepository.getLastBolusIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_bolus_last_synced_id, 0) @@ -163,27 +142,35 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_bolus_last_synced_id, 0) startId = 0 } - //if (startId == lastBolusId && dateUtil.now() - lastBolusTime < 5000) return false - //lastBolusId = startId - //lastBolusTime = dateUtil.now() queueCounter.bolusesRemaining = lastDbId - startId appRepository.getNextSyncElementBolus(startId).blockingGet()?.let { bolus -> aapsLogger.info(LTag.NSCLIENT, "Loading Bolus data Start: $startId ID: ${bolus.first.id} HistoryID: ${bolus.second.id} ") when { - // only NsId changed, no need to upload - bolus.first.onlyNsIdAdded(bolus.second) -> { + // new record with existing NS id => must be coming from NS => ignore + bolus.first.id == bolus.second.id && bolus.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring Bolus. Loaded from NS: ${bolus.first.id} HistoryID: ${bolus.second.id} ") confirmLastBolusIdIfGreater(bolus.second.id) - //lastBolusId = -1 processChangedBolusesCompat() + return + } + // only NsId changed, no need to upload + bolus.first.onlyNsIdAdded(bolus.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring Bolus. Only NS id changed ID: ${bolus.first.id} HistoryID: ${bolus.second.id} ") - return false + confirmLastBolusIdIfGreater(bolus.second.id) + processChangedBolusesCompat() + return } // without nsId = create new - bolus.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("treatments", bolus.first.toJson(true, dateUtil), DataSyncSelector.PairBolus(bolus.first, bolus.second.id), "$startId/$lastDbId") - // with nsId = update - bolus.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + bolus.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd( + "treatments", + bolus.first.toJson(true, dateUtil), + DataSyncSelector.PairBolus(bolus.first, bolus.second.id), + " $startId/$lastDbId" + ) + // with nsId = update if it's modified record + bolus.first.interfaceIDs.nightscoutId != null && bolus.first.id != bolus.second.id -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", bolus.first.interfaceIDs.nightscoutId, bolus.first.toJson(false, dateUtil), @@ -191,14 +178,13 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastCarbsIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_carbs_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting Carbs data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting Carbs data sync from $lastSynced") sp.putLong(R.string.key_ns_carbs_last_synced_id, lastSynced) } } @@ -211,9 +197,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastCarbsId = -1L - //private var lastCarbsTime = -1L - override fun processChangedCarbsCompat(): Boolean { + override tailrec fun processChangedCarbsCompat() { val lastDbIdWrapped = appRepository.getLastCarbsIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_carbs_last_synced_id, 0) @@ -221,27 +205,30 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_carbs_last_synced_id, 0) startId = 0 } - //if (startId == lastCarbsId && dateUtil.now() - lastCarbsTime < 5000) return false - //lastCarbsId = startId - //lastCarbsTime = dateUtil.now() queueCounter.carbsRemaining = lastDbId - startId appRepository.getNextSyncElementCarbs(startId).blockingGet()?.let { carb -> aapsLogger.info(LTag.NSCLIENT, "Loading Carbs data Start: $startId ID: ${carb.first.id} HistoryID: ${carb.second.id} ") when { - // only NsId changed, no need to upload - carb.first.onlyNsIdAdded(carb.second) -> { + // new record with existing NS id => must be coming from NS => ignore + carb.first.id == carb.second.id && carb.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring Carbs. Loaded from NS: ${carb.first.id} HistoryID: ${carb.second.id} ") confirmLastCarbsIdIfGreater(carb.second.id) - //lastCarbsId = -1 processChangedCarbsCompat() + return + } + // only NsId changed, no need to upload + carb.first.onlyNsIdAdded(carb.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring Carbs. Only NS id changed ID: ${carb.first.id} HistoryID: ${carb.second.id} ") - return false + confirmLastCarbsIdIfGreater(carb.second.id) + processChangedCarbsCompat() + return } // without nsId = create new - carb.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("treatments", carb.first.toJson(true, dateUtil), DataSyncSelector.PairCarbs(carb.first, carb.second.id), "$startId/$lastDbId") - // with nsId = update - carb.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + carb.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd("treatments", carb.first.toJson(true, dateUtil), DataSyncSelector.PairCarbs(carb.first, carb.second.id), "$startId/$lastDbId") + // with nsId = update if it's modified record + carb.first.interfaceIDs.nightscoutId != null && carb.first.id != carb.second.id -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", carb.first.interfaceIDs.nightscoutId, carb.first.toJson(false, dateUtil), @@ -249,14 +236,13 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastBolusCalculatorResultsIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_bolus_calculator_result_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting BolusCalculatorResult data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting BolusCalculatorResult data sync from $lastSynced") sp.putLong(R.string.key_ns_bolus_calculator_result_last_synced_id, lastSynced) } } @@ -269,9 +255,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastBcrId = -1L - //private var lastBcrTime = -1L - override fun processChangedBolusCalculatorResultsCompat(): Boolean { + override tailrec fun processChangedBolusCalculatorResultsCompat() { val lastDbIdWrapped = appRepository.getLastBolusCalculatorResultIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_bolus_calculator_result_last_synced_id, 0) @@ -279,44 +263,46 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_bolus_calculator_result_last_synced_id, 0) startId = 0 } - //if (startId == lastBcrId && dateUtil.now() - lastBcrTime < 5000) return false - //lastBcrId = startId - //lastBcrTime = dateUtil.now() queueCounter.bcrRemaining = lastDbId - startId appRepository.getNextSyncElementBolusCalculatorResult(startId).blockingGet()?.let { bolusCalculatorResult -> aapsLogger.info(LTag.NSCLIENT, "Loading BolusCalculatorResult data Start: $startId ID: ${bolusCalculatorResult.first.id} HistoryID: ${bolusCalculatorResult.second.id} ") when { - // only NsId changed, no need to upload - bolusCalculatorResult.first.onlyNsIdAdded(bolusCalculatorResult.second) -> { + // new record with existing NS id => must be coming from NS => ignore + bolusCalculatorResult.first.id == bolusCalculatorResult.second.id && bolusCalculatorResult.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring BolusCalculatorResult. Loaded from NS: ${bolusCalculatorResult.first.id} HistoryID: ${bolusCalculatorResult.second.id} ") confirmLastBolusCalculatorResultsIdIfGreater(bolusCalculatorResult.second.id) - //lastBcrId = -1 processChangedBolusCalculatorResultsCompat() + return + } + // only NsId changed, no need to upload + bolusCalculatorResult.first.onlyNsIdAdded(bolusCalculatorResult.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring BolusCalculatorResult. Only NS id changed ID: ${bolusCalculatorResult.first.id} HistoryID: ${bolusCalculatorResult.second.id} ") - return false + confirmLastBolusCalculatorResultsIdIfGreater(bolusCalculatorResult.second.id) + processChangedBolusCalculatorResultsCompat() + return } // without nsId = create new - bolusCalculatorResult.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd( + bolusCalculatorResult.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd( "treatments", bolusCalculatorResult.first.toJson(true, dateUtil, profileFunction), DataSyncSelector.PairBolusCalculatorResult(bolusCalculatorResult.first, bolusCalculatorResult.second.id), "$startId/$lastDbId" ) - // with nsId = update - bolusCalculatorResult.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + // with nsId = update if it's modified record + bolusCalculatorResult.first.interfaceIDs.nightscoutId != null && bolusCalculatorResult.first.id != bolusCalculatorResult.second.id -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", bolusCalculatorResult.first.interfaceIDs.nightscoutId, bolusCalculatorResult.first.toJson(false, dateUtil, profileFunction), DataSyncSelector.PairBolusCalculatorResult(bolusCalculatorResult.first, bolusCalculatorResult.second.id), "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastTempTargetsIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_temporary_target_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting TemporaryTarget data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting TemporaryTarget data sync from $lastSynced") sp.putLong(R.string.key_ns_temporary_target_last_synced_id, lastSynced) } } @@ -329,9 +315,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastTtId = -1L - //private var lastTtTime = -1L - override fun processChangedTempTargetsCompat(): Boolean { + override tailrec fun processChangedTempTargetsCompat() { val lastDbIdWrapped = appRepository.getLastTempTargetIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_temporary_target_last_synced_id, 0) @@ -339,40 +323,35 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_temporary_target_last_synced_id, 0) startId = 0 } - //if (startId == lastTtId && dateUtil.now() - lastTtTime < 5000) return false - //lastTtId = startId - //lastTtTime = dateUtil.now() queueCounter.ttsRemaining = lastDbId - startId appRepository.getNextSyncElementTemporaryTarget(startId).blockingGet()?.let { tt -> aapsLogger.info(LTag.NSCLIENT, "Loading TemporaryTarget data Start: $startId ID: ${tt.first.id} HistoryID: ${tt.second.id} ") when { - // record is not valid record and we are within first sync, no need to upload - tt.first.id != tt.second.id && tt.second.id <= sp.getLong(R.string.key_ns_temporary_target_new_data_id, 0) -> { + // new record with existing NS id => must be coming from NS => ignore + tt.first.id == tt.second.id && tt.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring TemporaryTarget. Loaded from NS: ${tt.first.id} HistoryID: ${tt.second.id} ") confirmLastTempTargetsIdIfGreater(tt.second.id) - //lastTbrId = -1 processChangedTempTargetsCompat() - aapsLogger.info(LTag.NSCLIENT, "Ignoring TemporaryTarget. Change within first sync ID: ${tt.first.id} HistoryID: ${tt.second.id} ") - return false + return } // only NsId changed, no need to upload - tt.first.onlyNsIdAdded(tt.second) -> { - confirmLastTempTargetsIdIfGreater(tt.second.id) - //lastTtId = -1 - processChangedTempTargetsCompat() + tt.first.onlyNsIdAdded(tt.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring TemporaryTarget. Only NS id changed ID: ${tt.first.id} HistoryID: ${tt.second.id} ") - return false + confirmLastTempTargetsIdIfGreater(tt.second.id) + processChangedTempTargetsCompat() + return } // without nsId = create new - tt.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd( + tt.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd( "treatments", tt.first.toJson(true, profileFunction.getUnits(), dateUtil), DataSyncSelector.PairTemporaryTarget(tt.first, tt.second.id), "$startId/$lastDbId" ) // existing with nsId = update - tt.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + tt.first.interfaceIDs.nightscoutId != null -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", tt.first.interfaceIDs.nightscoutId, tt.first.toJson(false, profileFunction.getUnits(), dateUtil), @@ -380,14 +359,13 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastFoodIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_food_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting Food data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting Food data sync from $lastSynced") sp.putLong(R.string.key_ns_food_last_synced_id, lastSynced) } } @@ -400,9 +378,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastFoodId = -1L - //private var lastFoodTime = -1L - override fun processChangedFoodsCompat(): Boolean { + override tailrec fun processChangedFoodsCompat() { val lastDbIdWrapped = appRepository.getLastFoodIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_food_last_synced_id, 0) @@ -410,27 +386,30 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_food_last_synced_id, 0) startId = 0 } - //if (startId == lastFoodId && dateUtil.now() - lastFoodTime < 5000) return false - //lastFoodId = startId - //lastFoodTime = dateUtil.now() queueCounter.foodsRemaining = lastDbId - startId appRepository.getNextSyncElementFood(startId).blockingGet()?.let { food -> aapsLogger.info(LTag.NSCLIENT, "Loading Food data Start: $startId ID: ${food.first.id} HistoryID: ${food.second} ") when { - // only NsId changed, no need to upload - food.first.onlyNsIdAdded(food.second) -> { + // new record with existing NS id => must be coming from NS => ignore + food.first.id == food.second.id && food.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring Food. Loaded from NS: ${food.first.id} HistoryID: ${food.second.id} ") confirmLastFoodIdIfGreater(food.second.id) - //lastFoodId = -1 processChangedFoodsCompat() + return + } + // only NsId changed, no need to upload + food.first.onlyNsIdAdded(food.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring Food. Only NS id changed ID: ${food.first.id} HistoryID: ${food.second.id} ") - return false + confirmLastFoodIdIfGreater(food.second.id) + processChangedFoodsCompat() + return } // without nsId = create new - food.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("food", food.first.toJson(true), DataSyncSelector.PairFood(food.first, food.second.id), "$startId/$lastDbId") + food.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd("food", food.first.toJson(true), DataSyncSelector.PairFood(food.first, food.second.id), "$startId/$lastDbId") // with nsId = update - food.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + food.first.interfaceIDs.nightscoutId != null -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "food", food.first.interfaceIDs.nightscoutId, food.first.toJson(false), @@ -438,14 +417,13 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastGlucoseValueIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_glucose_value_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting GlucoseValue data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting GlucoseValue data sync from $lastSynced") sp.putLong(R.string.key_ns_glucose_value_last_synced_id, lastSynced) } } @@ -458,8 +436,6 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastGvId = -1L - //private var lastGvTime = -1L override tailrec fun processChangedGlucoseValuesCompat() { val lastDbIdWrapped = appRepository.getLastGlucoseValueIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L @@ -468,35 +444,31 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_glucose_value_last_synced_id, 0) startId = 0 } - //if (startId == lastGvId && dateUtil.now() - lastGvTime < 5000) return false - //lastGvId = startId - //lastGvTime = dateUtil.now() queueCounter.gvsRemaining = lastDbId - startId - var tailCall = false appRepository.getNextSyncElementGlucoseValue(startId).blockingGet()?.let { gv -> aapsLogger.info(LTag.NSCLIENT, "Loading GlucoseValue data ID: ${gv.first.id} HistoryID: ${gv.second.id} ") if (activePlugin.activeBgSource.shouldUploadToNs(gv.first)) { when { - // record is not valid record and we are within first sync, no need to upload - gv.first.id != gv.second.id && gv.second.id <= sp.getLong(R.string.key_ns_glucose_value_new_data_id, 0) -> { + // new record with existing NS id => must be coming from NS => ignore + gv.first.id == gv.second.id && gv.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring GlucoseValue. Loaded from NS: ${gv.first.id} HistoryID: ${gv.second.id} ") confirmLastGlucoseValueIdIfGreater(gv.second.id) - //lastGvId = -1 - aapsLogger.info(LTag.NSCLIENT, "Ignoring GlucoseValue. Change within first sync ID: ${gv.first.id} HistoryID: ${gv.second.id} ") - tailCall = true + processChangedGlucoseValuesCompat() + return } // only NsId changed, no need to upload - gv.first.onlyNsIdAdded(gv.second) -> { - confirmLastGlucoseValueIdIfGreater(gv.second.id) - //lastGvId = -1 + gv.first.onlyNsIdAdded(gv.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring GlucoseValue. Only NS id changed ID: ${gv.first.id} HistoryID: ${gv.second.id} ") - tailCall = true + confirmLastGlucoseValueIdIfGreater(gv.second.id) + processChangedGlucoseValuesCompat() + return } // without nsId = create new - gv.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("entries", gv.first.toJson(true, dateUtil), DataSyncSelector.PairGlucoseValue(gv.first, gv.second.id), "$startId/$lastDbId") + gv.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd("entries", gv.first.toJson(true, dateUtil), DataSyncSelector.PairGlucoseValue(gv.first, gv.second.id), "$startId/$lastDbId") // with nsId = update - else -> // gv.first.interfaceIDs.nightscoutId != null - nsClientPlugin.nsClientService?.dbUpdate( + else -> // gv.first.interfaceIDs.nightscoutId != null + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "entries", gv.first.interfaceIDs.nightscoutId, gv.first.toJson(false, dateUtil), @@ -506,18 +478,15 @@ class DataSyncSelectorImplementation @Inject constructor( } } else { confirmLastGlucoseValueIdIfGreater(gv.second.id) - //lastGvId = -1 - tailCall = true + processChangedGlucoseValuesCompat() + return } } - if (tailCall) { - processChangedGlucoseValuesCompat() - } } override fun confirmLastTherapyEventIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_therapy_event_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting TherapyEvents data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting TherapyEvents data sync from $lastSynced") sp.putLong(R.string.key_ns_therapy_event_last_synced_id, lastSynced) } } @@ -530,9 +499,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastTeId = -1L - //private var lastTeTime = -1L - override fun processChangedTherapyEventsCompat(): Boolean { + override tailrec fun processChangedTherapyEventsCompat() { val lastDbIdWrapped = appRepository.getLastTherapyEventIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_therapy_event_last_synced_id, 0) @@ -540,27 +507,30 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_therapy_event_last_synced_id, 0) startId = 0 } - //if (startId == lastTeId && dateUtil.now() - lastTeTime < 5000) return false - //lastTeId = startId - //lastTeTime = dateUtil.now() queueCounter.tesRemaining = lastDbId - startId appRepository.getNextSyncElementTherapyEvent(startId).blockingGet()?.let { te -> aapsLogger.info(LTag.NSCLIENT, "Loading TherapyEvents data Start: $startId ID: ${te.first.id} HistoryID: ${te.second} ") when { - // only NsId changed, no need to upload - te.first.onlyNsIdAdded(te.second) -> { + // new record with existing NS id => must be coming from NS => ignore + te.first.id == te.second.id && te.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring TherapyEvent. Loaded from NS: ${te.first.id} HistoryID: ${te.second.id} ") confirmLastTherapyEventIdIfGreater(te.second.id) - //lastTeId = -1 processChangedTherapyEventsCompat() - aapsLogger.info(LTag.NSCLIENT, "Ignoring TherapyEvents. Only NS id changed ID: ${te.first.id} HistoryID: ${te.second.id} ") - return false + return + } + // only NsId changed, no need to upload + te.first.onlyNsIdAdded(te.second) -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring TherapyEvent. Only NS id changed ID: ${te.first.id} HistoryID: ${te.second.id} ") + confirmLastTherapyEventIdIfGreater(te.second.id) + processChangedTherapyEventsCompat() + return } // without nsId = create new - te.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("treatments", te.first.toJson(true, dateUtil), DataSyncSelector.PairTherapyEvent(te.first, te.second.id), "$startId/$lastDbId") + te.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd("treatments", te.first.toJson(true, dateUtil), DataSyncSelector.PairTherapyEvent(te.first, te.second.id), "$startId/$lastDbId") // nsId = update - te.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + te.first.interfaceIDs.nightscoutId != null -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", te.first.interfaceIDs.nightscoutId, te.first.toJson(false, dateUtil), @@ -568,14 +538,13 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastDeviceStatusIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_device_status_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting DeviceStatus data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting DeviceStatus data sync from $lastSynced") sp.putLong(R.string.key_ns_device_status_last_synced_id, lastSynced) } } @@ -587,9 +556,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastDsId = -1L - //private var lastDsTime = -1L - override fun processChangedDeviceStatusesCompat(): Boolean { + override fun processChangedDeviceStatusesCompat() { val lastDbIdWrapped = appRepository.getLastDeviceStatusIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_device_status_last_synced_id, 0) @@ -597,27 +564,23 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_device_status_last_synced_id, 0) startId = 0 } - //if (startId == lastDsId && dateUtil.now() - lastDsTime < 5000) return false - //lastDsId = startId - //lastDsTime = dateUtil.now() queueCounter.dssRemaining = lastDbId - startId appRepository.getNextSyncElementDeviceStatus(startId).blockingGet()?.let { deviceStatus -> aapsLogger.info(LTag.NSCLIENT, "Loading DeviceStatus data Start: $startId ID: ${deviceStatus.id}") when { // without nsId = create new deviceStatus.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("devicestatus", deviceStatus.toJson(dateUtil), deviceStatus, "$startId/$lastDbId") + activePlugin.activeNsClient?.nsClientService?.dbAdd("devicestatus", deviceStatus.toJson(dateUtil), deviceStatus, "$startId/$lastDbId") // with nsId = ignore deviceStatus.interfaceIDs.nightscoutId != null -> Any() } - return true + return } - return false } override fun confirmLastTemporaryBasalIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_temporary_basal_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting TemporaryBasal data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting TemporaryBasal data sync from $lastSynced") sp.putLong(R.string.key_ns_temporary_basal_last_synced_id, lastSynced) } } @@ -630,9 +593,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastTbrId = -1L - //private var lastTbrTime = -1L - override fun processChangedTemporaryBasalsCompat(): Boolean { + override tailrec fun processChangedTemporaryBasalsCompat() { val lastDbIdWrapped = appRepository.getLastTemporaryBasalIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_temporary_basal_last_synced_id, 0) @@ -640,42 +601,37 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_temporary_basal_last_synced_id, 0) startId = 0 } - //if (startId == lastTbrId && dateUtil.now() - lastTbrTime < 5000) return false - //lastTbrId = startId - //lastTbrTime = dateUtil.now() queueCounter.tbrsRemaining = lastDbId - startId appRepository.getNextSyncElementTemporaryBasal(startId).blockingGet()?.let { tb -> aapsLogger.info(LTag.NSCLIENT, "Loading TemporaryBasal data Start: $startId ID: ${tb.first.id} HistoryID: ${tb.second} ") val profile = profileFunction.getProfile(tb.first.timestamp) if (profile != null) { when { - // record is not valid record and we are within first sync, no need to upload - tb.first.id != tb.second.id && tb.second.id <= sp.getLong(R.string.key_ns_temporary_basal_new_data_id, 0) -> { + // new record with existing NS id => must be coming from NS => ignore + tb.first.id == tb.second.id && tb.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring TemporaryBasal. Loaded from NS: ${tb.first.id} HistoryID: ${tb.second.id} ") confirmLastTemporaryBasalIdIfGreater(tb.second.id) - //lastTbrId = -1 processChangedTemporaryBasalsCompat() - aapsLogger.info(LTag.NSCLIENT, "Ignoring TemporaryBasal. Change within first sync ID: ${tb.first.id} HistoryID: ${tb.second.id} ") - return false + return } // only NsId changed, no need to upload - tb.first.onlyNsIdAdded(tb.second) -> { - confirmLastTemporaryBasalIdIfGreater(tb.second.id) - //lastTbrId = -1 - processChangedTemporaryBasalsCompat() + tb.first.onlyNsIdAdded(tb.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring TemporaryBasal. Only NS id changed ID: ${tb.first.id} HistoryID: ${tb.second.id} ") - return false + confirmLastTemporaryBasalIdIfGreater(tb.second.id) + processChangedTemporaryBasalsCompat() + return } // without nsId = create new - tb.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd( + tb.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd( "treatments", tb.first.toJson(true, profile, dateUtil), DataSyncSelector.PairTemporaryBasal(tb.first, tb.second.id), "$startId/$lastDbId" ) // with nsId = update - tb.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + tb.first.interfaceIDs.nightscoutId != null -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", tb.first.interfaceIDs.nightscoutId, tb.first.toJson(false, profile, dateUtil), @@ -683,19 +639,19 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } else { + aapsLogger.info(LTag.NSCLIENT, "Ignoring TemporaryBasal. No profile: ${tb.first.id} HistoryID: ${tb.second.id} ") confirmLastTemporaryBasalIdIfGreater(tb.second.id) - //lastTbrId = -1 processChangedTemporaryBasalsCompat() + return } } - return false } override fun confirmLastExtendedBolusIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_extended_bolus_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting ExtendedBolus data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting ExtendedBolus data sync from $lastSynced") sp.putLong(R.string.key_ns_extended_bolus_last_synced_id, lastSynced) } } @@ -708,9 +664,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastEbId = -1L - //private var lastEbTime = -1L - override fun processChangedExtendedBolusesCompat(): Boolean { + override tailrec fun processChangedExtendedBolusesCompat() { val lastDbIdWrapped = appRepository.getLastExtendedBolusIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_extended_bolus_last_synced_id, 0) @@ -718,42 +672,37 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_extended_bolus_last_synced_id, 0) startId = 0 } - //if (startId == lastEbId && dateUtil.now() - lastEbTime < 5000) return false - //lastEbId = startId - //lastEbTime = dateUtil.now() queueCounter.ebsRemaining = lastDbId - startId appRepository.getNextSyncElementExtendedBolus(startId).blockingGet()?.let { eb -> aapsLogger.info(LTag.NSCLIENT, "Loading ExtendedBolus data Start: $startId ID: ${eb.first.id} HistoryID: ${eb.second} ") val profile = profileFunction.getProfile(eb.first.timestamp) if (profile != null) { when { - // record is not valid record and we are within first sync, no need to upload - eb.first.id != eb.second.id && eb.second.id <= sp.getLong(R.string.key_ns_extended_bolus_new_data_id, 0) -> { + // new record with existing NS id => must be coming from NS => ignore + eb.first.id == eb.second.id && eb.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring ExtendedBolus. Loaded from NS: ${eb.first.id} HistoryID: ${eb.second.id} ") confirmLastExtendedBolusIdIfGreater(eb.second.id) - //lastTbrId = -1 processChangedExtendedBolusesCompat() - aapsLogger.info(LTag.NSCLIENT, "Ignoring ExtendedBolus. Change within first sync ID: ${eb.first.id} HistoryID: ${eb.second.id} ") - return false + return } // only NsId changed, no need to upload - eb.first.onlyNsIdAdded(eb.second) -> { - confirmLastExtendedBolusIdIfGreater(eb.second.id) - //lastEbId = -1 - processChangedExtendedBolusesCompat() + eb.first.onlyNsIdAdded(eb.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring ExtendedBolus. Only NS id changed ID: ${eb.first.id} HistoryID: ${eb.second.id} ") - return false + confirmLastExtendedBolusIdIfGreater(eb.second.id) + processChangedExtendedBolusesCompat() + return } // without nsId = create new - eb.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd( + eb.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd( "treatments", eb.first.toJson(true, profile, dateUtil), DataSyncSelector.PairExtendedBolus(eb.first, eb.second.id), "$startId/$lastDbId" ) // with nsId = update - eb.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + eb.first.interfaceIDs.nightscoutId != null -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", eb.first.interfaceIDs.nightscoutId, eb.first.toJson(false, profile, dateUtil), @@ -761,19 +710,19 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } else { + aapsLogger.info(LTag.NSCLIENT, "Ignoring ExtendedBolus. No profile: ${eb.first.id} HistoryID: ${eb.second.id} ") confirmLastExtendedBolusIdIfGreater(eb.second.id) - //lastEbId = -1 processChangedExtendedBolusesCompat() + return } } - return false } override fun confirmLastProfileSwitchIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_profile_switch_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting ProfileSwitch data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting ProfileSwitch data sync from $lastSynced") sp.putLong(R.string.key_ns_profile_switch_last_synced_id, lastSynced) } } @@ -785,9 +734,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastPsId = -1L - //private var lastPsTime = -1L - override fun processChangedProfileSwitchesCompat(): Boolean { + override tailrec fun processChangedProfileSwitchesCompat() { val lastDbIdWrapped = appRepository.getLastProfileSwitchIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_profile_switch_last_synced_id, 0) @@ -795,27 +742,30 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_profile_switch_last_synced_id, 0) startId = 0 } - //if (startId == lastPsId && dateUtil.now() - lastPsTime < 5000) return false - //lastPsId = startId - //lastPsTime = dateUtil.now() queueCounter.pssRemaining = lastDbId - startId appRepository.getNextSyncElementProfileSwitch(startId).blockingGet()?.let { ps -> aapsLogger.info(LTag.NSCLIENT, "Loading ProfileSwitch data Start: $startId ID: ${ps.first.id} HistoryID: ${ps.second} ") when { - // only NsId changed, no need to upload - ps.first.onlyNsIdAdded(ps.second) -> { + // new record with existing NS id => must be coming from NS => ignore + ps.first.id == ps.second.id && ps.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring ProfileSwitch. Loaded from NS: ${ps.first.id} HistoryID: ${ps.second.id} ") confirmLastProfileSwitchIdIfGreater(ps.second.id) - //lastPsId = -1 processChangedProfileSwitchesCompat() + return + } + // only NsId changed, no need to upload + ps.first.onlyNsIdAdded(ps.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring ProfileSwitch. Only NS id changed ID: ${ps.first.id} HistoryID: ${ps.second.id} ") - return false + confirmLastProfileSwitchIdIfGreater(ps.second.id) + processChangedProfileSwitchesCompat() + return } // without nsId = create new - ps.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("treatments", ps.first.toJson(true, dateUtil), DataSyncSelector.PairProfileSwitch(ps.first, ps.second.id), "$startId/$lastDbId") + ps.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd("treatments", ps.first.toJson(true, dateUtil), DataSyncSelector.PairProfileSwitch(ps.first, ps.second.id), "$startId/$lastDbId") // with nsId = update - ps.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + ps.first.interfaceIDs.nightscoutId != null -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", ps.first.interfaceIDs.nightscoutId, ps.first.toJson(false, dateUtil), @@ -823,14 +773,13 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastEffectiveProfileSwitchIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_effective_profile_switch_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting EffectiveProfileSwitch data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting EffectiveProfileSwitch data sync from $lastSynced") sp.putLong(R.string.key_ns_effective_profile_switch_last_synced_id, lastSynced) } } @@ -842,9 +791,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastEpsId = -1L - //private var lastEpsTime = -1L - override fun processChangedEffectiveProfileSwitchesCompat(): Boolean { + override tailrec fun processChangedEffectiveProfileSwitchesCompat() { val lastDbIdWrapped = appRepository.getLastEffectiveProfileSwitchIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_effective_profile_switch_last_synced_id, 0) @@ -852,27 +799,35 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_effective_profile_switch_last_synced_id, 0) startId = 0 } - //if (startId == lastEpsId && dateUtil.now() - lastEpsTime < 5000) return false - //lastEpsId = startId - //lastEpsTime = dateUtil.now() queueCounter.epssRemaining = lastDbId - startId appRepository.getNextSyncElementEffectiveProfileSwitch(startId).blockingGet()?.let { ps -> aapsLogger.info(LTag.NSCLIENT, "Loading EffectiveProfileSwitch data Start: $startId ID: ${ps.first.id} HistoryID: ${ps.second} ") when { - // only NsId changed, no need to upload - ps.first.onlyNsIdAdded(ps.second) -> { + // new record with existing NS id => must be coming from NS => ignore + ps.first.id == ps.second.id && ps.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring EffectiveProfileSwitch. Loaded from NS: ${ps.first.id} HistoryID: ${ps.second.id} ") confirmLastEffectiveProfileSwitchIdIfGreater(ps.second.id) - //lastEpsId = -1 processChangedEffectiveProfileSwitchesCompat() + return + } + // only NsId changed, no need to upload + ps.first.onlyNsIdAdded(ps.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring EffectiveProfileSwitch. Only NS id changed ID: ${ps.first.id} HistoryID: ${ps.second.id} ") - return false + confirmLastEffectiveProfileSwitchIdIfGreater(ps.second.id) + processChangedEffectiveProfileSwitchesCompat() + return } // without nsId = create new - ps.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("treatments", ps.first.toJson(true, dateUtil), DataSyncSelector.PairEffectiveProfileSwitch(ps.first, ps.second.id), "$startId/$lastDbId") + ps.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd( + "treatments", + ps.first.toJson(true, dateUtil), + DataSyncSelector.PairEffectiveProfileSwitch(ps.first, ps.second.id), + "$startId/$lastDbId" + ) // with nsId = update - ps.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + ps.first.interfaceIDs.nightscoutId != null -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", ps.first.interfaceIDs.nightscoutId, ps.first.toJson(false, dateUtil), @@ -880,14 +835,13 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastOfflineEventIdIfGreater(lastSynced: Long) { if (lastSynced > sp.getLong(R.string.key_ns_offline_event_last_synced_id, 0)) { - aapsLogger.debug(LTag.NSCLIENT, "Setting OfflineEvent data sync from $lastSynced") + //aapsLogger.debug(LTag.NSCLIENT, "Setting OfflineEvent data sync from $lastSynced") sp.putLong(R.string.key_ns_offline_event_last_synced_id, lastSynced) } } @@ -900,9 +854,7 @@ class DataSyncSelectorImplementation @Inject constructor( } } - //private var lastOeId = -1L - //private var lastOeTime = -1L - override fun processChangedOfflineEventsCompat(): Boolean { + override tailrec fun processChangedOfflineEventsCompat() { val lastDbIdWrapped = appRepository.getLastOfflineEventIdWrapped().blockingGet() val lastDbId = if (lastDbIdWrapped is ValueWrapper.Existing) lastDbIdWrapped.value else 0L var startId = sp.getLong(R.string.key_ns_offline_event_last_synced_id, 0) @@ -910,27 +862,30 @@ class DataSyncSelectorImplementation @Inject constructor( sp.putLong(R.string.key_ns_offline_event_last_synced_id, 0) startId = 0 } - //if (startId == lastOeId && dateUtil.now() - lastOeTime < 5000) return false - //lastOeId = startId - //lastOeTime = dateUtil.now() queueCounter.oesRemaining = lastDbId - startId appRepository.getNextSyncElementOfflineEvent(startId).blockingGet()?.let { oe -> aapsLogger.info(LTag.NSCLIENT, "Loading OfflineEvent data Start: $startId ID: ${oe.first.id} HistoryID: ${oe.second} ") when { - // only NsId changed, no need to upload - oe.first.onlyNsIdAdded(oe.second) -> { + // new record with existing NS id => must be coming from NS => ignore + oe.first.id == oe.second.id && oe.first.interfaceIDs.nightscoutId != null -> { + aapsLogger.info(LTag.NSCLIENT, "Ignoring OfflineEvent. Loaded from NS: ${oe.first.id} HistoryID: ${oe.second.id} ") confirmLastOfflineEventIdIfGreater(oe.second.id) - //lastOeId = -1 processChangedOfflineEventsCompat() + return + } + // only NsId changed, no need to upload + oe.first.onlyNsIdAdded(oe.second) -> { aapsLogger.info(LTag.NSCLIENT, "Ignoring OfflineEvent. Only NS id changed ID: ${oe.first.id} HistoryID: ${oe.second.id} ") - return false + confirmLastOfflineEventIdIfGreater(oe.second.id) + processChangedOfflineEventsCompat() + return } // without nsId = create new - oe.first.interfaceIDs.nightscoutId == null -> - nsClientPlugin.nsClientService?.dbAdd("treatments", oe.first.toJson(true, dateUtil), DataSyncSelector.PairOfflineEvent(oe.first, oe.second.id), "$startId/$lastDbId") + oe.first.interfaceIDs.nightscoutId == null -> + activePlugin.activeNsClient?.nsClientService?.dbAdd("treatments", oe.first.toJson(true, dateUtil), DataSyncSelector.PairOfflineEvent(oe.first, oe.second.id), "$startId/$lastDbId") // existing with nsId = update - oe.first.interfaceIDs.nightscoutId != null -> - nsClientPlugin.nsClientService?.dbUpdate( + oe.first.interfaceIDs.nightscoutId != null -> + activePlugin.activeNsClient?.nsClientService?.dbUpdate( "treatments", oe.first.interfaceIDs.nightscoutId, oe.first.toJson(false, dateUtil), @@ -938,9 +893,8 @@ class DataSyncSelectorImplementation @Inject constructor( "$startId/$lastDbId" ) } - return true + return } - return false } override fun confirmLastProfileStore(lastSynced: Long) { @@ -954,7 +908,7 @@ class DataSyncSelectorImplementation @Inject constructor( if (lastChange > lastSync) { if (profilePlugin.profile?.allProfilesValid != true) return val profileJson = profilePlugin.profile?.data ?: return - nsClientPlugin.nsClientService?.dbAdd("profile", profileJson, DataSyncSelector.PairProfileStore(profileJson, dateUtil.now()), "") + activePlugin.activeNsClient?.nsClientService?.dbAdd("profile", profileJson, DataSyncSelector.PairProfileStore(profileJson, dateUtil.now()), "") } } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddAckWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddAckWorker.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddAckWorker.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddAckWorker.kt index 14a3786a2b..65ecac8683 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddAckWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddAckWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient +package info.nightscout.androidaps.plugins.sync.nsclient import android.content.Context import android.os.SystemClock @@ -36,8 +36,9 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairProfileSwitch 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.plugins.general.nsclient.acks.NSAddAck -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientNewLog +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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -68,7 +69,7 @@ class NSClientAddAckWorker( if (sp.getBoolean(R.string.key_ns_sync_slow, false)) SystemClock.sleep(1000) when (ack.originalObject) { - is PairTemporaryTarget -> { + is PairTemporaryTarget -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdTemporaryTargetTransaction(pair.value)) @@ -82,12 +83,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastTempTargetsIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked TemporaryTarget " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked TemporaryTarget " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedTempTargetsCompat() } - is PairGlucoseValue -> { + is PairGlucoseValue -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdGlucoseValueTransaction(pair.value)) @@ -101,12 +102,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastGlucoseValueIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked GlucoseValue " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked GlucoseValue " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedGlucoseValuesCompat() } - is PairFood -> { + is PairFood -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdFoodTransaction(pair.value)) @@ -120,12 +121,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastFoodIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked Food " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked Food " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedFoodsCompat() } - is PairTherapyEvent -> { + is PairTherapyEvent -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdTherapyEventTransaction(pair.value)) @@ -139,12 +140,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastTherapyEventIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked TherapyEvent " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked TherapyEvent " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedTherapyEventsCompat() } - is PairBolus -> { + is PairBolus -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdBolusTransaction(pair.value)) @@ -158,12 +159,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastBolusIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked Bolus " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked Bolus " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedBolusesCompat() } - is PairCarbs -> { + is PairCarbs -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdCarbsTransaction(pair.value)) @@ -177,12 +178,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastCarbsIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked Carbs " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked Carbs " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedCarbsCompat() } - is PairBolusCalculatorResult -> { + is PairBolusCalculatorResult -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdBolusCalculatorResultTransaction(pair.value)) @@ -196,12 +197,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastBolusCalculatorResultsIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked BolusCalculatorResult " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked BolusCalculatorResult " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedBolusCalculatorResultsCompat() } - is PairTemporaryBasal -> { + is PairTemporaryBasal -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdTemporaryBasalTransaction(pair.value)) @@ -215,12 +216,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastTemporaryBasalIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked TemporaryBasal " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked TemporaryBasal " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedTemporaryBasalsCompat() } - is PairExtendedBolus -> { + is PairExtendedBolus -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdExtendedBolusTransaction(pair.value)) @@ -234,12 +235,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastExtendedBolusIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked ExtendedBolus " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked ExtendedBolus " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedExtendedBolusesCompat() } - is PairProfileSwitch -> { + is PairProfileSwitch -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdProfileSwitchTransaction(pair.value)) @@ -253,12 +254,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastProfileSwitchIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked ProfileSwitch " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked ProfileSwitch " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedProfileSwitchesCompat() } - is PairEffectiveProfileSwitch -> { + is PairEffectiveProfileSwitch -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdEffectiveProfileSwitchTransaction(pair.value)) @@ -272,12 +273,12 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastEffectiveProfileSwitchIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked EffectiveProfileSwitch " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked EffectiveProfileSwitch " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedEffectiveProfileSwitchesCompat() } - is DeviceStatus -> { + is DeviceStatus -> { val deviceStatus = ack.originalObject deviceStatus.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdDeviceStatusTransaction(deviceStatus)) @@ -291,17 +292,17 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastDeviceStatusIdIfGreater(deviceStatus.id) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked DeviceStatus " + deviceStatus.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked DeviceStatus " + deviceStatus.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedDeviceStatusesCompat() } - is PairProfileStore -> { + is PairProfileStore -> { dataSyncSelector.confirmLastProfileStore(ack.originalObject.timestampSync) - rxBus.send(EventNSClientNewLog("DBADD", "Acked ProfileStore " + ack.id)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked ProfileStore " + ack.id, NsClient.Version.V1)) } - is PairOfflineEvent -> { + is PairOfflineEvent -> { val pair = ack.originalObject pair.value.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdOfflineEventTransaction(pair.value)) @@ -315,7 +316,7 @@ class NSClientAddAckWorker( dataSyncSelector.confirmLastOfflineEventIdIfGreater(pair.updateRecordId) } .blockingGet() - rxBus.send(EventNSClientNewLog("DBADD", "Acked OfflineEvent " + pair.value.interfaceIDs.nightscoutId)) + rxBus.send(EventNSClientNewLog("DBADD", "Acked OfflineEvent " + pair.value.interfaceIDs.nightscoutId, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedOfflineEventsCompat() } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt new file mode 100644 index 0000000000..be311e750f --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt @@ -0,0 +1,180 @@ +package info.nightscout.androidaps.plugins.sync.nsclient + +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.androidaps.utils.DateUtil +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.plugins.sync.nsclient.extensions.bolusFromJson +import info.nightscout.plugins.sync.nsclient.extensions.carbsFromJson +import info.nightscout.plugins.sync.nsclient.extensions.effectiveProfileSwitchFromJson +import info.nightscout.plugins.sync.nsclient.extensions.extendedBolusFromJson +import info.nightscout.plugins.sync.nsclient.extensions.isEffectiveProfileSwitch +import info.nightscout.plugins.sync.nsclient.extensions.offlineEventFromJson +import info.nightscout.plugins.sync.nsclient.extensions.profileSwitchFromJson +import info.nightscout.plugins.sync.nsclient.extensions.temporaryBasalFromJson +import info.nightscout.plugins.sync.nsclient.extensions.temporaryTargetFromJson +import info.nightscout.plugins.sync.nsclient.extensions.therapyEventFromJson +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 javax.inject.Inject + +class NSClientAddUpdateWorker( + context: Context, + params: WorkerParameters +) : Worker(context, params) { + + @Inject lateinit var dataWorkerStorage: DataWorkerStorage + @Inject lateinit var aapsLogger: AAPSLogger + @Inject lateinit var buildHelper: BuildHelper + @Inject lateinit var sp: SP + @Inject lateinit var dateUtil: DateUtil + @Inject lateinit var config: Config + @Inject lateinit var repository: AppRepository + @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 + + override fun doWork(): Result { + val treatments = dataWorkerStorage.pickupJSONArray(inputData.getLong(DataWorkerStorage.STORE_KEY, -1)) + ?: return Result.failure(workDataOf("Error" to "missing input data")) + + val ret = Result.success() + var latestDateInReceivedData = 0L + + for (i in 0 until treatments.length()) { + var json = treatments.getJSONObject(i) + aapsLogger.debug(LTag.DATABASE, "Received NS treatment: $json") + + val insulin = JsonHelper.safeGetDouble(json, "insulin") + val carbs = JsonHelper.safeGetDouble(json, "carbs") + var eventType = JsonHelper.safeGetString(json, "eventType") + if (eventType == null) { + aapsLogger.debug(LTag.NSCLIENT, "Wrong treatment. Ignoring : $json") + continue + } + + //Find latest date in treatment + val mills = JsonHelper.safeGetLong(json, "mills") + if (mills != 0L && mills < dateUtil.now()) + if (mills > latestDateInReceivedData) latestDateInReceivedData = mills + + if (insulin > 0) { + if (sp.getBoolean(R.string.key_ns_receive_insulin, false) || config.NSCLIENT) { + bolusFromJson(json)?.let { bolus -> + storeDataForDb.boluses.add(bolus) + } ?: aapsLogger.error("Error parsing bolus json $json") + } + } + if (carbs > 0) { + if (sp.getBoolean(R.string.key_ns_receive_carbs, false) || config.NSCLIENT) { + carbsFromJson(json)?.let { carb -> + storeDataForDb.carbs.add(carb) + } ?: aapsLogger.error("Error parsing bolus json $json") + } + } + // Convert back emulated TBR -> EB + if (eventType == TherapyEvent.Type.TEMPORARY_BASAL.text && json.has("extendedEmulated")) { + val ebJson = json.getJSONObject("extendedEmulated") + ebJson.put("_id", json.getString("_id")) + ebJson.put("isValid", json.getBoolean("isValid")) + ebJson.put("mills", mills) + json = ebJson + eventType = JsonHelper.safeGetString(json, "eventType") + virtualPumpPlugin.fakeDataDetected = true + } + when { + insulin > 0 || carbs > 0 -> Any() + eventType == TherapyEvent.Type.TEMPORARY_TARGET.text -> + if (sp.getBoolean(R.string.key_ns_receive_temp_target, false) || config.NSCLIENT) { + temporaryTargetFromJson(json)?.let { temporaryTarget -> + storeDataForDb.temporaryTargets.add(temporaryTarget) + } ?: aapsLogger.error("Error parsing TT json $json") + } + + eventType == TherapyEvent.Type.NOTE.text && json.isEffectiveProfileSwitch() -> // replace this by new Type when available in NS + if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) { + effectiveProfileSwitchFromJson(json, dateUtil)?.let { effectiveProfileSwitch -> + storeDataForDb.effectiveProfileSwitches.add(effectiveProfileSwitch) + } ?: aapsLogger.error("Error parsing EffectiveProfileSwitch json $json") + } + + eventType == TherapyEvent.Type.BOLUS_WIZARD.text -> + bolusCalculatorResultFromJson(json)?.let { bolusCalculatorResult -> + storeDataForDb.bolusCalculatorResults.add(bolusCalculatorResult) + } ?: aapsLogger.error("Error parsing BolusCalculatorResult json $json") + + eventType == TherapyEvent.Type.CANNULA_CHANGE.text || + eventType == TherapyEvent.Type.INSULIN_CHANGE.text || + eventType == TherapyEvent.Type.SENSOR_CHANGE.text || + eventType == TherapyEvent.Type.FINGER_STICK_BG_VALUE.text || + eventType == TherapyEvent.Type.NONE.text || + eventType == TherapyEvent.Type.ANNOUNCEMENT.text || + eventType == TherapyEvent.Type.QUESTION.text || + eventType == TherapyEvent.Type.EXERCISE.text || + eventType == TherapyEvent.Type.NOTE.text || + eventType == TherapyEvent.Type.PUMP_BATTERY_CHANGE.text -> + if (sp.getBoolean(R.string.key_ns_receive_therapy_events, false) || config.NSCLIENT) { + therapyEventFromJson(json)?.let { therapyEvent -> + storeDataForDb.therapyEvents.add(therapyEvent) + } ?: aapsLogger.error("Error parsing TherapyEvent json $json") + } + + eventType == TherapyEvent.Type.COMBO_BOLUS.text -> + if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) { + extendedBolusFromJson(json)?.let { extendedBolus -> + storeDataForDb.extendedBoluses.add(extendedBolus) + } ?: aapsLogger.error("Error parsing ExtendedBolus json $json") + } + + eventType == TherapyEvent.Type.TEMPORARY_BASAL.text -> + if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) { + temporaryBasalFromJson(json)?.let { temporaryBasal -> + storeDataForDb.temporaryBasals.add(temporaryBasal) + } ?: aapsLogger.error("Error parsing TemporaryBasal json $json") + } + + eventType == TherapyEvent.Type.PROFILE_SWITCH.text -> + if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) { + profileSwitchFromJson(json, dateUtil, activePlugin)?.let { profileSwitch -> + storeDataForDb.profileSwitches.add(profileSwitch) + } ?: aapsLogger.error("Error parsing ProfileSwitch json $json") + } + + eventType == TherapyEvent.Type.APS_OFFLINE.text -> + if (sp.getBoolean(R.string.key_ns_receive_offline_event, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) { + offlineEventFromJson(json)?.let { offlineEvent -> + storeDataForDb.offlineEvents.add(offlineEvent) + } ?: aapsLogger.error("Error parsing OfflineEvent json $json") + } + } + } + storeDataForDb.storeTreatmentsToDb() + activePlugin.activeNsClient?.updateLatestTreatmentReceivedIfNewer(latestDateInReceivedData) + xDripBroadcast.sendTreatments(treatments) + return ret + } + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientMbgWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientMbgWorker.kt similarity index 54% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientMbgWorker.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientMbgWorker.kt index d28234a4dc..bf7e05fa60 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientMbgWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientMbgWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient +package info.nightscout.androidaps.plugins.sync.nsclient import android.content.Context import androidx.work.Worker @@ -6,15 +6,11 @@ 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.transactions.SyncNsTherapyEventTransaction -import info.nightscout.androidaps.extensions.therapyEventFromNsMbg -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.plugins.general.nsclient.data.NSMbg +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.rx.logging.AAPSLogger -import info.nightscout.rx.logging.LTag +import info.nightscout.androidaps.utils.extensions.therapyEventFromNsMbg +import info.nightscout.interfaces.Config import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject @@ -23,15 +19,13 @@ class NSClientMbgWorker( params: WorkerParameters ) : Worker(context, params) { - @Inject lateinit var repository: AppRepository @Inject lateinit var dataWorkerStorage: DataWorkerStorage - @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var sp: SP - @Inject lateinit var buildHelper: BuildHelper @Inject lateinit var config: Config + @Inject lateinit var storeDataForDb: StoreDataForDb override fun doWork(): Result { - var ret = Result.success() + val ret = Result.success() val acceptNSData = sp.getBoolean(R.string.key_ns_receive_therapy_events, false) || config.NSCLIENT if (!acceptNSData) return Result.success(workDataOf("Result" to "Sync not enabled")) @@ -41,16 +35,9 @@ class NSClientMbgWorker( for (i in 0 until mbgArray.length()) { val nsMbg = NSMbg(mbgArray.getJSONObject(i)) if (!nsMbg.isValid()) continue - repository.runTransactionForResult(SyncNsTherapyEventTransaction(therapyEventFromNsMbg(nsMbg))) - .doOnError { - aapsLogger.error("Error while saving therapy event", it) - ret = Result.failure(workDataOf("Error" to it.toString())) - } - .blockingGet() - .also { - aapsLogger.debug(LTag.DATABASE, "Saved therapy event $it") - } + storeDataForDb.therapyEvents.add(therapyEventFromNsMbg(nsMbg)) } + // storeDataForDb.storeTreatmentsToDb() don't do this. It will be stored along with other treatments return ret } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt similarity index 71% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt index fbdf390f68..61a221f41f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient +package info.nightscout.androidaps.plugins.sync.nsclient import android.content.ComponentName import android.content.Context @@ -7,29 +7,34 @@ import android.content.ServiceConnection import android.os.Handler import android.os.HandlerThread import android.os.IBinder +import android.text.Spanned import androidx.preference.PreferenceFragmentCompat import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants 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.androidaps.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 import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.nsclient.data.AlarmAck -import info.nightscout.androidaps.plugins.general.nsclient.data.NSAlarm -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientResend -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientUpdateGUI -import info.nightscout.androidaps.plugins.general.nsclient.services.NSClientService -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.HtmlHelper.fromHtml -import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit @@ -55,17 +60,16 @@ class NSClientPlugin @Inject constructor( private val sp: SP, private val nsClientReceiverDelegate: NsClientReceiverDelegate, private val config: Config, - private val buildHelper: BuildHelper -) : PluginBase( + private val buildHelper: BuildHelper, + private val dataSyncSelector: DataSyncSelector +) : NsClient, Sync, PluginBase( PluginDescription() - .mainType(PluginType.GENERAL) + .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) - .alwaysEnabled(config.NSCLIENT) - .visibleByDefault(config.NSCLIENT) .description(R.string.description_ns_client), aapsLogger, rh, injector ) { @@ -73,19 +77,14 @@ class NSClientPlugin @Inject constructor( private val disposable = CompositeDisposable() private val handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper) private val listLog: MutableList = ArrayList() - var textLog = fromHtml("") - var paused = false - var autoscroll = false - var status = "" - var nsClientService: NSClientService? = null + override var status = "" + override var nsClientService: NSClientService? = null val isAllowed: Boolean get() = nsClientReceiverDelegate.allowed val blockingReason: String get() = nsClientReceiverDelegate.blockingReason override fun onStart() { - paused = sp.getBoolean(R.string.key_nsclientinternal_paused, false) - autoscroll = sp.getBoolean(R.string.key_nsclientinternal_autoscroll, true) context.bindService(Intent(context, NSClientService::class.java), mConnection, Context.BIND_AUTO_CREATE) super.onStart() nsClientReceiverDelegate.grabReceiversState() @@ -93,8 +92,10 @@ class NSClientPlugin @Inject constructor( .toObservable(EventNSClientStatus::class.java) .observeOn(aapsSchedulers.io) .subscribe({ event: EventNSClientStatus -> - status = event.getStatus(rh) - rxBus.send(EventNSClientUpdateGUI()) + if (event.version == NsClient.Version.V1) { + status = event.getStatus(rh) + rxBus.send(EventNSClientUpdateGUI()) + } }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventNetworkChange::class.java) @@ -112,6 +113,7 @@ class NSClientPlugin @Inject constructor( .toObservable(EventNSClientNewLog::class.java) .observeOn(aapsSchedulers.io) .subscribe({ event: EventNSClientNewLog -> + if (event.version != NsClient.Version.V1) return@subscribe addToLog(event) aapsLogger.debug(LTag.NSCLIENT, event.action + " " + event.logText) }, fabricPrivacy::logException) @@ -138,17 +140,13 @@ class NSClientPlugin @Inject constructor( preferenceFragment.findPreference(rh.gs(R.string.key_ns_create_announcements_from_errors))?.isVisible = false preferenceFragment.findPreference(rh.gs(R.string.key_ns_create_announcements_from_carbs_req))?.isVisible = false -// preferenceFragment.findPreference(rh.gs(R.string.key_ns_sync_use_absolute))?.isVisible = false - } else { - // APS or pumpControl mode -// preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_profile_switch))?.isVisible = buildHelper.isEngineeringMode() -// preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_insulin))?.isVisible = buildHelper.isEngineeringMode() -// preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_carbs))?.isVisible = buildHelper.isEngineeringMode() -// preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_temp_target))?.isVisible = buildHelper.isEngineeringMode() } preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_tbr_eb))?.isVisible = buildHelper.isEngineeringMode() } + override val hasWritePermission: Boolean get() = nsClientService?.hasWriteAuth ?: false + override val connected: Boolean get() = nsClientService?.isConnected ?: false + private val mConnection: ServiceConnection = object : ServiceConnection { override fun onServiceDisconnected(name: ComponentName) { aapsLogger.debug(LTag.NSCLIENT, "Service is disconnected") @@ -162,55 +160,53 @@ class NSClientPlugin @Inject constructor( } } - @Synchronized fun clearLog() { + override fun clearLog() { handler.post { synchronized(listLog) { listLog.clear() } rxBus.send(EventNSClientUpdateGUI()) } } - @Synchronized private fun addToLog(ev: EventNSClientNewLog) { - handler.post { - synchronized(listLog) { - listLog.add(ev) - // remove the first line if log is too large - if (listLog.size >= Constants.MAX_LOG_LINES) { - listLog.removeAt(0) - } + private fun addToLog(ev: EventNSClientNewLog) { + synchronized(listLog) { + listLog.add(ev) + // remove the first line if log is too large + if (listLog.size >= Constants.MAX_LOG_LINES) { + listLog.removeAt(0) } - rxBus.send(EventNSClientUpdateGUI()) } + rxBus.send(EventNSClientUpdateGUI()) } - @Synchronized fun updateLog() { + override fun textLog(): Spanned { try { val newTextLog = StringBuilder() synchronized(listLog) { - for (log in listLog) { - newTextLog.append(log.toPreparedHtml()) - } + for (log in listLog) newTextLog.append(log.toPreparedHtml()) } - textLog = fromHtml(newTextLog.toString()) + return fromHtml(newTextLog.toString()) } catch (e: OutOfMemoryError) { ToastUtils.showToastInUiThread(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error) } + return fromHtml("") } - fun resend(reason: String) { + override fun resend(reason: String) { nsClientService?.resend(reason) } - fun pause(newState: Boolean) { + override fun pause(newState: Boolean) { sp.putBoolean(R.string.key_nsclientinternal_paused, newState) - paused = newState rxBus.send(EventPreferenceChange(rh, R.string.key_nsclientinternal_paused)) } - fun url(): String = nsClientService?.nsURL ?: "" - fun hasWritePermission(): Boolean = nsClientService?.hasWriteAuth ?: false + override val version: NsClient.Version + get() = NsClient.Version.V1 + + override val address: String get() = nsClientService?.nsURL ?: "" fun handleClearAlarm(originalAlarm: NSAlarm, silenceTimeInMilliseconds: Long) { - if (!isEnabled(PluginType.GENERAL)) return + if (!isEnabled()) return if (!sp.getBoolean(R.string.key_ns_upload, true)) { aapsLogger.debug(LTag.NSCLIENT, "Upload disabled. Message dropped") return @@ -223,7 +219,15 @@ class NSClientPlugin @Inject constructor( }) } - fun updateLatestDateReceivedIfNewer(latestReceived: Long) { + override fun updateLatestBgReceivedIfNewer(latestReceived: Long) { nsClientService?.let { if (latestReceived > it.latestDateInReceivedData) it.latestDateInReceivedData = latestReceived } } + + override fun updateLatestTreatmentReceivedIfNewer(latestReceived: Long) { + nsClientService?.let { if (latestReceived > it.latestDateInReceivedData) it.latestDateInReceivedData = latestReceived } + } + + override fun resetToFullSync() { + dataSyncSelector.resetToNextFullSync() + } } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientUpdateRemoveAckWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientUpdateRemoveAckWorker.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientUpdateRemoveAckWorker.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientUpdateRemoveAckWorker.kt index fa97e4a0e4..df4f77f049 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientUpdateRemoveAckWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientUpdateRemoveAckWorker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient +package info.nightscout.androidaps.plugins.sync.nsclient import android.content.Context import androidx.work.Worker @@ -19,8 +19,9 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairProfileSwitch 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.plugins.general.nsclient.acks.NSUpdateAck -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientNewLog +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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -50,7 +51,7 @@ class NSClientUpdateRemoveAckWorker( is PairTemporaryTarget -> { val pair = ack.originalObject dataSyncSelector.confirmLastTempTargetsIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked TemporaryTarget" + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked TemporaryTarget" + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedTempTargetsCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -59,7 +60,7 @@ class NSClientUpdateRemoveAckWorker( is PairGlucoseValue -> { val pair = ack.originalObject dataSyncSelector.confirmLastGlucoseValueIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked GlucoseValue " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked GlucoseValue " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedGlucoseValuesCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -68,7 +69,7 @@ class NSClientUpdateRemoveAckWorker( is PairFood -> { val pair = ack.originalObject dataSyncSelector.confirmLastFoodIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked Food " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked Food " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedFoodsCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -77,7 +78,7 @@ class NSClientUpdateRemoveAckWorker( is PairTherapyEvent -> { val pair = ack.originalObject dataSyncSelector.confirmLastTherapyEventIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked TherapyEvent " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked TherapyEvent " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedTherapyEventsCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -86,7 +87,7 @@ class NSClientUpdateRemoveAckWorker( is PairBolus -> { val pair = ack.originalObject dataSyncSelector.confirmLastBolusIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked Bolus " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked Bolus " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedBolusesCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -95,7 +96,7 @@ class NSClientUpdateRemoveAckWorker( is PairCarbs -> { val pair = ack.originalObject dataSyncSelector.confirmLastCarbsIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked Carbs " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked Carbs " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedCarbsCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -104,7 +105,7 @@ class NSClientUpdateRemoveAckWorker( is PairBolusCalculatorResult -> { val pair = ack.originalObject dataSyncSelector.confirmLastBolusCalculatorResultsIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked BolusCalculatorResult " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked BolusCalculatorResult " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedBolusCalculatorResultsCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -113,7 +114,7 @@ class NSClientUpdateRemoveAckWorker( is PairTemporaryBasal -> { val pair = ack.originalObject dataSyncSelector.confirmLastTemporaryBasalIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked TemporaryBasal " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked TemporaryBasal " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedTemporaryBasalsCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -122,7 +123,7 @@ class NSClientUpdateRemoveAckWorker( is PairExtendedBolus -> { val pair = ack.originalObject dataSyncSelector.confirmLastExtendedBolusIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked ExtendedBolus " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked ExtendedBolus " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedExtendedBolusesCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -131,7 +132,7 @@ class NSClientUpdateRemoveAckWorker( is PairProfileSwitch -> { val pair = ack.originalObject dataSyncSelector.confirmLastProfileSwitchIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked ProfileSwitch " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked ProfileSwitch " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedProfileSwitchesCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -140,7 +141,7 @@ class NSClientUpdateRemoveAckWorker( is PairEffectiveProfileSwitch -> { val pair = ack.originalObject dataSyncSelector.confirmLastEffectiveProfileSwitchIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked EffectiveProfileSwitch " + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked EffectiveProfileSwitch " + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedEffectiveProfileSwitchesCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) @@ -149,7 +150,7 @@ class NSClientUpdateRemoveAckWorker( is PairOfflineEvent -> { val pair = ack.originalObject dataSyncSelector.confirmLastOfflineEventIdIfGreater(pair.updateRecordId) - rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked OfflineEvent" + ack._id)) + rxBus.send(EventNSClientNewLog("DBUPDATE", "Acked OfflineEvent" + ack._id, NsClient.Version.V1)) // Send new if waiting dataSyncSelector.processChangedOfflineEventsCompat() ret = Result.success(workDataOf("ProcessedData" to pair.toString())) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegate.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt similarity index 98% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegate.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt index 6c0a36aaba..3f1e92b68e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegate.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient +package info.nightscout.androidaps.plugins.sync.nsclient import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventPreferenceChange diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/acks/NSAddAck.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAddAck.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/acks/NSAddAck.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAddAck.kt index 043e8e21d5..46a81ea2b3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/acks/NSAddAck.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAddAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.acks +package info.nightscout.androidaps.plugins.sync.nsclient.acks import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event @@ -16,7 +16,7 @@ class NSAddAck( ) : Event(), Ack { var id: String? = null - var nsClientID: String? = null + private var nsClientID: String? = null var json: JSONObject? = null override fun call(vararg args: Any) { // Regular response diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/acks/NSAuthAck.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAuthAck.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/acks/NSAuthAck.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAuthAck.kt index f52d2cb8e7..8e9e85f4d5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/acks/NSAuthAck.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSAuthAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.acks +package info.nightscout.androidaps.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/general/nsclient/acks/NSUpdateAck.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSUpdateAck.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/acks/NSUpdateAck.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSUpdateAck.kt index 91856277ce..87b5673dd4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/acks/NSUpdateAck.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/acks/NSUpdateAck.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.acks +package info.nightscout.androidaps.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/general/nsclient/data/AlarmAck.java b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/AlarmAck.java similarity index 72% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/AlarmAck.java rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/AlarmAck.java index 06fc06e943..f24c79ed37 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/AlarmAck.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/AlarmAck.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.data; +package info.nightscout.androidaps.plugins.sync.nsclient.data; /** * Created by mike on 11.06.2017. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSAlarm.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSAlarm.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSAlarm.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSAlarm.kt index 81d8f0e5b1..b9741e5915 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSAlarm.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSAlarm.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.data +package info.nightscout.androidaps.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/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt new file mode 100644 index 0000000000..8a18a1d423 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt @@ -0,0 +1,173 @@ +package info.nightscout.androidaps.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.androidaps.utils.DateUtil +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.utils.HtmlHelper +import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.sdk.remotemodel.RemoteDeviceStatus +import info.nightscout.shared.sharedPreferences.SP +import javax.inject.Inject +import javax.inject.Singleton + +/* +{ + "_id": "594fdcec327b83c81b6b8c0f", + "device": "openaps://Sony D5803", + "pump": { + "battery": { + "percent": 100 + }, + "status": { + "status": "normal", + "timestamp": "2017-06-25T15:50:14Z" + }, + "extended": { + "Version": "1.5-ac98852-2017.06.25", + "PumpIOB": 1.13, + "LastBolus": "25. 6. 2017 17:25:00", + "LastBolusAmount": 0.3, + "BaseBasalRate": 0.4, + "ActiveProfile": "2016 +30%" + }, + "reservoir": 109, + "clock": "2017-06-25T15:55:10Z" + }, + "openaps": { + "suggested": { + "temp": "absolute", + "bg": 115.9, + "tick": "+5", + "eventualBG": 105, + "snoozeBG": 105, + "predBGs": { + "IOB": [116, 114, 112, 110, 109, 107, 106, 105, 105, 104, 104, 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 107] + }, + "sensitivityRatio": 0.81, + "variable_sens": 137.3, + "COB": 0, + "IOB": -0.035, + "reason": "COB: 0, Dev: -18, BGI: 0.43, ISF: 216, Target: 99; Eventual BG 105 > 99 but Min. Delta -2.60 < Exp. Delta 0.1; setting current basal of 0.4 as temp. Suggested rate is same as profile rate, no temp basal is active, doing nothing", + "timestamp": "2017-06-25T15:55:10Z" + }, + "iob": { + "iob": -0.035, + "basaliob": -0.035, + "activity": -0.0004, + "time": "2017-06-25T15:55:10Z" + } + }, + "uploaderBattery": 93, + "created_at": "2017-06-25T15:55:10Z", + "NSCLIENT_ID": 1498406118857 +} + */ +@Suppress("SpellCheckingInspection") +@Singleton +class NSDeviceStatusHandler @Inject constructor( + private val sp: SP, + private val config: Config, + private val dateUtil: DateUtil, + private val runningConfiguration: RunningConfiguration, + private val processedDeviceStatusData: ProcessedDeviceStatusData +) { + + fun handleNewData(deviceStatuses: Array, version: NsClient.Version) { + var configurationDetected = false + for (i in deviceStatuses.size - 1 downTo 0) { + val nsDeviceStatus = deviceStatuses[i] + updatePumpData(nsDeviceStatus) + updateDeviceData(nsDeviceStatus) + updateOpenApsData(nsDeviceStatus) + updateUploaderData(nsDeviceStatus) + nsDeviceStatus.pump?.let { sp.putBoolean(R.string.key_ObjectivespumpStatusIsAvailableInNS, true) } // Objective 0 + if (config.NSCLIENT && !configurationDetected) + nsDeviceStatus.configuration?.let { + // copy configuration of Insulin and Sensitivity from main AAPS + runningConfiguration.apply(it, version) + configurationDetected = true // pick only newest + } + } + } + + private fun updateDeviceData(deviceStatus: RemoteDeviceStatus) { + val createdAt = deviceStatus.createdAt?.let { dateUtil.fromISODateString(it) } ?: return + processedDeviceStatusData.device?.let { if (createdAt < it.createdAt) return } // take only newer record + deviceStatus.device?.let { + if (it.startsWith("openaps://")) processedDeviceStatusData.device = ProcessedDeviceStatusData.Device(createdAt, it.substring(10)) + } + } + + private fun updatePumpData(remoteDeviceStatus: RemoteDeviceStatus) { + val pump = remoteDeviceStatus.pump ?: return + val clock = pump.clock?.let { dateUtil.fromISODateString(it) } ?: return + processedDeviceStatusData.pumpData?.let { if (clock < it.clock) return } // take only newer record + + // create new status and process data + processedDeviceStatusData.pumpData = ProcessedDeviceStatusData.PumpData().also { deviceStatusPumpData -> + deviceStatusPumpData.clock = clock + pump.status?.status?.let { deviceStatusPumpData.status = it } + pump.reservoir?.let { deviceStatusPumpData.reservoir = it } + pump.reservoirDisplayOverride?.let { deviceStatusPumpData.reservoirDisplayOverride = it } + pump.battery?.percent?.let { + deviceStatusPumpData.isPercent = true + deviceStatusPumpData.percent = it + } + pump.battery?.voltage?.let { + deviceStatusPumpData.isPercent = false + deviceStatusPumpData.voltage = it + } + pump.extended?.let { + val extended = StringBuilder() + val keys: Iterator<*> = it.keys() + while (keys.hasNext()) { + val key = keys.next() as String + val value = it.getString(key) + extended.append("").append(key).append(": ").append(value).append("
") + } + deviceStatusPumpData.extended = HtmlHelper.fromHtml(extended.toString()) + deviceStatusPumpData.activeProfileName = JsonHelper.safeGetStringAllowNull(it, "ActiveProfile", null) + } + } + } + + private fun updateOpenApsData(remoteDeviceStatus: RemoteDeviceStatus) { + remoteDeviceStatus.openaps?.suggested?.let { + JsonHelper.safeGetString(it, "timestamp")?.let { timestamp -> + val clock = dateUtil.fromISODateString(timestamp) + // check if this is new data + if (clock > processedDeviceStatusData.openAPSData.clockSuggested) { + processedDeviceStatusData.openAPSData.suggested = it + processedDeviceStatusData.openAPSData.clockSuggested = clock + } + } + } + remoteDeviceStatus.openaps?.enacted?.let { + JsonHelper.safeGetString(it, "timestamp")?.let { timestamp -> + val clock = dateUtil.fromISODateString(timestamp) + // check if this is new data + if (clock > processedDeviceStatusData.openAPSData.clockEnacted) { + processedDeviceStatusData.openAPSData.enacted = it + processedDeviceStatusData.openAPSData.clockEnacted = clock + } + } + } + } + + private fun updateUploaderData(remoteDeviceStatus: RemoteDeviceStatus) { + val clock = remoteDeviceStatus.createdAt?.let { dateUtil.fromISODateString(it) } ?: return + val device = remoteDeviceStatus.device ?: return + val battery = remoteDeviceStatus.uploaderBattery ?: remoteDeviceStatus.uploader?.battery ?: return + + var uploader = processedDeviceStatusData.uploaderMap[device] + // check if this is new data + if (uploader == null || clock > uploader.clock) { + if (uploader == null) uploader = ProcessedDeviceStatusData.Uploader() + uploader.battery = battery + uploader.clock = clock + processedDeviceStatusData.uploaderMap[device] = uploader + } + } +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSMbg.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSMbg.kt similarity index 86% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSMbg.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSMbg.kt index 063420e272..90d0aae931 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSMbg.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSMbg.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.data +package info.nightscout.androidaps.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/general/nsclient/data/NSSettingsStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt similarity index 97% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSettingsStatus.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt index 7913034f54..a9686fff86 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSettingsStatus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.data +package info.nightscout.androidaps.plugins.sync.nsclient.data import android.content.Context import info.nightscout.androidaps.R @@ -113,7 +113,6 @@ import javax.inject.Singleton "activeProfile": "2016 +30%" } */ -@Suppress("SpellCheckingInspection") @OpenForTesting @Singleton class NSSettingsStatus @Inject constructor( @@ -234,11 +233,6 @@ class NSSettingsStatus @Inject constructor( fun pumpExtendedSettingsFields(): String = JsonHelper.safeGetString(extendedPumpSettings(), "fields", "") - fun openAPSEnabledAlerts(): Boolean { - val openaps = JsonHelper.safeGetJSONObject(getExtendedSettings(), "openaps", null) - return JsonHelper.safeGetBoolean(openaps, "enableAlerts") - } - fun copyStatusLightsNsSettings(context: Context?) { val action = Runnable { getExtendedWarnValue("cage", "warn")?.let { sp.putDouble(R.string.key_statuslights_cage_warning, it) } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSgv.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSgv.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSgv.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSgv.kt index c9d6208940..9da2da982a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSgv.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSgv.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.data +package info.nightscout.androidaps.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/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt new file mode 100644 index 0000000000..4f69f66db6 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt @@ -0,0 +1,211 @@ +package info.nightscout.androidaps.plugins.sync.nsclient.data + +import android.text.Spanned +import dagger.android.HasAndroidInjector +import info.nightscout.androidaps.R +import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.plugins.aps.loop.APSResult +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.T +import info.nightscout.interfaces.utils.HtmlHelper +import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.interfaces.utils.Round +import info.nightscout.shared.sharedPreferences.SP +import org.json.JSONObject +import javax.inject.Inject +import javax.inject.Singleton + +@Suppress("SpellCheckingInspection") +@Singleton +class ProcessedDeviceStatusData @Inject constructor( + private val rh: ResourceHelper, + private val dateUtil: DateUtil, + private val sp: SP +) { + + enum class Levels(val level: Int) { + + URGENT(2), + WARN(1), + INFO(0); + + fun toColor(): String = + when (level) { + INFO.level -> "white" + WARN.level -> "yellow" + URGENT.level -> "red" + else -> "white" + } + } + + class PumpData { + + var clock = 0L + var isPercent = false + var percent = 0 + var voltage = 0.0 + var status = "N/A" + var reservoir = 0.0 + var reservoirDisplayOverride = "" + var extended: Spanned? = null + var activeProfileName: String? = null + } + + var pumpData: PumpData? = null + + data class Device( + val createdAt: Long, + val device: String? + ) + + var device: Device? = null + + class Uploader { + + var clock = 0L + var battery = 0 + } + + val uploaderMap = HashMap() + + class OpenAPSData { + + var clockSuggested = 0L + var clockEnacted = 0L + var suggested: JSONObject? = null + var enacted: JSONObject? = null + } + + var openAPSData = OpenAPSData() + + // test warning level // color + fun pumpStatus(nsSettingsStatus: NSSettingsStatus): Spanned { + val pumpData = pumpData ?: return HtmlHelper.fromHtml("") + + //String[] ALL_STATUS_FIELDS = {"reservoir", "battery", "clock", "status", "device"}; + val string = StringBuilder() + .append("") + .append(rh.gs(R.string.pump)) + .append(": ") + + // test warning level + val level = when { + pumpData.clock + nsSettingsStatus.extendedPumpSettings("urgentClock") * 60 * 1000L < dateUtil.now() -> Levels.URGENT + pumpData.reservoir < nsSettingsStatus.extendedPumpSettings("urgentRes") -> Levels.URGENT + pumpData.isPercent && pumpData.percent < nsSettingsStatus.extendedPumpSettings("urgentBattP") -> Levels.URGENT + !pumpData.isPercent && pumpData.voltage > 0 && pumpData.voltage < nsSettingsStatus.extendedPumpSettings("urgentBattV") -> Levels.URGENT + pumpData.clock + nsSettingsStatus.extendedPumpSettings("warnClock") * 60 * 1000L < dateUtil.now() -> Levels.WARN + pumpData.reservoir < nsSettingsStatus.extendedPumpSettings("warnRes") -> Levels.WARN + pumpData.isPercent && pumpData.percent < nsSettingsStatus.extendedPumpSettings("warnBattP") -> Levels.WARN + !pumpData.isPercent && pumpData.voltage > 0 && pumpData.voltage < nsSettingsStatus.extendedPumpSettings("warnBattV") -> Levels.WARN + else -> Levels.INFO + } + string.append("") + val insulinUnit = rh.gs(R.string.insulin_unit_shortname) + val fields = nsSettingsStatus.pumpExtendedSettingsFields() + if (pumpData.reservoirDisplayOverride != "") + string.append(pumpData.reservoirDisplayOverride).append("$insulinUnit ") + else if (fields.contains("reservoir")) string.append(pumpData.reservoir.toInt()).append("$insulinUnit ") + if (fields.contains("battery") && pumpData.isPercent) string.append(pumpData.percent).append("% ") + if (fields.contains("battery") && !pumpData.isPercent) string.append(Round.roundTo(pumpData.voltage, 0.001)).append(" ") + if (fields.contains("clock")) string.append(dateUtil.minAgo(rh, pumpData.clock)).append(" ") + if (fields.contains("status")) string.append(pumpData.status).append(" ") + if (fields.contains("device")) string.append(device).append(" ") + string.append("") // color + return HtmlHelper.fromHtml(string.toString()) + } + + val extendedPumpStatus: Spanned get() = pumpData?.extended ?: HtmlHelper.fromHtml("") + val extendedOpenApsStatus: Spanned + get() { + val string = StringBuilder() + val enacted = openAPSData.enacted + val suggested = openAPSData.suggested + if (enacted != null && openAPSData.clockEnacted != openAPSData.clockSuggested) string + .append("") + .append(dateUtil.minAgo(rh, openAPSData.clockEnacted)) + .append(" ") + .append(JsonHelper.safeGetString(enacted, "reason")) + .append("
") + if (suggested != null) string + .append("") + .append(dateUtil.minAgo(rh, openAPSData.clockSuggested)) + .append(" ") + .append(JsonHelper.safeGetString(suggested, "reason")) + .append("
") + return HtmlHelper.fromHtml(string.toString()) + } + + val openApsStatus: Spanned + get() { + val string = StringBuilder() + .append("") + .append(rh.gs(R.string.openaps_short)) + .append(": ") + + // 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 + } + string.append("") + if (openAPSData.clockSuggested != 0L) string.append(dateUtil.minAgo(rh, openAPSData.clockSuggested)).append(" ") + string.append("") // color + return HtmlHelper.fromHtml(string.toString()) + } + + val openApsTimestamp: Long + get() = if (openAPSData.clockSuggested != 0L) openAPSData.clockSuggested else -1 + + fun getAPSResult(injector: HasAndroidInjector): APSResult { + val result = APSResult(injector) + result.json = openAPSData.suggested + result.date = openAPSData.clockSuggested + return result + } + val uploaderStatus: String + get() { + val iterator: Iterator<*> = uploaderMap.entries.iterator() + var minBattery = 100 + while (iterator.hasNext()) { + val pair = iterator.next() as Map.Entry<*, *> + val uploader = pair.value as Uploader + if (minBattery > uploader.battery) minBattery = uploader.battery + } + return "$minBattery%" + } + + val uploaderStatusSpanned: Spanned + get() { + val string = StringBuilder() + string.append("") + string.append(rh.gs(R.string.uploader_short)) + string.append(": ") + val iterator: Iterator<*> = uploaderMap.entries.iterator() + var minBattery = 100 + while (iterator.hasNext()) { + val pair = iterator.next() as Map.Entry<*, *> + val uploader = pair.value as Uploader + if (minBattery > uploader.battery) minBattery = uploader.battery + } + string.append(minBattery) + string.append("%") + return HtmlHelper.fromHtml(string.toString()) + } + + val extendedUploaderStatus: Spanned + get() { + val string = StringBuilder() + val iterator: Iterator<*> = uploaderMap.entries.iterator() + while (iterator.hasNext()) { + val pair = iterator.next() as Map.Entry<*, *> + val uploader = pair.value as Uploader + val device = pair.key as String + string.append("").append(device).append(": ").append(uploader.battery).append("%
") + } + return HtmlHelper.fromHtml(string.toString()) + } + +} + diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt similarity index 80% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt index 50c9dcd960..ed2e809482 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient.services +package info.nightscout.androidaps.plugins.sync.nsclient.services import android.annotation.SuppressLint import android.content.Context @@ -12,42 +12,47 @@ import android.os.SystemClock import androidx.work.OneTimeWorkRequest import com.google.common.base.Charsets import com.google.common.hash.Hashing +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.interfaces.BuildHelper -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.DataSyncSelector +import info.nightscout.androidaps.interfaces.NsClient import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.nsclient.NSClientAddAckWorker -import info.nightscout.androidaps.plugins.general.nsclient.NSClientAddUpdateWorker -import info.nightscout.androidaps.plugins.general.nsclient.NSClientMbgWorker -import info.nightscout.androidaps.plugins.general.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.general.nsclient.NSClientUpdateRemoveAckWorker -import info.nightscout.androidaps.plugins.general.nsclient.acks.NSAddAck -import info.nightscout.androidaps.plugins.general.nsclient.acks.NSAuthAck -import info.nightscout.androidaps.plugins.general.nsclient.acks.NSUpdateAck -import info.nightscout.androidaps.plugins.general.nsclient.data.AlarmAck -import info.nightscout.androidaps.plugins.general.nsclient.data.NSAlarm -import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus -import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientNewLog -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientUpdateGUI +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.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationWithAction -import info.nightscout.androidaps.plugins.source.NSClientSourcePlugin.NSClientSourceWorker +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.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.androidaps.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.androidaps.utils.T.Companion.mins -import info.nightscout.plugins.general.food.FoodPlugin.FoodWorker +import info.nightscout.plugins.general.food.FoodPlugin import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -56,6 +61,7 @@ import info.nightscout.rx.events.EventConfigBuilderChange 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.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign @@ -69,13 +75,13 @@ import java.net.URISyntaxException import java.util.Locale import javax.inject.Inject -class NSClientService : DaggerService() { +class NSClientService : DaggerService(), NsClient.NSClientService { @Inject lateinit var injector: HasAndroidInjector @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var nsSettingsStatus: NSSettingsStatus - @Inject lateinit var nsDeviceStatus: NSDeviceStatus + @Inject lateinit var nsDeviceStatusHandler: NSDeviceStatusHandler @Inject lateinit var rxBus: RxBus @Inject lateinit var rh: ResourceHelper @Inject lateinit var sp: SP @@ -206,13 +212,13 @@ class NSClientService : DaggerService() { connectionStatus += ')' isConnected = true hasWriteAuth = ack.write && ack.writeTreatment - rxBus.send(EventNSClientStatus(connectionStatus)) - rxBus.send(EventNSClientNewLog("AUTH", connectionStatus)) + rxBus.send(EventNSClientStatus(connectionStatus, NsClient.Version.V1)) + rxBus.send(EventNSClientNewLog("AUTH", connectionStatus, NsClient.Version.V1)) if (!ack.write) { - rxBus.send(EventNSClientNewLog("ERROR", "Write permission not granted ")) + rxBus.send(EventNSClientNewLog("ERROR", "Write permission not granted ", NsClient.Version.V1)) } if (!ack.writeTreatment) { - rxBus.send(EventNSClientNewLog("ERROR", "Write treatment permission not granted ")) + 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) @@ -235,21 +241,21 @@ class NSClientService : DaggerService() { fun initialize() { dataCounter = 0 readPreferences() - @Suppress("UnstableApiUsage", "DEPRECATION") + @Suppress("DEPRECATION") if (nsAPISecret != "") nsApiHashCode = Hashing.sha1().hashString(nsAPISecret, Charsets.UTF_8).toString() - rxBus.send(EventNSClientStatus("Initializing")) + rxBus.send(EventNSClientStatus("Initializing", NsClient.Version.V1)) if (!nsClientPlugin.isAllowed) { - rxBus.send(EventNSClientNewLog("NSCLIENT", nsClientPlugin.blockingReason)) - rxBus.send(EventNSClientStatus(nsClientPlugin.blockingReason)) - } else if (nsClientPlugin.paused) { - rxBus.send(EventNSClientNewLog("NSCLIENT", "paused")) - rxBus.send(EventNSClientStatus("Paused")) + 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)) { + rxBus.send(EventNSClientNewLog("NSCLIENT", "paused", NsClient.Version.V1)) + rxBus.send(EventNSClientStatus("Paused", NsClient.Version.V1)) } else if (!nsEnabled) { - rxBus.send(EventNSClientNewLog("NSCLIENT", "disabled")) - rxBus.send(EventNSClientStatus("Disabled")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "disabled", NsClient.Version.V1)) + rxBus.send(EventNSClientStatus("Disabled", NsClient.Version.V1)) } else if (nsURL != "" && (buildHelper.isEngineeringMode() || nsURL.lowercase(Locale.getDefault()).startsWith("https://"))) { try { - rxBus.send(EventNSClientStatus("Connecting ...")) + rxBus.send(EventNSClientStatus("Connecting ...", NsClient.Version.V1)) val opt = IO.Options() opt.forceNew = true opt.reconnection = true @@ -260,7 +266,7 @@ class NSClientService : DaggerService() { socket.on(Socket.EVENT_CONNECT_ERROR, onError) socket.on(Socket.EVENT_CONNECT_TIMEOUT, onError) socket.on(Socket.EVENT_PING, onPing) - rxBus.send(EventNSClientNewLog("NSCLIENT", "do connect")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "do connect", NsClient.Version.V1)) socket.connect() socket.on("dataUpdate", onDataUpdate) socket.on("announcement", onAnnouncement) @@ -269,25 +275,25 @@ class NSClientService : DaggerService() { socket.on("clear_alarm", onClearAlarm) } } catch (e: URISyntaxException) { - rxBus.send(EventNSClientNewLog("NSCLIENT", "Wrong URL syntax")) - rxBus.send(EventNSClientStatus("Wrong URL syntax")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "Wrong URL syntax", NsClient.Version.V1)) + rxBus.send(EventNSClientStatus("Wrong URL syntax", NsClient.Version.V1)) } catch (e: RuntimeException) { - rxBus.send(EventNSClientNewLog("NSCLIENT", "Wrong URL syntax")) - rxBus.send(EventNSClientStatus("Wrong URL syntax")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "Wrong URL syntax", NsClient.Version.V1)) + rxBus.send(EventNSClientStatus("Wrong URL syntax", NsClient.Version.V1)) } } else if (nsURL.lowercase(Locale.getDefault()).startsWith("http://")) { - rxBus.send(EventNSClientNewLog("NSCLIENT", "NS URL not encrypted")) - rxBus.send(EventNSClientStatus("Not encrypted")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "NS URL not encrypted", NsClient.Version.V1)) + rxBus.send(EventNSClientStatus("Not encrypted", NsClient.Version.V1)) } else { - rxBus.send(EventNSClientNewLog("NSCLIENT", "No NS URL specified")) - rxBus.send(EventNSClientStatus("Not configured")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "No NS URL specified", NsClient.Version.V1)) + rxBus.send(EventNSClientStatus("Not configured", NsClient.Version.V1)) } } private val onConnect = Emitter.Listener { connectCounter++ val socketId = socket?.id() ?: "NULL" - rxBus.send(EventNSClientNewLog("NSCLIENT", "connect #$connectCounter event. ID: $socketId")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "connect #$connectCounter event. ID: $socketId", NsClient.Version.V1)) if (socket != null) sendAuthMessage(NSAuthAck(rxBus)) watchdog() } @@ -301,16 +307,16 @@ class NSClientService : DaggerService() { reconnections.remove(r) } } - rxBus.send(EventNSClientNewLog("WATCHDOG", "connections in last " + WATCHDOG_INTERVAL_MINUTES + " minutes: " + reconnections.size + "/" + WATCHDOG_MAX_CONNECTIONS)) + 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) rxBus.send(EventNewNotification(n)) - rxBus.send(EventNSClientNewLog("WATCHDOG", "pausing for $WATCHDOG_RECONNECT_IN minutes")) + rxBus.send(EventNSClientNewLog("WATCHDOG", "pausing for $WATCHDOG_RECONNECT_IN minutes", NsClient.Version.V1)) nsClientPlugin.pause(true) rxBus.send(EventNSClientUpdateGUI()) Thread { SystemClock.sleep(mins(WATCHDOG_RECONNECT_IN.toLong()).msecs()) - rxBus.send(EventNSClientNewLog("WATCHDOG", "re-enabling NSClient")) + rxBus.send(EventNSClientNewLog("WATCHDOG", "re-enabling NSClient", NsClient.Version.V1)) nsClientPlugin.pause(false) }.start() } @@ -319,7 +325,7 @@ class NSClientService : DaggerService() { private val onDisconnect = Emitter.Listener { args -> aapsLogger.debug(LTag.NSCLIENT, "disconnect reason: {}", *args) - rxBus.send(EventNSClientNewLog("NSCLIENT", "disconnect event")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "disconnect event", NsClient.Version.V1)) } @Synchronized fun destroy() { @@ -331,7 +337,7 @@ class NSClientService : DaggerService() { socket?.off("alarm") socket?.off("urgent_alarm") socket?.off("clear_alarm") - rxBus.send(EventNSClientNewLog("NSCLIENT", "destroy")) + rxBus.send(EventNSClientNewLog("NSCLIENT", "destroy", NsClient.Version.V1)) isConnected = false hasWriteAuth = false socket?.disconnect() @@ -350,11 +356,11 @@ class NSClientService : DaggerService() { aapsLogger.error("Unhandled exception", e) return } - rxBus.send(EventNSClientNewLog("AUTH", "requesting auth")) + rxBus.send(EventNSClientNewLog("AUTH", "requesting auth", NsClient.Version.V1)) socket?.emit("authorize", authMessage, ack) } - fun readPreferences() { + private fun readPreferences() { nsEnabled = nsClientPlugin.isEnabled() nsURL = sp.getString(R.string.key_nsclientinternal_url, "") nsAPISecret = sp.getString(R.string.key_nsclientinternal_api_secret, "") @@ -366,10 +372,10 @@ class NSClientService : DaggerService() { if (args.isNotEmpty() && args[0] != null) { msg = args[0].toString() } - rxBus.send(EventNSClientNewLog("ERROR", msg)) + rxBus.send(EventNSClientNewLog("ERROR", msg, NsClient.Version.V1)) } private val onPing = Emitter.Listener { - rxBus.send(EventNSClientNewLog("PING", "received")) + rxBus.send(EventNSClientNewLog("PING", "received", NsClient.Version.V1)) // send data if there is something waiting resend("Ping received") } @@ -439,7 +445,7 @@ class NSClientService : DaggerService() { val data: JSONObject try { data = args[0] as JSONObject - rxBus.send(EventNSClientNewLog("CLEARALARM", "received")) + rxBus.send(EventNSClientNewLog("CLEARALARM", "received", NsClient.Version.V1)) rxBus.send(EventDismissNotification(Notification.NS_ALARM)) rxBus.send(EventDismissNotification(Notification.NS_URGENT_ALARM)) aapsLogger.debug(LTag.NSCLIENT, data.toString()) @@ -458,19 +464,19 @@ class NSClientService : DaggerService() { try { // delta means only increment/changes are coming val isDelta = data.has("delta") - rxBus.send(EventNSClientNewLog("DATA", "Data packet #" + dataCounter++ + if (isDelta) " delta" else " full")) + rxBus.send(EventNSClientNewLog("DATA", "Data packet #" + dataCounter++ + if (isDelta) " delta" else " full", NsClient.Version.V1)) if (data.has("status")) { val status = data.getJSONObject("status") nsSettingsStatus.handleNewData(status) } else if (!isDelta) { - rxBus.send(EventNSClientNewLog("ERROR", "Unsupported Nightscout version ")) + rxBus.send(EventNSClientNewLog("ERROR", "Unsupported Nightscout version ", NsClient.Version.V1)) } if (data.has("profiles")) { val profiles = data.getJSONArray("profiles") if (profiles.length() > 0) { // take the newest val profileStoreJson = profiles[profiles.length() - 1] as JSONObject - rxBus.send(EventNSClientNewLog("PROFILE", "profile received")) + rxBus.send(EventNSClientNewLog("PROFILE", "profile received", NsClient.Version.V1)) dataWorkerStorage.enqueue( OneTimeWorkRequest.Builder(ProfilePlugin.NSProfileWorker::class.java) .setInputData(dataWorkerStorage.storeInputData(profileStoreJson)) @@ -481,7 +487,7 @@ class NSClientService : DaggerService() { if (data.has("treatments")) { val treatments = data.getJSONArray("treatments") val addedOrUpdatedTreatments = JSONArray() - if (treatments.length() > 0) rxBus.send(EventNSClientNewLog("DATA", "received " + treatments.length() + " treatments")) + if (treatments.length() > 0) rxBus.send(EventNSClientNewLog("DATA", "received " + treatments.length() + " treatments", NsClient.Version.V1)) for (index in 0 until treatments.length()) { val jsonTreatment = treatments.getJSONObject(index) val action = safeGetStringAllowNull(jsonTreatment, "action", null) @@ -497,24 +503,31 @@ class NSClientService : DaggerService() { } } if (data.has("devicestatus")) { - val devicestatuses = data.getJSONArray("devicestatus") - if (devicestatuses.length() > 0) { - rxBus.send(EventNSClientNewLog("DATA", "received " + devicestatuses.length() + " device statuses")) - nsDeviceStatus.handleNewData(devicestatuses) + val deserializer: JsonDeserializer = + JsonDeserializer { json, _, _ -> + JSONObject(json.asJsonObject.toString()) + } + val gson = GsonBuilder().also { + it.registerTypeAdapter(JSONObject::class.java, deserializer) + }.create() + val devicestatuses = gson.fromJson(data.getString("devicestatus"), Array::class.java) + if (devicestatuses.isNotEmpty()) { + rxBus.send(EventNSClientNewLog("DATA", "received " + devicestatuses.size + " device statuses", NsClient.Version.V1)) + nsDeviceStatusHandler.handleNewData(devicestatuses, NsClient.Version.V1) } } if (data.has("food")) { val foods = data.getJSONArray("food") - if (foods.length() > 0) rxBus.send(EventNSClientNewLog("DATA", "received " + foods.length() + " foods")) + if (foods.length() > 0) rxBus.send(EventNSClientNewLog("DATA", "received " + foods.length() + " foods", NsClient.Version.V1)) dataWorkerStorage.enqueue( - OneTimeWorkRequest.Builder(FoodWorker::class.java) + OneTimeWorkRequest.Builder(FoodPlugin.FoodWorker::class.java) .setInputData(dataWorkerStorage.storeInputData(foods)) .build() ) } if (data.has("mbgs")) { val mbgArray = data.getJSONArray("mbgs") - if (mbgArray.length() > 0) rxBus.send(EventNSClientNewLog("DATA", "received " + mbgArray.length() + " mbgs")) + if (mbgArray.length() > 0) rxBus.send(EventNSClientNewLog("DATA", "received " + mbgArray.length() + " mbgs", NsClient.Version.V1)) dataWorkerStorage.enqueue( OneTimeWorkRequest.Builder(NSClientMbgWorker::class.java) .setInputData(dataWorkerStorage.storeInputData(mbgArray)) @@ -523,23 +536,26 @@ class NSClientService : DaggerService() { } if (data.has("cals")) { val cals = data.getJSONArray("cals") - if (cals.length() > 0) rxBus.send(EventNSClientNewLog("DATA", "received " + cals.length() + " cals")) + if (cals.length() > 0) rxBus.send(EventNSClientNewLog("DATA", "received " + cals.length() + " cals", NsClient.Version.V1)) // Calibrations ignored } if (data.has("sgvs")) { val sgvs = data.getJSONArray("sgvs") if (sgvs.length() > 0) { - rxBus.send(EventNSClientNewLog("DATA", "received " + sgvs.length() + " sgvs")) + rxBus.send(EventNSClientNewLog("DATA", "received " + sgvs.length() + " sgvs", NsClient.Version.V1)) // Objective0 sp.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, true) - dataWorkerStorage.enqueue( - OneTimeWorkRequest.Builder(NSClientSourceWorker::class.java) - .setInputData(dataWorkerStorage.storeInputData(sgvs)) - .build() - ) + dataWorkerStorage + .beginUniqueWork( + NSClientV3Plugin.JOB_NAME, + OneTimeWorkRequest.Builder(NSClientSourcePlugin.NSClientSourceWorker::class.java) + .setInputData(dataWorkerStorage.storeInputData(sgvs)) + .build() + ).then(OneTimeWorkRequest.Builder(StoreDataForDb.StoreBgWorker::class.java).build()) + .enqueue() } } - rxBus.send(EventNSClientNewLog("LAST", dateUtil.dateAndTimeString(latestDateInReceivedData))) + rxBus.send(EventNSClientNewLog("LAST", dateUtil.dateAndTimeString(latestDateInReceivedData), NsClient.Version.V1)) } catch (e: JSONException) { aapsLogger.error("Unhandled exception", e) } @@ -550,7 +566,7 @@ class NSClientService : DaggerService() { } } - fun dbUpdate(collection: String, _id: String?, data: JSONObject?, originalObject: Any, progress: String) { + override fun dbUpdate(collection: String, _id: String?, data: JSONObject?, originalObject: Any, progress: String) { try { if (_id == null) return if (!isConnected || !hasWriteAuth) return @@ -562,7 +578,7 @@ class NSClientService : DaggerService() { rxBus.send( EventNSClientNewLog( "DBUPDATE $collection", "Sent " + originalObject.javaClass.simpleName + " " + - "" + _id + " " + data + progress + "" + _id + " " + data + progress, NsClient.Version.V1 ) ) } catch (e: JSONException) { @@ -570,14 +586,14 @@ class NSClientService : DaggerService() { } } - fun dbAdd(collection: String, data: JSONObject, originalObject: Any, progress: String) { + override fun dbAdd(collection: String, data: JSONObject, originalObject: Any, progress: String) { try { if (!isConnected || !hasWriteAuth) return val message = JSONObject() message.put("collection", collection) message.put("data", data) socket?.emit("dbAdd", message, NSAddAck(aapsLogger, rxBus, originalObject)) - rxBus.send(EventNSClientNewLog("DBADD $collection", "Sent " + originalObject.javaClass.simpleName + " " + data + " " + progress)) + rxBus.send(EventNSClientNewLog("DBADD $collection", "Sent " + originalObject.javaClass.simpleName + " " + data + " " + progress, NsClient.Version.V1)) } catch (e: JSONException) { aapsLogger.error("Unhandled exception", e) } @@ -586,7 +602,7 @@ class NSClientService : DaggerService() { fun sendAlarmAck(alarmAck: AlarmAck) { if (!isConnected || !hasWriteAuth) return socket?.emit("ack", alarmAck.level, alarmAck.group, alarmAck.silenceTime) - rxBus.send(EventNSClientNewLog("ALARMACK ", alarmAck.level.toString() + " " + alarmAck.group + " " + alarmAck.silenceTime)) + rxBus.send(EventNSClientNewLog("ALARMACK ", alarmAck.level.toString() + " " + alarmAck.group + " " + alarmAck.silenceTime, NsClient.Version.V1)) } fun resend(reason: String) { @@ -602,9 +618,9 @@ class NSClientService : DaggerService() { // "AndroidAPS:NSClientService_onDataUpdate") // wakeLock.acquire(mins(10).msecs()) try { - rxBus.send(EventNSClientNewLog("QUEUE", "Resend started: $reason")) + rxBus.send(EventNSClientNewLog("QUEUE", "Resend started: $reason", NsClient.Version.V1)) dataSyncSelector.doUpload() - rxBus.send(EventNSClientNewLog("QUEUE", "Resend ended: $reason")) + rxBus.send(EventNSClientNewLog("QUEUE", "Resend ended: $reason", NsClient.Version.V1)) } finally { // if (wakeLock.isHeld) wakeLock.release() } @@ -622,7 +638,7 @@ class NSClientService : DaggerService() { val nsAlarm = NSAlarm(announcement) val notification: Notification = NotificationWithAction(injector, nsAlarm) rxBus.send(EventNewNotification(notification)) - rxBus.send(EventNSClientNewLog("ANNOUNCEMENT", safeGetString(announcement, "message", "received"))) + rxBus.send(EventNSClientNewLog("ANNOUNCEMENT", safeGetString(announcement, "message", "received"), NsClient.Version.V1)) aapsLogger.debug(LTag.NSCLIENT, announcement.toString()) } } @@ -636,7 +652,7 @@ class NSClientService : DaggerService() { val notification: Notification = NotificationWithAction(injector, nsAlarm) rxBus.send(EventNewNotification(notification)) } - rxBus.send(EventNSClientNewLog("ALARM", safeGetString(alarm, "message", "received"))) + rxBus.send(EventNSClientNewLog("ALARM", safeGetString(alarm, "message", "received"), NsClient.Version.V1)) aapsLogger.debug(LTag.NSCLIENT, alarm.toString()) } } @@ -650,7 +666,7 @@ class NSClientService : DaggerService() { val notification: Notification = NotificationWithAction(injector, nsAlarm) rxBus.send(EventNewNotification(notification)) } - rxBus.send(EventNSClientNewLog("URGENTALARM", safeGetString(alarm, "message", "received"))) + rxBus.send(EventNSClientNewLog("URGENTALARM", safeGetString(alarm, "message", "received"), NsClient.Version.V1)) aapsLogger.debug(LTag.NSCLIENT, alarm.toString()) } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt new file mode 100644 index 0000000000..3aeed76751 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -0,0 +1,316 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3 + +import android.content.Context +import android.os.Handler +import android.os.HandlerThread +import android.text.Spanned +import androidx.preference.PreferenceFragmentCompat +import androidx.preference.PreferenceScreen +import androidx.preference.SwitchPreference +import androidx.work.ExistingWorkPolicy +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.androidaps.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.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.ToastUtils +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.interfaces.utils.HtmlHelper +import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventChargingState +import info.nightscout.rx.events.EventNetworkChange +import info.nightscout.rx.logging.AAPSLogger +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.sharedPreferences.SP +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import kotlinx.serialization.decodeFromString +import kotlinx.serialization.json.Json +import javax.inject.Inject +import javax.inject.Singleton +import kotlin.math.max + +@Singleton +class NSClientV3Plugin @Inject constructor( + injector: HasAndroidInjector, + aapsLogger: AAPSLogger, + private val aapsSchedulers: AapsSchedulers, + private val rxBus: RxBus, + rh: ResourceHelper, + private val context: Context, + private val fabricPrivacy: FabricPrivacy, + private val sp: SP, + private val nsClientReceiverDelegate: NsClientReceiverDelegate, + private val config: Config, + private val buildHelper: BuildHelper, + private val dateUtil: DateUtil +) : NsClient, Sync, PluginBase( + PluginDescription() + .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) + .description(R.string.description_ns_client_v3), + aapsLogger, rh, injector +) { + + companion object { + + val JOB_NAME: String = this::class.java.simpleName + } + + private val disposable = CompositeDisposable() + private val handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper) + private val listLog: MutableList = ArrayList() + override var status = "" + override val nsClientService: NSClientService? = null // service not needed + + internal lateinit var nsAndroidClient: NSAndroidClient +// private lateinit var nsAndroidRxClient: NSAndroidRxClient + + val isAllowed: Boolean + get() = nsClientReceiverDelegate.allowed + val blockingReason: String + get() = nsClientReceiverDelegate.blockingReason + + private val maxAge = T.days(77).msecs() + internal var lastModified: LastModified? = null // timestamp of last modification for every collection + internal var lastFetched = + LastModified( + LastModified.Collections( + dateUtil.now() - maxAge, + dateUtil.now() - maxAge, + dateUtil.now() - maxAge, + dateUtil.now() - maxAge + ) + ) // timestamp of last fetched data for every collection + + override fun onStart() { +// context.bindService(Intent(context, NSClientService::class.java), mConnection, Context.BIND_AUTO_CREATE) + super.onStart() + + lastFetched = Json.decodeFromString( + sp.getString( + R.string.key_nsclientv2_lastmodified, + Json.encodeToString( + LastModified.serializer(), + LastModified(LastModified.Collections(dateUtil.now() - maxAge, dateUtil.now() - maxAge, dateUtil.now() - maxAge, dateUtil.now() - maxAge)) + ) + ) + ) + lastFetched.collections.entries = max(dateUtil.now() - maxAge, lastFetched.collections.entries) + lastFetched.collections.treatments = max(dateUtil.now() - maxAge, lastFetched.collections.treatments) + lastFetched.collections.profile = max(dateUtil.now() - maxAge, lastFetched.collections.profile) + lastFetched.collections.devicestatus = max(dateUtil.now() - maxAge, lastFetched.collections.devicestatus) + + nsAndroidClient = NSAndroidClientImpl( + baseUrl = sp.getString(R.string.key_nsclientinternal_url, "").lowercase().replace("https://", ""), + accessToken = sp.getString(R.string.key_nsclient_token, ""), + context = context, + logging = true + ) + + nsClientReceiverDelegate.grabReceiversState() + disposable += rxBus + .toObservable(EventNSClientStatus::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ event -> + if (event.version == NsClient.Version.V3) { + status = event.getStatus(rh) + rxBus.send(EventNSClientUpdateGUI()) + } + }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventNetworkChange::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ ev -> nsClientReceiverDelegate.onStatusEvent(ev) }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventPreferenceChange::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ ev -> nsClientReceiverDelegate.onStatusEvent(ev) }, fabricPrivacy::logException) + // disposable += rxBus + // .toObservable(EventAppExit::class.java) + // .observeOn(aapsSchedulers.io) + // .subscribe({ if (nsClientService != null) context.unbindService(mConnection) }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventNSClientNewLog::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ event -> + if (event.version != NsClient.Version.V3) return@subscribe + addToLog(event) + aapsLogger.debug(LTag.NSCLIENT, event.action + " " + event.logText) + }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventChargingState::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ ev -> nsClientReceiverDelegate.onStatusEvent(ev) }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventNSClientResend::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ event -> resend(event.reason) }, fabricPrivacy::logException) + } + + override fun onStop() { + // context.applicationContext.unbindService(mConnection) + disposable.clear() + super.onStop() + } + + override fun preprocessPreferences(preferenceFragment: PreferenceFragmentCompat) { + super.preprocessPreferences(preferenceFragment) + if (config.NSCLIENT) { + preferenceFragment.findPreference(rh.gs(R.string.ns_sync_options))?.isVisible = false + + preferenceFragment.findPreference(rh.gs(R.string.key_ns_create_announcements_from_errors))?.isVisible = false + preferenceFragment.findPreference(rh.gs(R.string.key_ns_create_announcements_from_carbs_req))?.isVisible = false + } + preferenceFragment.findPreference(rh.gs(R.string.key_ns_receive_tbr_eb))?.isVisible = buildHelper.isEngineeringMode() + } + + override val hasWritePermission: Boolean get() = nsClientService?.hasWriteAuth ?: false + override val connected: Boolean get() = nsClientService?.isConnected ?: false + + override fun clearLog() { + handler.post { + synchronized(listLog) { listLog.clear() } + rxBus.send(EventNSClientUpdateGUI()) + } + } + + private fun addToLog(ev: EventNSClientNewLog) { + synchronized(listLog) { + listLog.add(ev) + // remove the first line if log is too large + if (listLog.size >= Constants.MAX_LOG_LINES) { + listLog.removeAt(0) + } + } + rxBus.send(EventNSClientUpdateGUI()) + } + + override fun textLog(): Spanned { + try { + val newTextLog = StringBuilder() + synchronized(listLog) { + for (log in listLog) newTextLog.append(log.toPreparedHtml()) + } + return HtmlHelper.fromHtml(newTextLog.toString()) + } catch (e: OutOfMemoryError) { + ToastUtils.showToastInUiThread(context, rxBus, "Out of memory!\nStop using this phone !!!", R.raw.error) + } + return HtmlHelper.fromHtml("") + } + + override fun resend(reason: String) { + nsClientService?.resend(reason) + } + + override fun pause(newState: Boolean) { + sp.putBoolean(R.string.key_nsclientinternal_paused, newState) + rxBus.send(EventPreferenceChange(rh, R.string.key_nsclientinternal_paused)) + } + + override val version: NsClient.Version + get() = NsClient.Version.V3 + + override val address: String get() = sp.getString(R.string.key_nsclientinternal_url, "") + + fun handleClearAlarm(originalAlarm: NSAlarm, silenceTimeInMilliseconds: Long) { + if (!isEnabled()) return + if (!sp.getBoolean(R.string.key_ns_upload, true)) { + aapsLogger.debug(LTag.NSCLIENT, "Upload disabled. Message dropped") + return + } + nsClientService?.sendAlarmAck( + AlarmAck().also { ack -> + ack.level = originalAlarm.level() + ack.group = originalAlarm.group() + ack.silenceTime = silenceTimeInMilliseconds + }) + } + + override fun updateLatestBgReceivedIfNewer(latestReceived: Long) { + if (latestReceived > lastFetched.collections.entries) { + lastFetched.collections.entries = latestReceived + storeLastFetched() + } + } + + override fun updateLatestTreatmentReceivedIfNewer(latestReceived: Long) { + lastFetched.collections.treatments = latestReceived + storeLastFetched() + } + + override fun resetToFullSync() { + lastFetched = LastModified( + LastModified.Collections( + dateUtil.now() - maxAge, + dateUtil.now() - maxAge, + dateUtil.now() - maxAge, + dateUtil.now() - maxAge + ) + ) + storeLastFetched() + } + + private fun storeLastFetched() { + sp.putString(R.string.key_nsclientv2_lastmodified, Json.encodeToString(LastModified.serializer(), lastFetched)) + } + + fun test() { + if (workIsRunning(arrayOf(JOB_NAME))) + rxBus.send(EventNSClientNewLog("RUN", "Already running", NsClient.Version.V3)) + else { + rxBus.send(EventNSClientNewLog("RUN", "Starting next round", NsClient.Version.V3)) + WorkManager.getInstance(context) + .beginUniqueWork( + "NSCv3Load", + ExistingWorkPolicy.REPLACE, + OneTimeWorkRequest.Builder(LoadStatusWorker::class.java).build() + ) + .then(OneTimeWorkRequest.Builder(LoadLastModificationWorker::class.java).build()) + .then(OneTimeWorkRequest.Builder(LoadBgWorker::class.java).build()) + // LoadTreatmentsWorker is enqueued after BG finish + //.then(OneTimeWorkRequest.Builder(LoadTreatmentsWorker::class.java).build()) + .enqueue() + } + } + + private fun workIsRunning(workNames: Array): Boolean { + for (workName in workNames) + for (workInfo in WorkManager.getInstance(context).getWorkInfosForUniqueWork(workName).get()) + if (workInfo.state == WorkInfo.State.BLOCKED || workInfo.state == WorkInfo.State.ENQUEUED || workInfo.state == WorkInfo.State.RUNNING) + return true + return false + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt new file mode 100644 index 0000000000..ddc6d88c84 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt @@ -0,0 +1,19 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions + +import com.google.gson.Gson +import com.google.gson.JsonSyntaxException +import info.nightscout.androidaps.database.entities.BolusCalculatorResult +import info.nightscout.sdk.localmodel.treatment.NSBolusWizard + +fun NSBolusWizard.toBolusCalculatorResult(): BolusCalculatorResult? = + try { + Gson().fromJson(bolusCalculatorResult, BolusCalculatorResult::class.java) + .also { + it.id = 0 + it.isValid = isValid + it.interfaceIDs.nightscoutId = identifier + it.version = 0 + } + } catch (e: JsonSyntaxException) { + null + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt new file mode 100644 index 0000000000..10f41e9343 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/BolusExtension.kt @@ -0,0 +1,24 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.sdk.localmodel.treatment.NSBolus + +fun NSBolus.toBolus(): Bolus = + Bolus( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + amount = insulin, + type = type.toBolusType(), + notes = notes, + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) + +fun NSBolus.BolusType?.toBolusType(): Bolus.Type = + when (this) { + NSBolus.BolusType.NORMAL -> Bolus.Type.NORMAL + NSBolus.BolusType.SMB -> Bolus.Type.SMB + NSBolus.BolusType.PRIMING -> Bolus.Type.PRIMING + null -> Bolus.Type.NORMAL + } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt new file mode 100644 index 0000000000..3c85c8de41 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/CarbsExtension.kt @@ -0,0 +1,16 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.sdk.localmodel.treatment.NSCarbs + +fun NSCarbs.toCarbs(): Carbs = + Carbs( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + amount = carbs, + notes = notes, + duration = duration, + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt new file mode 100644 index 0000000000..a022d65380 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -0,0 +1,33 @@ +package info.nightscout.androidaps.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.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.plugins.sync.nsclient.extensions.fromConstant +import info.nightscout.sdk.localmodel.treatment.NSEffectiveProfileSwitch + +fun NSEffectiveProfileSwitch.toEffectiveProfileSwitch(dateUtil: DateUtil): EffectiveProfileSwitch? { + val pureProfile = pureProfileFromJson(profileJson, dateUtil) ?: return null + val profileSealed = ProfileSealed.Pure(pureProfile) + + return EffectiveProfileSwitch( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + basalBlocks = profileSealed.basalBlocks, + isfBlocks = profileSealed.isfBlocks, + icBlocks = profileSealed.icBlocks, + targetBlocks = profileSealed.targetBlocks, + glucoseUnit = EffectiveProfileSwitch.GlucoseUnit.fromConstant(profileSealed.units), + originalProfileName = originalProfileName, + originalCustomizedName = originalCustomizedName, + originalTimeshift = originalTimeshift, + originalPercentage = originalPercentage, + originalDuration = originalDuration, + originalEnd = originalEnd, + insulinConfiguration = profileSealed.insulinConfiguration, + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt new file mode 100644 index 0000000000..41966b4ccb --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt @@ -0,0 +1,16 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.ExtendedBolus +import info.nightscout.sdk.localmodel.treatment.NSExtendedBolus + +fun NSExtendedBolus.toExtendedBolus(): ExtendedBolus = + ExtendedBolus( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + amount = enteredinsulin, + duration = duration, + isEmulatingTempBasal = isEmulatingTempbasal, + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt new file mode 100644 index 0000000000..d237881d43 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt @@ -0,0 +1,25 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.OfflineEvent +import info.nightscout.sdk.localmodel.treatment.NSOfflineEvent + +fun NSOfflineEvent.toOfflineEvent(): OfflineEvent = + OfflineEvent( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + duration = duration, + reason = reason.toReason(), + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) + +fun NSOfflineEvent.Reason?.toReason(): OfflineEvent.Reason = + when (this) { + NSOfflineEvent.Reason.DISCONNECT_PUMP -> OfflineEvent.Reason.DISCONNECT_PUMP + NSOfflineEvent.Reason.SUSPEND -> OfflineEvent.Reason.SUSPEND + NSOfflineEvent.Reason.DISABLE_LOOP -> OfflineEvent.Reason.DISABLE_LOOP + NSOfflineEvent.Reason.SUPER_BOLUS -> OfflineEvent.Reason.SUPER_BOLUS + NSOfflineEvent.Reason.OTHER -> OfflineEvent.Reason.OTHER + null -> OfflineEvent.Reason.OTHER + } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt new file mode 100644 index 0000000000..46652e8598 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -0,0 +1,36 @@ +package info.nightscout.androidaps.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.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.extensions.fromConstant +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch + +fun NSProfileSwitch.toProfileSwitch(activePlugin: ActivePlugin, dateUtil: DateUtil): ProfileSwitch? { + val pureProfile = + profileJson?.let { pureProfileFromJson(it, dateUtil) ?: return null } + ?: activePlugin.activeProfileSource.profile?.getSpecificProfile(profileName) ?: return null + + val profileSealed = ProfileSealed.Pure(pureProfile) + + return ProfileSwitch( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + basalBlocks = profileSealed.basalBlocks, + isfBlocks = profileSealed.isfBlocks, + icBlocks = profileSealed.icBlocks, + targetBlocks = profileSealed.targetBlocks, + glucoseUnit = ProfileSwitch.GlucoseUnit.fromConstant(profileSealed.units), + profileName = originalProfileName ?: profileName, + timeshift = timeShift ?: 0, + percentage = percentage ?: 100, + duration = originalDuration ?: T.mins(duration ?: 0).msecs(), + insulinConfiguration = profileSealed.insulinConfiguration, + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt new file mode 100644 index 0000000000..8735c78443 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt @@ -0,0 +1,27 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.sdk.localmodel.treatment.NSTemporaryBasal + +fun NSTemporaryBasal.toTemporaryBasal(): TemporaryBasal = + TemporaryBasal( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + type = type.toType(), + rate = rate, + isAbsolute = isAbsolute, + duration = duration, + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) + +fun NSTemporaryBasal.Type?.toType(): TemporaryBasal.Type = + when (this) { + NSTemporaryBasal.Type.NORMAL -> TemporaryBasal.Type.NORMAL + NSTemporaryBasal.Type.EMULATED_PUMP_SUSPEND -> TemporaryBasal.Type.EMULATED_PUMP_SUSPEND + NSTemporaryBasal.Type.PUMP_SUSPEND -> TemporaryBasal.Type.PUMP_SUSPEND + NSTemporaryBasal.Type.SUPERBOLUS -> TemporaryBasal.Type.SUPERBOLUS + NSTemporaryBasal.Type.FAKE_EXTENDED -> TemporaryBasal.Type.FAKE_EXTENDED + null -> TemporaryBasal.Type.NORMAL + } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt new file mode 100644 index 0000000000..22d1d62038 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt @@ -0,0 +1,28 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.TemporaryTarget +import info.nightscout.sdk.localmodel.treatment.NSTemporaryTarget + +fun NSTemporaryTarget.toTemporaryTarget(): TemporaryTarget = + TemporaryTarget( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + reason = reason.toReason(), + highTarget = targetTop.asMgdl(), + lowTarget = targetBottom.asMgdl(), + duration = duration, + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) + +fun NSTemporaryTarget.Reason?.toReason(): TemporaryTarget.Reason = + when (this) { + NSTemporaryTarget.Reason.CUSTOM -> TemporaryTarget.Reason.CUSTOM + NSTemporaryTarget.Reason.HYPOGLYCEMIA -> TemporaryTarget.Reason.HYPOGLYCEMIA + NSTemporaryTarget.Reason.ACTIVITY -> TemporaryTarget.Reason.ACTIVITY + NSTemporaryTarget.Reason.EATING_SOON -> TemporaryTarget.Reason.EATING_SOON + NSTemporaryTarget.Reason.AUTOMATION -> TemporaryTarget.Reason.AUTOMATION + NSTemporaryTarget.Reason.WEAR -> TemporaryTarget.Reason.WEAR + null -> TemporaryTarget.Reason.CUSTOM + } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt new file mode 100644 index 0000000000..4226fe79b8 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt @@ -0,0 +1,68 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.sdk.localmodel.entry.NsUnits +import info.nightscout.sdk.localmodel.treatment.EventType +import info.nightscout.sdk.localmodel.treatment.NSTherapyEvent + +fun NSTherapyEvent.toTherapyEvent(): TherapyEvent = + TherapyEvent( + isValid = isValid, + timestamp = date, + utcOffset = utcOffset, + glucoseUnit = units.toUnits(), + type = eventType.toType(), + note = notes, + enteredBy = enteredBy, + glucose = glucose, + glucoseType = glucoseType.toMeterType(), + duration = duration, + interfaceIDs_backing = InterfaceIDs(nightscoutId = identifier, pumpId = pumpId, pumpType = InterfaceIDs.PumpType.fromString(pumpType), pumpSerial = pumpSerial, endId = endId) + ) + +fun EventType.toType(): TherapyEvent.Type = + when (this) { + EventType.CANNULA_CHANGE -> TherapyEvent.Type.CANNULA_CHANGE + EventType.INSULIN_CHANGE -> TherapyEvent.Type.INSULIN_CHANGE + EventType.PUMP_BATTERY_CHANGE -> TherapyEvent.Type.PUMP_BATTERY_CHANGE + EventType.SENSOR_CHANGE -> TherapyEvent.Type.SENSOR_CHANGE + EventType.SENSOR_STARTED -> TherapyEvent.Type.SENSOR_STARTED + EventType.SENSOR_STOPPED -> TherapyEvent.Type.SENSOR_STOPPED + EventType.FINGER_STICK_BG_VALUE -> TherapyEvent.Type.FINGER_STICK_BG_VALUE + EventType.EXERCISE -> TherapyEvent.Type.EXERCISE + EventType.ANNOUNCEMENT -> TherapyEvent.Type.ANNOUNCEMENT + EventType.QUESTION -> TherapyEvent.Type.QUESTION + EventType.NOTE -> TherapyEvent.Type.NOTE + EventType.APS_OFFLINE -> TherapyEvent.Type.APS_OFFLINE + EventType.DAD_ALERT -> TherapyEvent.Type.DAD_ALERT + EventType.NS_MBG -> TherapyEvent.Type.NS_MBG + EventType.CARBS_CORRECTION -> TherapyEvent.Type.CARBS_CORRECTION + EventType.BOLUS_WIZARD -> TherapyEvent.Type.BOLUS_WIZARD + EventType.CORRECTION_BOLUS -> TherapyEvent.Type.CORRECTION_BOLUS + EventType.MEAL_BOLUS -> TherapyEvent.Type.MEAL_BOLUS + EventType.COMBO_BOLUS -> TherapyEvent.Type.COMBO_BOLUS + EventType.TEMPORARY_TARGET -> TherapyEvent.Type.TEMPORARY_TARGET + EventType.TEMPORARY_TARGET_CANCEL -> TherapyEvent.Type.TEMPORARY_TARGET_CANCEL + EventType.PROFILE_SWITCH -> TherapyEvent.Type.PROFILE_SWITCH + EventType.SNACK_BOLUS -> TherapyEvent.Type.SNACK_BOLUS + EventType.TEMPORARY_BASAL -> TherapyEvent.Type.TEMPORARY_BASAL + EventType.TEMPORARY_BASAL_START -> TherapyEvent.Type.TEMPORARY_BASAL_START + EventType.TEMPORARY_BASAL_END -> TherapyEvent.Type.TEMPORARY_BASAL_END + EventType.NONE -> TherapyEvent.Type.NONE + } + +fun NSTherapyEvent.MeterType?.toMeterType(): TherapyEvent.MeterType = + when (this) { + NSTherapyEvent.MeterType.FINGER -> TherapyEvent.MeterType.FINGER + NSTherapyEvent.MeterType.SENSOR -> TherapyEvent.MeterType.SENSOR + NSTherapyEvent.MeterType.MANUAL -> TherapyEvent.MeterType.MANUAL + null -> TherapyEvent.MeterType.MANUAL + } + +fun NsUnits?.toUnits(): TherapyEvent.GlucoseUnit = + when (this) { + NsUnits.MG_DL -> TherapyEvent.GlucoseUnit.MGDL + NsUnits.MMOL_L -> TherapyEvent.GlucoseUnit.MMOL + null -> TherapyEvent.GlucoseUnit.MGDL + } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt new file mode 100644 index 0000000000..070be71a8a --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt @@ -0,0 +1,100 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.workers + +import android.content.Context +import androidx.work.ExistingWorkPolicy +import androidx.work.OneTimeWorkRequest +import androidx.work.WorkManager +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.androidaps.utils.DateUtil +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.sharedPreferences.SP +import kotlinx.coroutines.runBlocking +import javax.inject.Inject + +class LoadBgWorker( + context: Context, params: WorkerParameters +) : Worker(context, params) { + + @Inject lateinit var aapsLogger: AAPSLogger + @Inject lateinit var dataWorkerStorage: DataWorkerStorage + @Inject lateinit var rxBus: RxBus + @Inject lateinit var sp: SP + @Inject lateinit var context: Context + @Inject lateinit var dateUtil: DateUtil + @Inject lateinit var nsClientV3Plugin: NSClientV3Plugin + + companion object { + + val JOB_NAME: String = this::class.java.simpleName + } + + override fun doWork(): Result { + var ret = Result.success() + + runBlocking { + if ((nsClientV3Plugin.lastModified?.collections?.entries ?: Long.MAX_VALUE) > nsClientV3Plugin.lastFetched.collections.entries) + try { + //val sgvs = nsClientV3Plugin.nsAndroidClient.getSgvsModifiedSince(nsClientV3Plugin.lastFetched.collections.entries) + val sgvs = nsClientV3Plugin.nsAndroidClient.getSgvsNewerThan(nsClientV3Plugin.lastFetched.collections.entries, 500) + aapsLogger.debug("SGVS: $sgvs") + if (sgvs.isNotEmpty()) { + rxBus.send( + EventNSClientNewLog( + "RCV", + "${sgvs.size} SVGs from ${dateUtil.dateAndTimeAndSecondsString(nsClientV3Plugin.lastFetched.collections.entries)}", + NsClient.Version.V3 + ) + ) + // Objective0 + sp.putBoolean(R.string.key_ObjectivesbgIsAvailableInNS, true) + // Schedule processing of fetched data and continue of loading + WorkManager.getInstance(context).beginUniqueWork( + JOB_NAME, + ExistingWorkPolicy.APPEND_OR_REPLACE, + OneTimeWorkRequest.Builder(NSClientSourcePlugin.NSClientSourceWorker::class.java).setInputData(dataWorkerStorage.storeInputData(sgvs)).build() + ).then(OneTimeWorkRequest.Builder(LoadBgWorker::class.java).build()).enqueue() + } else { + rxBus.send(EventNSClientNewLog("END", "No SGVs from ${dateUtil.dateAndTimeAndSecondsString(nsClientV3Plugin.lastFetched.collections.entries)}", NsClient.Version.V3)) + WorkManager.getInstance(context) + .beginUniqueWork( + NSClientV3Plugin.JOB_NAME, + ExistingWorkPolicy.APPEND_OR_REPLACE, + OneTimeWorkRequest.Builder(StoreDataForDb.StoreBgWorker::class.java).build() + ) + .then(OneTimeWorkRequest.Builder(LoadTreatmentsWorker::class.java).build()) + .enqueue() + } + } catch (error: Exception) { + aapsLogger.error("Error: ", error) + ret = Result.failure(workDataOf("Error" to error.toString())) + } + else { + rxBus.send(EventNSClientNewLog("END", "No new SGVs from ${dateUtil.dateAndTimeAndSecondsString(nsClientV3Plugin.lastFetched.collections.entries)}", NsClient.Version.V3)) + WorkManager.getInstance(context) + .beginUniqueWork( + NSClientV3Plugin.JOB_NAME, + ExistingWorkPolicy.APPEND_OR_REPLACE, + OneTimeWorkRequest.Builder(StoreDataForDb.StoreBgWorker::class.java).build() + ) + .then(OneTimeWorkRequest.Builder(LoadTreatmentsWorker::class.java).build()) + .enqueue() + } + } + return ret + } + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt new file mode 100644 index 0000000000..2f07cb139c --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt @@ -0,0 +1,58 @@ +package info.nightscout.androidaps.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.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.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.T +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.logging.AAPSLogger +import kotlinx.coroutines.runBlocking +import javax.inject.Inject + +class LoadDeviceStatusWorker( + context: Context, + params: WorkerParameters +) : Worker(context, params) { + + @Inject lateinit var aapsLogger: AAPSLogger + @Inject lateinit var dataWorkerStorage: DataWorkerStorage + @Inject lateinit var rxBus: RxBus + @Inject lateinit var context: Context + @Inject lateinit var nsClientV3Plugin: NSClientV3Plugin + @Inject lateinit var dateUtil: DateUtil + @Inject lateinit var nsDeviceStatusHandler: NSDeviceStatusHandler + + override fun doWork(): Result { + var ret = Result.success() + + runBlocking { + try { + val from = dateUtil.now() - T.mins(7).msecs() + val deviceStatuses = nsClientV3Plugin.nsAndroidClient.getDeviceStatusModifiedSince(from) + aapsLogger.debug("DEVICESTATUSES: $deviceStatuses") + if (deviceStatuses.isNotEmpty()) { + rxBus.send(EventNSClientNewLog("RCV", "${deviceStatuses.size} DSs from ${dateUtil.dateAndTimeAndSecondsString(from)}", NsClient.Version.V3)) + nsDeviceStatusHandler.handleNewData(deviceStatuses.toTypedArray(), NsClient.Version.V3) + } else { + rxBus.send(EventNSClientNewLog("END", "No DSs from ${dateUtil.dateAndTimeAndSecondsString(from)}", NsClient.Version.V3)) + } + } catch (error: Exception) { + aapsLogger.error("Error: ", error) + ret = Result.failure(workDataOf("Error" to error.toString())) + } + } + return ret + } + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt new file mode 100644 index 0000000000..62162e7367 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadLastModificationWorker.kt @@ -0,0 +1,39 @@ +package info.nightscout.androidaps.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.rx.logging.AAPSLogger +import kotlinx.coroutines.runBlocking +import javax.inject.Inject + +class LoadLastModificationWorker( + context: Context, params: WorkerParameters +) : Worker(context, params) { + + @Inject lateinit var aapsLogger: AAPSLogger + @Inject lateinit var nsClientV3Plugin: NSClientV3Plugin + + override fun doWork(): Result { + var ret = Result.success() + + runBlocking { + try { + val lm = nsClientV3Plugin.nsAndroidClient.getLastModified() + nsClientV3Plugin.lastModified = lm + aapsLogger.debug("LAST MODIFIED: ${nsClientV3Plugin.lastModified}") + } catch (error: Exception) { + aapsLogger.error("Error: ", error) + ret = Result.failure(workDataOf("Error" to error.toString())) + } + } + return ret + } + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt new file mode 100644 index 0000000000..bdebb19219 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadStatusWorker.kt @@ -0,0 +1,38 @@ +package info.nightscout.androidaps.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.rx.logging.AAPSLogger +import kotlinx.coroutines.runBlocking +import javax.inject.Inject + +class LoadStatusWorker( + context: Context, params: WorkerParameters +) : Worker(context, params) { + + @Inject lateinit var aapsLogger: AAPSLogger + @Inject lateinit var nsClientV3Plugin: NSClientV3Plugin + + override fun doWork(): Result { + var ret = Result.success() + + runBlocking { + try { + val status = nsClientV3Plugin.nsAndroidClient.getStatus() + aapsLogger.debug("STATUS: $status") + } catch (error: Exception) { + aapsLogger.error("Error: ", error) + ret = Result.failure(workDataOf("Error" to error.toString())) + } + } + return ret + } + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt new file mode 100644 index 0000000000..e7b98e3355 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -0,0 +1,97 @@ +package info.nightscout.androidaps.plugins.sync.nsclientV3.workers + +import android.content.Context +import androidx.work.ExistingWorkPolicy +import androidx.work.OneTimeWorkRequest +import androidx.work.WorkManager +import androidx.work.Worker +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.androidaps.utils.DateUtil +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.logging.AAPSLogger +import kotlinx.coroutines.runBlocking +import javax.inject.Inject + +class LoadTreatmentsWorker( + context: Context, + params: WorkerParameters +) : Worker(context, params) { + + @Inject lateinit var aapsLogger: AAPSLogger + @Inject lateinit var dataWorkerStorage: DataWorkerStorage + @Inject lateinit var rxBus: RxBus + @Inject lateinit var context: Context + @Inject lateinit var nsClientV3Plugin: NSClientV3Plugin + @Inject lateinit var dateUtil: DateUtil + @Inject lateinit var storeDataForDb: StoreDataForDb + + override fun doWork(): Result { + var ret = Result.success() + + runBlocking { + if ((nsClientV3Plugin.lastModified?.collections?.treatments ?: Long.MAX_VALUE) > nsClientV3Plugin.lastFetched.collections.treatments) + try { + val treatments = nsClientV3Plugin.nsAndroidClient.getTreatmentsModifiedSince(nsClientV3Plugin.lastFetched.collections.treatments, 500) + aapsLogger.debug("TREATMENTS: $treatments") + if (treatments.isNotEmpty()) { + rxBus.send( + EventNSClientNewLog( + "RCV", + "${treatments.size} TRs from ${dateUtil.dateAndTimeAndSecondsString(nsClientV3Plugin.lastFetched.collections.treatments)}", + NsClient.Version.V3 + ) + ) + // Schedule processing of fetched data and continue of loading + WorkManager.getInstance(context) + .beginUniqueWork( + NSClientV3Plugin.JOB_NAME, + ExistingWorkPolicy.APPEND_OR_REPLACE, + OneTimeWorkRequest.Builder(ProcessTreatmentsWorker::class.java) + .setInputData(dataWorkerStorage.storeInputData(treatments)) + .build() + ).then(OneTimeWorkRequest.Builder(LoadTreatmentsWorker::class.java).build()) + .enqueue() + } else { + rxBus.send( + EventNSClientNewLog( + "END", "No TRs from ${dateUtil.dateAndTimeAndSecondsString(nsClientV3Plugin.lastFetched.collections.treatments)}", + NsClient.Version.V3 + ) + ) + storeDataForDb.storeTreatmentsToDb() + WorkManager.getInstance(context) + .enqueueUniqueWork( + NSClientV3Plugin.JOB_NAME, + ExistingWorkPolicy.APPEND_OR_REPLACE, + OneTimeWorkRequest.Builder(LoadDeviceStatusWorker::class.java).build() + ) + } + } catch (error: Exception) { + aapsLogger.error("Error: ", error) + ret = Result.failure(workDataOf("Error" to error.toString())) + } + else { + rxBus.send(EventNSClientNewLog("END", "No new TRs from ${dateUtil.dateAndTimeAndSecondsString(nsClientV3Plugin.lastFetched.collections.treatments)}", NsClient.Version.V3)) + storeDataForDb.storeTreatmentsToDb() + WorkManager.getInstance(context) + .enqueueUniqueWork( + NSClientV3Plugin.JOB_NAME, + ExistingWorkPolicy.APPEND_OR_REPLACE, + OneTimeWorkRequest.Builder(LoadDeviceStatusWorker::class.java).build() + ) + } + } + return ret + } + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt new file mode 100644 index 0000000000..e1c48c4eb7 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt @@ -0,0 +1,158 @@ +package info.nightscout.androidaps.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.androidaps.utils.DateUtil +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.rx.logging.LTag +import info.nightscout.sdk.localmodel.treatment.NSBolus +import info.nightscout.sdk.localmodel.treatment.NSBolusWizard +import info.nightscout.sdk.localmodel.treatment.NSCarbs +import info.nightscout.sdk.localmodel.treatment.NSEffectiveProfileSwitch +import info.nightscout.sdk.localmodel.treatment.NSExtendedBolus +import info.nightscout.sdk.localmodel.treatment.NSOfflineEvent +import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch +import info.nightscout.sdk.localmodel.treatment.NSTemporaryBasal +import info.nightscout.sdk.localmodel.treatment.NSTemporaryTarget +import info.nightscout.sdk.localmodel.treatment.NSTherapyEvent +import info.nightscout.sdk.localmodel.treatment.NSTreatment +import info.nightscout.shared.sharedPreferences.SP +import javax.inject.Inject + +class ProcessTreatmentsWorker( + context: Context, + params: WorkerParameters +) : Worker(context, params) { + + @Inject lateinit var dataWorkerStorage: DataWorkerStorage + @Inject lateinit var aapsLogger: AAPSLogger + @Inject lateinit var buildHelper: BuildHelper + @Inject lateinit var sp: SP + @Inject lateinit var dateUtil: DateUtil + @Inject lateinit var config: Config + @Inject lateinit var repository: AppRepository + @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 + + override fun doWork(): Result { + @Suppress("UNCHECKED_CAST") + val treatments = dataWorkerStorage.pickupObject(inputData.getLong(DataWorkerStorage.STORE_KEY, -1)) as List? + ?: return Result.failure(workDataOf("Error" to "missing input data")) + + val ret = Result.success() + var latestDateInReceivedData = 0L + + for (treatment in treatments) { + aapsLogger.debug(LTag.DATABASE, "Received NS treatment: $treatment") + + //Find latest date in treatment + val mills = treatment.date + if (mills != 0L && mills < dateUtil.now()) + if (mills > latestDateInReceivedData) latestDateInReceivedData = mills + + when (treatment) { + is NSBolus -> + if (sp.getBoolean(R.string.key_ns_receive_insulin, false) || config.NSCLIENT) + storeDataForDb.boluses.add(treatment.toBolus()) + + is NSCarbs -> + if (sp.getBoolean(R.string.key_ns_receive_carbs, false) || config.NSCLIENT) + storeDataForDb.carbs.add(treatment.toCarbs()) + + is NSTemporaryTarget -> + if (sp.getBoolean(R.string.key_ns_receive_temp_target, false) || config.NSCLIENT) { + if (treatment.duration > 0L) { + // not ending event + if (treatment.targetBottomAsMgdl() < Constants.MIN_TT_MGDL + || treatment.targetBottomAsMgdl() > Constants.MAX_TT_MGDL + || treatment.targetTopAsMgdl() < Constants.MIN_TT_MGDL + || treatment.targetTopAsMgdl() > Constants.MAX_TT_MGDL + || treatment.targetBottomAsMgdl() > treatment.targetTopAsMgdl() + ) { + aapsLogger.debug(LTag.DATABASE, "Ignored TemporaryTarget $treatment") + continue + } + } + storeDataForDb.temporaryTargets.add(treatment.toTemporaryTarget()) + } + + is NSTemporaryBasal -> + if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) + storeDataForDb.temporaryBasals.add(treatment.toTemporaryBasal()) + + is NSEffectiveProfileSwitch -> + if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) { + treatment.toEffectiveProfileSwitch(dateUtil)?.let { effectiveProfileSwitch -> + storeDataForDb.effectiveProfileSwitches.add(effectiveProfileSwitch) + } + } + + is NSProfileSwitch -> + if (sp.getBoolean(R.string.key_ns_receive_profile_switch, false) || config.NSCLIENT) { + treatment.toProfileSwitch(activePlugin, dateUtil)?.let { profileSwitch -> + storeDataForDb.profileSwitches.add(profileSwitch) + } + } + + is NSBolusWizard -> + treatment.toBolusCalculatorResult()?.let { bolusCalculatorResult -> + storeDataForDb.bolusCalculatorResults.add(bolusCalculatorResult) + } + + is NSTherapyEvent -> + if (sp.getBoolean(R.string.key_ns_receive_therapy_events, false) || config.NSCLIENT) + treatment.toTherapyEvent().let { therapyEvent -> + storeDataForDb.therapyEvents.add(therapyEvent) + } + + is NSOfflineEvent -> + if (sp.getBoolean(R.string.key_ns_receive_offline_event, false) && buildHelper.isEngineeringMode() || config.NSCLIENT) + treatment.toOfflineEvent().let { offlineEvent -> + storeDataForDb.offlineEvents.add(offlineEvent) + } + + is NSExtendedBolus -> + if (buildHelper.isEngineeringMode() && sp.getBoolean(R.string.key_ns_receive_tbr_eb, false) || config.NSCLIENT) + treatment.toExtendedBolus().let { extendedBolus -> + storeDataForDb.extendedBoluses.add(extendedBolus) + } + } + } + activePlugin.activeNsClient?.updateLatestTreatmentReceivedIfNewer(latestDateInReceivedData) +// xDripBroadcast.sendTreatments(treatments) + return ret + } + + init { + (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) + } +} \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolFragment.kt similarity index 78% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolFragment.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolFragment.kt index a757b6e6a8..4d13020853 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool +package info.nightscout.androidaps.plugins.sync.tidepool import android.os.Bundle import android.view.LayoutInflater @@ -8,10 +8,10 @@ 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.comm.TidepoolUploader import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolDoUpload import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolResetData -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolUpdateGUI +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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -57,13 +57,13 @@ class TidepoolFragment : DaggerFragment() { .toObservable(EventTidepoolUpdateGUI::class.java) .observeOn(aapsSchedulers.main) .subscribe({ - if (_binding == null) return@subscribe - tidepoolPlugin.updateLog() - binding.log.text = tidepoolPlugin.textLog - binding.status.text = tidepoolUploader.connectionStatus.name - binding.log.text = tidepoolPlugin.textLog - binding.logscrollview.fullScroll(ScrollView.FOCUS_DOWN) - }, fabricPrivacy::logException) + if (_binding == null) return@subscribe + tidepoolPlugin.updateLog() + binding.log.text = tidepoolPlugin.textLog + binding.status.text = tidepoolUploader.connectionStatus.name + binding.log.text = tidepoolPlugin.textLog + binding.logscrollview.fullScroll(ScrollView.FOCUS_DOWN) + }, fabricPrivacy::logException) } @Synchronized diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt similarity index 62% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolPlugin.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt index 5af4f7a711..74b342cb94 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt @@ -1,32 +1,31 @@ -package info.nightscout.androidaps.plugins.general.tidepool +package info.nightscout.androidaps.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.interfaces.Constants 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.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.tidepool.comm.TidepoolUploader -import info.nightscout.androidaps.plugins.general.tidepool.comm.TidepoolUploader.ConnectionStatus.CONNECTED -import info.nightscout.androidaps.plugins.general.tidepool.comm.TidepoolUploader.ConnectionStatus.DISCONNECTED -import info.nightscout.androidaps.plugins.general.tidepool.comm.UploadChunk +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.general.tidepool.events.EventTidepoolStatus -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolUpdateGUI -import info.nightscout.androidaps.plugins.general.tidepool.utils.RateLimit +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.interfaces.utils.HtmlHelper import info.nightscout.androidaps.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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventNetworkChange @@ -52,14 +51,14 @@ class TidepoolPlugin @Inject constructor( private val sp: SP, private val rateLimit: RateLimit, private val receiverStatusStore: ReceiverStatusStore -) : PluginBase( +) : Sync, PluginBase( PluginDescription() - .mainType(PluginType.GENERAL) - .pluginName(R.string.tidepool) - .shortName(R.string.tidepool_shortname) - .fragmentClass(TidepoolFragment::class.qualifiedName) - .preferencesId(R.xml.pref_tidepool) - .description(R.string.description_tidepool), + .mainType(PluginType.SYNC) + .pluginName(R.string.tidepool) + .shortName(R.string.tidepool_shortname) + .fragmentClass(TidepoolFragment::class.qualifiedName) + .preferencesId(R.xml.pref_tidepool) + .description(R.string.description_tidepool), aapsLogger, rh, injector ) { @@ -79,14 +78,14 @@ class TidepoolPlugin @Inject constructor( .toObservable(EventTidepoolResetData::class.java) .observeOn(aapsSchedulers.io) .subscribe({ - if (tidepoolUploader.connectionStatus != CONNECTED) { - aapsLogger.debug(LTag.TIDEPOOL, "Not connected for delete Dataset") - } else { - tidepoolUploader.deleteDataSet() - sp.putLong(R.string.key_tidepool_last_end, 0) - tidepoolUploader.doLogin() - } - }, fabricPrivacy::logException) + if (tidepoolUploader.connectionStatus != TidepoolUploader.ConnectionStatus.CONNECTED) { + aapsLogger.debug(LTag.TIDEPOOL, "Not connected for delete Dataset") + } else { + tidepoolUploader.deleteDataSet() + sp.putLong(R.string.key_tidepool_last_end, 0) + tidepoolUploader.doLogin() + } + }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventTidepoolStatus::class.java) .observeOn(aapsSchedulers.io) @@ -95,26 +94,27 @@ class TidepoolPlugin @Inject constructor( .toObservable(EventNewBG::class.java) .observeOn(aapsSchedulers.io) .filter { it.glucoseValue != null } // better would be optional in API level >24 - .map { it.glucoseValue } + .map { it.glucoseValue!! } .subscribe({ bgReading -> - if (bgReading!!.timestamp < uploadChunk.getLastEnd()) - uploadChunk.setLastEnd(bgReading.timestamp ) - if (isEnabled(PluginType.GENERAL) - && (!sp.getBoolean(R.string.key_tidepool_only_while_charging, false) || receiverStatusStore.isCharging) - && (!sp.getBoolean(R.string.key_tidepool_only_while_unmetered, false) || receiverStatusStore.isWifiConnected) - && rateLimit.rateLimit("tidepool-new-data-upload", T.mins(4).secs().toInt())) - doUpload() - }, fabricPrivacy::logException) + if (bgReading!!.timestamp < uploadChunk.getLastEnd()) + uploadChunk.setLastEnd(bgReading.timestamp) + if (isEnabled() + && (!sp.getBoolean(R.string.key_tidepool_only_while_charging, false) || receiverStatusStore.isCharging) + && (!sp.getBoolean(R.string.key_tidepool_only_while_unmetered, false) || receiverStatusStore.isWifiConnected) + && rateLimit.rateLimit("tidepool-new-data-upload", T.mins(4).secs().toInt()) + ) + doUpload() + }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventPreferenceChange::class.java) .observeOn(aapsSchedulers.io) .subscribe({ event -> - if (event.isChanged(rh, R.string.key_tidepool_dev_servers) - || event.isChanged(rh, R.string.key_tidepool_username) - || event.isChanged(rh, R.string.key_tidepool_password) - ) - tidepoolUploader.resetInstance() - }, fabricPrivacy::logException) + if (event.isChanged(rh, R.string.key_tidepool_dev_servers) + || event.isChanged(rh, R.string.key_tidepool_username) + || event.isChanged(rh, R.string.key_tidepool_password) + ) + tidepoolUploader.resetInstance() + }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventNetworkChange::class.java) .observeOn(aapsSchedulers.io) @@ -141,10 +141,10 @@ class TidepoolPlugin @Inject constructor( private fun doUpload() = when (tidepoolUploader.connectionStatus) { - DISCONNECTED -> tidepoolUploader.doLogin(true) - CONNECTED -> tidepoolUploader.doUpload() + TidepoolUploader.ConnectionStatus.DISCONNECTED -> tidepoolUploader.doLogin(true) + TidepoolUploader.ConnectionStatus.CONNECTED -> tidepoolUploader.doUpload() - else -> { + else -> { } } @@ -175,4 +175,10 @@ class TidepoolPlugin @Inject constructor( } } + override val status: String + get() = tidepoolUploader.connectionStatus.name + override val hasWritePermission: Boolean + get() = tidepoolUploader.connectionStatus == TidepoolUploader.ConnectionStatus.CONNECTED + override val connected: Boolean + get() = tidepoolUploader.connectionStatus == TidepoolUploader.ConnectionStatus.CONNECTED } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/InfoInterceptor.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/InfoInterceptor.kt similarity index 92% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/InfoInterceptor.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/InfoInterceptor.kt index 748d427d43..0f29e5233f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/InfoInterceptor.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/InfoInterceptor.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.comm +package info.nightscout.androidaps.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/general/tidepool/comm/Session.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/Session.kt similarity index 81% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/Session.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/Session.kt index 5fb6b34605..6b3622851f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/Session.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/Session.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.plugins.general.tidepool.comm +package info.nightscout.androidaps.plugins.sync.tidepool.comm -import info.nightscout.androidaps.plugins.general.tidepool.messages.AuthReplyMessage -import info.nightscout.androidaps.plugins.general.tidepool.messages.DatasetReplyMessage +import info.nightscout.androidaps.plugins.sync.tidepool.messages.AuthReplyMessage +import info.nightscout.androidaps.plugins.sync.tidepool.messages.DatasetReplyMessage import okhttp3.Headers class Session(val authHeader: String?, diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolApiService.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolApiService.kt similarity index 85% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolApiService.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolApiService.kt index 52adf539c5..f9c0491e81 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolApiService.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolApiService.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.plugins.general.tidepool.comm +package info.nightscout.androidaps.plugins.sync.tidepool.comm import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.plugins.general.tidepool.messages.AuthReplyMessage -import info.nightscout.androidaps.plugins.general.tidepool.messages.DatasetReplyMessage -import info.nightscout.androidaps.plugins.general.tidepool.messages.UploadReplyMessage +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 okhttp3.RequestBody import retrofit2.Call import retrofit2.http.* diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolCallback.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolCallback.kt similarity index 87% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolCallback.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolCallback.kt index 909c84291a..0e7334378b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolCallback.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolCallback.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.general.tidepool.comm +package info.nightscout.androidaps.plugins.sync.tidepool.comm -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolStatus +import info.nightscout.androidaps.plugins.sync.tidepool.events.EventTidepoolStatus import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -8,7 +8,8 @@ import retrofit2.Call import retrofit2.Callback import retrofit2.Response -internal class TidepoolCallback(private val aapsLogger: AAPSLogger, private val rxBus: RxBus, private val session: Session, val name: String, val onSuccess: () -> Unit, val onFail: () -> Unit) : Callback { +internal class TidepoolCallback(private val aapsLogger: AAPSLogger, private val rxBus: RxBus, private val session: Session, val name: String, val onSuccess: () -> Unit, val onFail: () -> Unit) : + Callback { override fun onResponse(call: Call, response: Response) { if (response.isSuccessful && response.body() != null) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolUploader.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt similarity index 77% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolUploader.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt index 285dd766c9..54472b090a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolUploader.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.comm +package info.nightscout.androidaps.plugins.sync.tidepool.comm import android.content.Context import android.os.PowerManager @@ -7,12 +7,12 @@ import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolStatus -import info.nightscout.androidaps.plugins.general.tidepool.messages.AuthReplyMessage -import info.nightscout.androidaps.plugins.general.tidepool.messages.AuthRequestMessage -import info.nightscout.androidaps.plugins.general.tidepool.messages.DatasetReplyMessage -import info.nightscout.androidaps.plugins.general.tidepool.messages.OpenDatasetRequestMessage -import info.nightscout.androidaps.plugins.general.tidepool.messages.UploadReplyMessage +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.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog @@ -111,9 +111,9 @@ class TidepoolUploader @Inject constructor( call?.enqueue(TidepoolCallback(aapsLogger, rxBus, session!!, "Login", { startSession(session!!, doUpload) }, { - connectionStatus = ConnectionStatus.FAILED - releaseWakeLock() - })) + connectionStatus = ConnectionStatus.FAILED + releaseWakeLock() + })) return } else { aapsLogger.debug(LTag.TIDEPOOL, "Cannot do login as user credentials have not been set correctly") @@ -132,8 +132,12 @@ class TidepoolUploader @Inject constructor( call?.enqueue(TidepoolCallback(aapsLogger, rxBus, session, "Login", { OKDialog.show(rootContext, rh.gs(R.string.tidepool), "Successfully logged into Tidepool.") }, { - OKDialog.show(rootContext, rh.gs(R.string.tidepool), "Failed to log into Tidepool.\nCheck that your user name and password are correct.") - })) + OKDialog.show( + rootContext, + rh.gs(R.string.tidepool), + "Failed to log into Tidepool.\nCheck that your user name and password are correct." + ) + })) } ?: OKDialog.show(rootContext, rh.gs(R.string.tidepool), "Cannot do login as user credentials have not been set correctly") @@ -144,14 +148,18 @@ class TidepoolUploader @Inject constructor( extendWakeLock(30000) if (session.authReply?.userid != null) { // 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) + val datasetCall = session.service!!.getOpenDataSets( + session.token!!, + session.authReply!!.userid!!, BuildConfig.APPLICATION_ID, 1 + ) datasetCall.enqueue(TidepoolCallback>(aapsLogger, rxBus, session, "Get Open Datasets", { if (session.datasetReply == null) { rxBus.send(EventTidepoolStatus(("Creating new dataset"))) - val call = session.service.openDataSet(session.token!!, session.authReply!!.userid!!, - OpenDatasetRequestMessage(activePlugin.activePump.serialNumber(), dateUtil).getBody()) + val call = session.service.openDataSet( + session.token!!, session.authReply!!.userid!!, + OpenDatasetRequestMessage(activePlugin.activePump.serialNumber(), dateUtil).getBody() + ) call.enqueue(TidepoolCallback(aapsLogger, rxBus, session, "Open New Dataset", { connectionStatus = ConnectionStatus.CONNECTED rxBus.send(EventTidepoolStatus(("New dataset OK"))) @@ -159,10 +167,10 @@ class TidepoolUploader @Inject constructor( else releaseWakeLock() }, { - rxBus.send(EventTidepoolStatus(("New dataset FAILED"))) - connectionStatus = ConnectionStatus.FAILED - releaseWakeLock() - })) + rxBus.send(EventTidepoolStatus(("New dataset FAILED"))) + connectionStatus = ConnectionStatus.FAILED + releaseWakeLock() + })) } else { aapsLogger.debug(LTag.TIDEPOOL, "Existing Dataset: " + session.datasetReply!!.getUploadId()) // TODO: Wouldn't need to do this if we could block on the above `call.enqueue`. @@ -174,10 +182,10 @@ class TidepoolUploader @Inject constructor( releaseWakeLock() } }, { - connectionStatus = ConnectionStatus.FAILED - rxBus.send(EventTidepoolStatus(("Open dataset FAILED"))) - releaseWakeLock() - })) + connectionStatus = ConnectionStatus.FAILED + rxBus.send(EventTidepoolStatus(("Open dataset FAILED"))) + releaseWakeLock() + })) } else { aapsLogger.error("Got login response but cannot determine userId - cannot proceed") connectionStatus = ConnectionStatus.FAILED @@ -222,9 +230,9 @@ class TidepoolUploader @Inject constructor( releaseWakeLock() uploadNext() }, { - rxBus.send(EventTidepoolStatus(("Upload FAILED"))) - releaseWakeLock() - })) + rxBus.send(EventTidepoolStatus(("Upload FAILED"))) + releaseWakeLock() + })) } } } @@ -248,10 +256,10 @@ class TidepoolUploader @Inject constructor( rxBus.send(EventTidepoolStatus(("Dataset removed OK"))) releaseWakeLock() }, { - connectionStatus = ConnectionStatus.DISCONNECTED - rxBus.send(EventTidepoolStatus(("Dataset remove FAILED"))) - releaseWakeLock() - })) + connectionStatus = ConnectionStatus.DISCONNECTED + rxBus.send(EventTidepoolStatus(("Dataset remove FAILED"))) + releaseWakeLock() + })) } else { aapsLogger.error("Got login response but cannot determine datasetId - cannot proceed") } @@ -273,10 +281,10 @@ class TidepoolUploader @Inject constructor( rxBus.send(EventTidepoolStatus(("All data removed OK"))) releaseWakeLock() }, { - connectionStatus = ConnectionStatus.DISCONNECTED - rxBus.send(EventTidepoolStatus(("All data remove FAILED"))) - releaseWakeLock() - })) + connectionStatus = ConnectionStatus.DISCONNECTED + rxBus.send(EventTidepoolStatus(("All data remove FAILED"))) + releaseWakeLock() + })) } catch (e: IllegalArgumentException) { aapsLogger.error("Got login response but cannot determine userId - cannot proceed") } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/UploadChunk.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/UploadChunk.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt index 532ef1f095..2085630b64 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/UploadChunk.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.comm +package info.nightscout.androidaps.plugins.sync.tidepool.comm import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository @@ -6,15 +6,15 @@ 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.general.tidepool.elements.BasalElement -import info.nightscout.androidaps.plugins.general.tidepool.elements.BaseElement -import info.nightscout.androidaps.plugins.general.tidepool.elements.BloodGlucoseElement -import info.nightscout.androidaps.plugins.general.tidepool.elements.BolusElement -import info.nightscout.androidaps.plugins.general.tidepool.elements.ProfileElement -import info.nightscout.androidaps.plugins.general.tidepool.elements.SensorGlucoseElement -import info.nightscout.androidaps.plugins.general.tidepool.elements.WizardElement -import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolStatus -import info.nightscout.androidaps.plugins.general.tidepool.utils.GsonInstance +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.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BasalElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BasalElement.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt index 272a039300..f4efd137c9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BasalElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.elements +package info.nightscout.androidaps.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.interfaces.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BaseElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BaseElement.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt index 49aa6eae18..59df1bec63 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BaseElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.elements +package info.nightscout.androidaps.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.utils.DateUtil diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BloodGlucoseElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BloodGlucoseElement.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index 58f209f6dd..e753a72906 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BloodGlucoseElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.plugins.general.tidepool.elements +package info.nightscout.androidaps.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.extensions.toMainUnit +import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit import info.nightscout.androidaps.utils.DateUtil import java.util.* diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BolusElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BolusElement.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt index 6c3a05b0eb..436468e30a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/BolusElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.elements +package info.nightscout.androidaps.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.database.entities.Bolus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/ProfileElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/ProfileElement.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt index 12c7b55fd7..96cc274dd4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/ProfileElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt @@ -1,13 +1,12 @@ -package info.nightscout.androidaps.plugins.general.tidepool.elements +package info.nightscout.androidaps.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.general.tidepool.comm.TidepoolUploader +import info.nightscout.androidaps.plugins.sync.tidepool.comm.TidepoolUploader import info.nightscout.androidaps.utils.DateUtil import java.util.* -import kotlin.collections.ArrayList 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/general/tidepool/elements/SensorGlucoseElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/SensorGlucoseElement.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt index cd9538018a..757a12ce39 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/SensorGlucoseElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.elements +package info.nightscout.androidaps.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.database.entities.GlucoseValue diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/WizardElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt similarity index 96% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/WizardElement.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt index a6615e45a3..c2e1b724f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/elements/WizardElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.elements +package info.nightscout.androidaps.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.database.entities.Bolus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt similarity index 90% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolStatus.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt index a3abc3f8ed..7addb83399 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolStatus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolStatus.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.events +package info.nightscout.androidaps.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/general/tidepool/events/EventTidepoolUpdateGUI.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt similarity index 54% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolUpdateGUI.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt index 5e4f76717e..7e6e2b796b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/events/EventTidepoolUpdateGUI.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/events/EventTidepoolUpdateGUI.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.events +package info.nightscout.androidaps.plugins.sync.tidepool.events import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthReplyMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt similarity index 89% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthReplyMessage.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt index 57fa45c691..99edf8eeed 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthReplyMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.messages +package info.nightscout.androidaps.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/general/tidepool/messages/AuthRequestMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt similarity index 88% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthRequestMessage.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt index 9c7c191864..afa62e5894 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthRequestMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/AuthRequestMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.messages +package info.nightscout.androidaps.plugins.sync.tidepool.messages import info.nightscout.androidaps.R import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/BaseMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/BaseMessage.kt similarity index 72% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/BaseMessage.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/BaseMessage.kt index d9dfc97b38..b3ae854bf2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/BaseMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/BaseMessage.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.general.tidepool.messages +package info.nightscout.androidaps.plugins.sync.tidepool.messages -import info.nightscout.androidaps.plugins.general.tidepool.utils.GsonInstance +import info.nightscout.androidaps.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/general/tidepool/messages/CloseDatasetRequestMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt similarity index 67% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/CloseDatasetRequestMessage.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt index f8f6780971..3bc3f5b670 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/CloseDatasetRequestMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/CloseDatasetRequestMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.messages +package info.nightscout.androidaps.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/DatasetReplyMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt similarity index 94% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/DatasetReplyMessage.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt index 9db4595c16..295f917a24 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/DatasetReplyMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/DatasetReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.messages +package info.nightscout.androidaps.plugins.sync.tidepool.messages class DatasetReplyMessage { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt similarity index 91% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt index 631a0259bd..2de5434727 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.plugins.general.tidepool.messages +package info.nightscout.androidaps.plugins.sync.tidepool.messages import com.google.gson.annotations.Expose import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.plugins.general.tidepool.comm.TidepoolUploader +import info.nightscout.androidaps.plugins.sync.tidepool.comm.TidepoolUploader import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import java.util.* diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/UploadReplyMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt similarity index 52% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/UploadReplyMessage.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt index 2054eb237a..459c63ec6e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/UploadReplyMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/UploadReplyMessage.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.messages +package info.nightscout.androidaps.plugins.sync.tidepool.messages class UploadReplyMessage { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/utils/GsonInstance.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/GsonInstance.kt similarity index 85% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/utils/GsonInstance.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/GsonInstance.kt index 2c7ceb81d0..5c383f3440 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/utils/GsonInstance.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/GsonInstance.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.utils +package info.nightscout.androidaps.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/general/tidepool/utils/RateLimit.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt similarity index 93% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/utils/RateLimit.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt index 40480ec784..482c01797d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/utils/RateLimit.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.tidepool.utils +package info.nightscout.androidaps.plugins.sync.tidepool.utils import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T 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 6396ce66b4..6c5563fff4 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -16,12 +16,9 @@ import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.extensions.buildDeviceStatus import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction @@ -32,6 +29,9 @@ import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.extensions.buildDeviceStatus +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.logging.AAPSLogger 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 88a8d5b5ec..da21e80294 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -7,28 +7,23 @@ import android.net.Uri import android.provider.Settings import androidx.appcompat.app.AppCompatActivity import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.dialogs.ProfileSwitchDialog import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.AndroidPermission import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.ImportExportPrefs -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.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.general.nsclient.NSClientPlugin -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus 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 @@ -36,7 +31,6 @@ import info.nightscout.androidaps.setupwizard.elements.SWEditIntNumber import info.nightscout.androidaps.setupwizard.elements.SWEditNumber import info.nightscout.androidaps.setupwizard.elements.SWEditNumberWithUnits import info.nightscout.androidaps.setupwizard.elements.SWEditString -import info.nightscout.androidaps.setupwizard.elements.SWEditUrl import info.nightscout.androidaps.setupwizard.elements.SWFragment import info.nightscout.androidaps.setupwizard.elements.SWHtmlLink import info.nightscout.androidaps.setupwizard.elements.SWInfoText @@ -47,6 +41,10 @@ import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.utils.CryptoUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.isRunningTest +import info.nightscout.interfaces.AndroidPermission +import info.nightscout.interfaces.Config +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.rx.bus.RxBus @@ -68,7 +66,6 @@ class SWDefinition @Inject constructor( private val objectivesPlugin: ObjectivesPlugin, private val configBuilder: ConfigBuilder, private val loopPlugin: LoopPlugin, - private val nsClientPlugin: NSClientPlugin, private val importExportPrefs: ImportExportPrefs, private val androidPermission: AndroidPermission, private val cryptoUtil: CryptoUtil, @@ -89,167 +86,196 @@ class SWDefinition @Inject constructor( } private val screenSetupWizard = SWScreen(injector, R.string.nav_setupwizard) - .add(SWInfoText(injector) - .label(R.string.welcometosetupwizard)) + .add( + SWInfoText(injector) + .label(R.string.welcometosetupwizard) + ) private val screenEula = SWScreen(injector, R.string.end_user_license_agreement) .skippable(false) - .add(SWInfoText(injector) - .label(R.string.end_user_license_agreement_text)) + .add( + SWInfoText(injector) + .label(R.string.end_user_license_agreement_text) + ) .add(SWBreak(injector)) .add(SWButton(injector) - .text(R.string.end_user_license_agreement_i_understand) - .visibility { !sp.getBoolean(R.string.key_i_understand, false) } - .action { - sp.putBoolean(R.string.key_i_understand, true) - rxBus.send(EventSWUpdate(false)) - }) + .text(R.string.end_user_license_agreement_i_understand) + .visibility { !sp.getBoolean(R.string.key_i_understand, false) } + .action { + sp.putBoolean(R.string.key_i_understand, true) + rxBus.send(EventSWUpdate(false)) + }) .visibility { !sp.getBoolean(R.string.key_i_understand, false) } .validator { sp.getBoolean(R.string.key_i_understand, false) } private val screenUnits = SWScreen(injector, R.string.units) .skippable(false) - .add(SWRadioButton(injector) - .option(R.array.unitsArray, R.array.unitsValues) - .preferenceId(R.string.key_units).label(R.string.units) - .comment(R.string.setupwizard_units_prompt)) + .add( + SWRadioButton(injector) + .option(R.array.unitsArray, R.array.unitsValues) + .preferenceId(R.string.key_units).label(R.string.units) + .comment(R.string.setupwizard_units_prompt) + ) .validator { sp.contains(R.string.key_units) } private val displaySettings = SWScreen(injector, R.string.wear_display_settings) .skippable(false) - .add(SWEditNumberWithUnits(injector, Constants.LOW_MARK * Constants.MGDL_TO_MMOLL, 3.0, 8.0) - .preferenceId(R.string.key_low_mark) - .updateDelay(5) - .label(R.string.low_mark) - .comment(R.string.low_mark_comment)) + .add( + SWEditNumberWithUnits(injector, Constants.LOW_MARK * Constants.MGDL_TO_MMOLL, 3.0, 8.0) + .preferenceId(R.string.key_low_mark) + .updateDelay(5) + .label(R.string.low_mark) + .comment(R.string.low_mark_comment) + ) .add(SWBreak(injector)) - .add(SWEditNumberWithUnits(injector, Constants.HIGH_MARK * Constants.MGDL_TO_MMOLL, 5.0, 20.0) - .preferenceId(R.string.key_high_mark) - .updateDelay(5) - .label(R.string.high_mark) - .comment(R.string.high_mark_comment)) + .add( + SWEditNumberWithUnits(injector, Constants.HIGH_MARK * Constants.MGDL_TO_MMOLL, 5.0, 20.0) + .preferenceId(R.string.key_high_mark) + .updateDelay(5) + .label(R.string.high_mark) + .comment(R.string.high_mark_comment) + ) private val screenPermissionWindow = SWScreen(injector, R.string.permission) .skippable(false) - .add(SWInfoText(injector) - .label(rh.gs(R.string.need_system_window_permission))) + .add( + SWInfoText(injector) + .label(rh.gs(R.string.need_system_window_permission)) + ) .add(SWBreak(injector)) .add(SWButton(injector) - .text(R.string.askforpermission) - .visibility { !Settings.canDrawOverlays(activity) } - .action { activity.startActivity(Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + activity.packageName))) }) + .text(R.string.askforpermission) + .visibility { !Settings.canDrawOverlays(activity) } + .action { activity.startActivity(Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + activity.packageName))) }) .visibility { !Settings.canDrawOverlays(activity) } .validator { Settings.canDrawOverlays(activity) } private val screenPermissionBattery = SWScreen(injector, R.string.permission) .skippable(false) - .add(SWInfoText(injector) - .label(rh.gs(R.string.need_whitelisting, rh.gs(R.string.app_name)))) + .add( + SWInfoText(injector) + .label(rh.gs(R.string.need_whitelisting, rh.gs(R.string.app_name))) + ) .add(SWBreak(injector)) .add(SWButton(injector) - .text(R.string.askforpermission) - .visibility { androidPermission.permissionNotGranted(context, Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) } - .action { androidPermission.askForPermission(activity, Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) }) + .text(R.string.askforpermission) + .visibility { androidPermission.permissionNotGranted(context, Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) } + .action { androidPermission.askForPermission(activity, Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) }) .visibility { androidPermission.permissionNotGranted(activity, Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) } .validator { !androidPermission.permissionNotGranted(activity, Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) } private val screenPermissionBt = SWScreen(injector, R.string.permission) .skippable(false) - .add(SWInfoText(injector) - .label(rh.gs(R.string.need_location_permission))) + .add( + SWInfoText(injector) + .label(rh.gs(R.string.need_location_permission)) + ) .add(SWBreak(injector)) .add(SWButton(injector) - .text(R.string.askforpermission) - .visibility { androidPermission.permissionNotGranted(activity, Manifest.permission.ACCESS_FINE_LOCATION) } - .action { androidPermission.askForPermission(activity, Manifest.permission.ACCESS_FINE_LOCATION) }) + .text(R.string.askforpermission) + .visibility { androidPermission.permissionNotGranted(activity, Manifest.permission.ACCESS_FINE_LOCATION) } + .action { androidPermission.askForPermission(activity, Manifest.permission.ACCESS_FINE_LOCATION) }) .visibility { androidPermission.permissionNotGranted(activity, Manifest.permission.ACCESS_FINE_LOCATION) } .validator { !androidPermission.permissionNotGranted(activity, Manifest.permission.ACCESS_FINE_LOCATION) } private val screenPermissionStore = SWScreen(injector, R.string.permission) .skippable(false) - .add(SWInfoText(injector) - .label(rh.gs(R.string.need_storage_permission))) + .add( + SWInfoText(injector) + .label(rh.gs(R.string.need_storage_permission)) + ) .add(SWBreak(injector)) .add(SWButton(injector) - .text(R.string.askforpermission) - .visibility { androidPermission.permissionNotGranted(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) } - .action { androidPermission.askForPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) }) + .text(R.string.askforpermission) + .visibility { androidPermission.permissionNotGranted(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) } + .action { androidPermission.askForPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) }) .visibility { androidPermission.permissionNotGranted(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) } .validator { !androidPermission.permissionNotGranted(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) } private val screenImport = SWScreen(injector, R.string.nav_import) - .add(SWInfoText(injector) - .label(R.string.storedsettingsfound)) - .add(SWBreak(injector)) - .add(SWButton(injector) - .text(R.string.nav_import) - .action { importExportPrefs.importSharedPreferences(activity) }) - .visibility { importExportPrefs.prefsFileExists() && !androidPermission.permissionNotGranted(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) } - private val screenNsClient = SWScreen(injector, R.string.nsclientinternal_title) - .skippable(true) - .add(SWInfoText(injector) - .label(R.string.nsclientinfotext)) - .add(SWBreak(injector)) - .add(SWButton(injector) - .text(R.string.enable_nsclient) - .action { - configBuilder.performPluginSwitch(nsClientPlugin, true, PluginType.GENERAL) - rxBus.send(EventSWUpdate(true)) - } - .visibility { !nsClientPlugin.isEnabled() }) - .add(SWEditUrl(injector) - .preferenceId(R.string.key_nsclientinternal_url) - .updateDelay(5) - .label(R.string.nsclientinternal_url_title) - .comment(R.string.nsclientinternal_url_dialogmessage)) - .add(SWEditString(injector) - .validator { text: String -> text.length >= 12 } - .preferenceId(R.string.key_nsclientinternal_api_secret) - .updateDelay(5) - .label(R.string.nsclientinternal_secret_dialogtitle) - .comment(R.string.nsclientinternal_secret_dialogmessage)) - .add(SWBreak(injector)) - .add(SWEventListener(injector, EventNSClientStatus::class.java) - .label(R.string.status) - .initialStatus(nsClientPlugin.status) + .add( + SWInfoText(injector) + .label(R.string.storedsettingsfound) ) - .validator { nsClientPlugin.nsClientService?.isConnected == true && nsClientPlugin.nsClientService?.hasWriteAuth == true } - .visibility { !(nsClientPlugin.nsClientService?.isConnected == true && nsClientPlugin.nsClientService?.hasWriteAuth == true) } + .add(SWBreak(injector)) + .add(SWButton(injector) + .text(R.string.nav_import) + .action { importExportPrefs.importSharedPreferences(activity) }) + .visibility { importExportPrefs.prefsFileExists() && !androidPermission.permissionNotGranted(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE) } + private val screenNsClient = SWScreen(injector, R.string.configbuilder_sync) + .skippable(true) + .add( + SWPlugin(injector, this) + .option(PluginType.SYNC, R.string.configbuilder_sync_description) + .makeVisible(false) + .label(R.string.configbuilder_insulin) + ) + .add(SWBreak(injector)) + .add( + SWInfoText(injector) + .label(R.string.syncinfotext) + ) + .add(SWBreak(injector)) + .add( + SWEventListener(injector, EventNSClientStatus::class.java) + .label(R.string.status) + .initialStatus(activePlugin.firstActiveSync?.status ?: "") + ) + .validator { activePlugin.firstActiveSync?.connected == true && activePlugin.firstActiveSync?.hasWritePermission == true } private val screenPatientName = SWScreen(injector, R.string.patient_name) .skippable(true) - .add(SWInfoText(injector) - .label(R.string.patient_name_summary)) - .add(SWEditString(injector) - .validator(SWTextValidator(String::isNotEmpty)) - .preferenceId(R.string.key_patient_name)) + .add( + SWInfoText(injector) + .label(R.string.patient_name_summary) + ) + .add( + SWEditString(injector) + .validator(SWTextValidator(String::isNotEmpty)) + .preferenceId(R.string.key_patient_name) + ) private val privacy = SWScreen(injector, R.string.privacy_settings) .skippable(true) - .add(SWInfoText(injector) - .label(R.string.privacy_summary)) - .add(SWPreference(injector, this) - .option(R.xml.pref_datachoices) + .add( + SWInfoText(injector) + .label(R.string.privacy_summary) + ) + .add( + SWPreference(injector, this) + .option(R.xml.pref_datachoices) ) private val screenMasterPassword = SWScreen(injector, R.string.master_password) .skippable(false) - .add(SWInfoText(injector) - .label(R.string.master_password)) - .add(SWEditEncryptedPassword(injector, cryptoUtil) - .preferenceId(R.string.key_master_password)) + .add( + SWInfoText(injector) + .label(R.string.master_password) + ) + .add( + SWEditEncryptedPassword(injector, cryptoUtil) + .preferenceId(R.string.key_master_password) + ) .add(SWBreak(injector)) - .add(SWInfoText(injector) - .label(R.string.master_password_summary)) + .add( + SWInfoText(injector) + .label(R.string.master_password_summary) + ) .validator { !cryptoUtil.checkPassword("", sp.getString(R.string.key_master_password, "")) } private val screenAge = SWScreen(injector, R.string.patientage) .skippable(false) .add(SWBreak(injector)) - .add(SWRadioButton(injector) - .option(R.array.ageArray, R.array.ageValues) - .preferenceId(R.string.key_age) - .label(R.string.patientage) - .comment(R.string.patientage_summary)) + .add( + SWRadioButton(injector) + .option(R.array.ageArray, R.array.ageValues) + .preferenceId(R.string.key_age) + .label(R.string.patientage) + .comment(R.string.patientage_summary) + ) .add(SWBreak(injector)) - .add(SWEditNumber(injector, 3.0, 0.1, 25.0) - .preferenceId(R.string.key_treatmentssafety_maxbolus) - .updateDelay(5) - .label(R.string.treatmentssafety_maxbolus_title) - .comment(R.string.common_values)) - .add(SWEditIntNumber(injector, 48, 1, 100) - .preferenceId(R.string.key_treatmentssafety_maxcarbs) - .updateDelay(5) - .label(R.string.treatmentssafety_maxcarbs_title) - .comment(R.string.common_values)) + .add( + SWEditNumber(injector, 3.0, 0.1, 25.0) + .preferenceId(R.string.key_treatmentssafety_maxbolus) + .updateDelay(5) + .label(R.string.treatmentssafety_maxbolus_title) + .comment(R.string.common_values) + ) + .add( + SWEditIntNumber(injector, 48, 1, 100) + .preferenceId(R.string.key_treatmentssafety_maxcarbs) + .updateDelay(5) + .label(R.string.treatmentssafety_maxcarbs_title) + .comment(R.string.common_values) + ) .validator { sp.contains(R.string.key_age) && sp.getDouble(R.string.key_treatmentssafety_maxbolus, 0.0) > 0 @@ -257,23 +283,31 @@ class SWDefinition @Inject constructor( } private val screenInsulin = SWScreen(injector, R.string.configbuilder_insulin) .skippable(false) - .add(SWPlugin(injector, this) - .option(PluginType.INSULIN, R.string.configbuilder_insulin_description) - .makeVisible(false) - .label(R.string.configbuilder_insulin)) + .add( + SWPlugin(injector, this) + .option(PluginType.INSULIN, R.string.configbuilder_insulin_description) + .makeVisible(false) + .label(R.string.configbuilder_insulin) + ) .add(SWBreak(injector)) - .add(SWInfoText(injector) - .label(R.string.diawarning)) + .add( + SWInfoText(injector) + .label(R.string.diawarning) + ) private val screenBgSource = SWScreen(injector, R.string.configbuilder_bgsource) .skippable(false) - .add(SWPlugin(injector, this) - .option(PluginType.BGSOURCE, R.string.configbuilder_bgsource_description) - .label(R.string.configbuilder_bgsource)) + .add( + SWPlugin(injector, this) + .option(PluginType.BGSOURCE, R.string.configbuilder_bgsource_description) + .label(R.string.configbuilder_bgsource) + ) .add(SWBreak(injector)) private val screenLocalProfile = SWScreen(injector, R.string.localprofile) .skippable(false) - .add(SWFragment(injector, this) - .add(ProfileFragment())) + .add( + SWFragment(injector, this) + .add(ProfileFragment()) + ) .validator { profilePlugin.profile?.getDefaultProfile()?.let { ProfileSealed.Pure(it).isValid("StartupWizard", activePlugin.activePump, config, rh, rxBus, hardLimits, false).isValid } ?: false @@ -281,22 +315,26 @@ class SWDefinition @Inject constructor( .visibility { profilePlugin.isEnabled() } private val screenProfileSwitch = SWScreen(injector, R.string.careportal_profileswitch) .skippable(false) - .add(SWInfoText(injector) - .label(R.string.profileswitch_ismissing)) + .add( + SWInfoText(injector) + .label(R.string.profileswitch_ismissing) + ) .add(SWButton(injector) - .text(R.string.doprofileswitch) - .action { ProfileSwitchDialog().show(activity.supportFragmentManager, "ProfileSwitchDialog") }) + .text(R.string.doprofileswitch) + .action { ProfileSwitchDialog().show(activity.supportFragmentManager, "ProfileSwitchDialog") }) .validator { profileFunction.getRequestedProfile() != null } .visibility { profileFunction.getRequestedProfile() == null } private val screenPump = SWScreen(injector, R.string.configbuilder_pump) .skippable(false) - .add(SWPlugin(injector, this) - .option(PluginType.PUMP, R.string.configbuilder_pump_description) - .label(R.string.configbuilder_pump)) + .add( + SWPlugin(injector, this) + .option(PluginType.PUMP, R.string.configbuilder_pump_description) + .label(R.string.configbuilder_pump) + ) .add(SWBreak(injector)) .add(SWInfoText(injector) - .label(R.string.setupwizard_pump_pump_not_initialized) - .visibility { !isPumpInitialized() }) + .label(R.string.setupwizard_pump_pump_not_initialized) + .visibility { !isPumpInitialized() }) .add( // Omnipod Eros only SWInfoText(injector) .label(R.string.setupwizard_pump_waiting_for_riley_link_connection) @@ -309,15 +347,15 @@ class SWDefinition @Inject constructor( .label(R.string.setupwizard_pump_riley_link_status) .visibility { activePlugin.activePump is OmnipodErosPumpPlugin }) .add(SWButton(injector) - .text(R.string.readstatus) - .action { commandQueue.readStatus(rh.gs(R.string.clicked_connect_to_pump), null) } - .visibility { - // Hide for Omnipod, because as we don't require a Pod to be paired in the setup wizard, - // Getting the status might not be possible - activePlugin.activePump !is OmnipodErosPumpPlugin && activePlugin.activePump !is OmnipodDashPumpPlugin - }) + .text(R.string.readstatus) + .action { commandQueue.readStatus(rh.gs(R.string.clicked_connect_to_pump), null) } + .visibility { + // Hide for Omnipod, because as we don't require a Pod to be paired in the setup wizard, + // Getting the status might not be possible + activePlugin.activePump !is OmnipodErosPumpPlugin && activePlugin.activePump !is OmnipodDashPumpPlugin + }) .add(SWEventListener(injector, EventPumpStatusChanged::class.java) - .visibility { activePlugin.activePump !is OmnipodErosPumpPlugin && activePlugin.activePump !is OmnipodDashPumpPlugin }) + .visibility { activePlugin.activePump !is OmnipodErosPumpPlugin && activePlugin.activePump !is OmnipodDashPumpPlugin }) .validator { isPumpInitialized() } private fun isPumpInitialized(): Boolean { @@ -333,54 +371,74 @@ class SWDefinition @Inject constructor( private val screenAps = SWScreen(injector, R.string.configbuilder_aps) .skippable(false) - .add(SWInfoText(injector) - .label(R.string.setupwizard_aps_description)) + .add( + SWInfoText(injector) + .label(R.string.setupwizard_aps_description) + ) .add(SWBreak(injector)) - .add(SWPlugin(injector, this) - .option(PluginType.APS, R.string.configbuilder_aps_description) - .label(R.string.configbuilder_aps)) + .add( + SWPlugin(injector, this) + .option(PluginType.APS, R.string.configbuilder_aps_description) + .label(R.string.configbuilder_aps) + ) .add(SWBreak(injector)) - .add(SWHtmlLink(injector) - .label("https://openaps.readthedocs.io/en/latest/")) + .add( + SWHtmlLink(injector) + .label("https://openaps.readthedocs.io/en/latest/") + ) .add(SWBreak(injector)) private val screenApsMode = SWScreen(injector, R.string.apsmode_title) .skippable(false) - .add(SWRadioButton(injector) - .option(R.array.aps_modeArray, R.array.aps_modeValues) - .preferenceId(R.string.key_aps_mode).label(R.string.apsmode_title) - .comment(R.string.setupwizard_preferred_aps_mode)) + .add( + SWRadioButton(injector) + .option(R.array.aps_modeArray, R.array.aps_modeValues) + .preferenceId(R.string.key_aps_mode).label(R.string.apsmode_title) + .comment(R.string.setupwizard_preferred_aps_mode) + ) .validator { sp.contains(R.string.key_aps_mode) } private val screenLoop = SWScreen(injector, R.string.configbuilder_loop) .skippable(false) - .add(SWInfoText(injector) - .label(R.string.setupwizard_loop_description)) + .add( + SWInfoText(injector) + .label(R.string.setupwizard_loop_description) + ) .add(SWBreak(injector)) .add(SWButton(injector) - .text(R.string.enableloop) - .action { - configBuilder.performPluginSwitch(loopPlugin, true, PluginType.LOOP) - rxBus.send(EventSWUpdate(true)) - } - .visibility { !loopPlugin.isEnabled() }) + .text(R.string.enableloop) + .action { + configBuilder.performPluginSwitch(loopPlugin, true, PluginType.LOOP) + rxBus.send(EventSWUpdate(true)) + } + .visibility { !loopPlugin.isEnabled() }) .validator { loopPlugin.isEnabled() } .visibility { !loopPlugin.isEnabled() && config.APS } private val screenSensitivity = SWScreen(injector, R.string.configbuilder_sensitivity) .skippable(false) - .add(SWInfoText(injector) - .label(R.string.setupwizard_sensitivity_description)) - .add(SWHtmlLink(injector) - .label(R.string.setupwizard_sensitivity_url)) + .add( + SWInfoText(injector) + .label(R.string.setupwizard_sensitivity_description) + ) + .add( + SWHtmlLink(injector) + .label(R.string.setupwizard_sensitivity_url) + ) .add(SWBreak(injector)) - .add(SWPlugin(injector, this) - .option(PluginType.SENSITIVITY, R.string.configbuilder_sensitivity_description) - .label(R.string.configbuilder_sensitivity)) + .add( + SWPlugin(injector, this) + .option(PluginType.SENSITIVITY, R.string.configbuilder_sensitivity_description) + .label(R.string.configbuilder_sensitivity) + ) private val getScreenObjectives = SWScreen(injector, R.string.objectives) .skippable(false) - .add(SWInfoText(injector) - .label(R.string.startobjective)) + .add( + SWInfoText(injector) + .label(R.string.startobjective) + ) .add(SWBreak(injector)) - .add(SWFragment(injector, this) - .add(ObjectivesFragment())) + .add( + SWFragment(injector, this) + .add(ObjectivesFragment()) + ) .validator { objectivesPlugin.objectives[ObjectivesPlugin.FIRST_OBJECTIVE].isStarted } .visibility { !objectivesPlugin.objectives[ObjectivesPlugin.FIRST_OBJECTIVE].isStarted && config.APS } 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 db98314bb5..7431530e70 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt @@ -11,19 +11,19 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.databinding.ActivitySetupwizardBinding import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientStatus 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.profile.ProfilePlugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventProfileStoreChanged import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import kotlin.math.max import kotlin.math.min @@ -31,7 +31,6 @@ import kotlin.math.min class SetupWizardActivity : NoSplashAppCompatActivity() { @Inject lateinit var injector: HasAndroidInjector - @Inject lateinit var profilePlugin: ProfilePlugin @Inject lateinit var swDefinition: SWDefinition @Inject lateinit var sp: SP @Inject lateinit var fabricPrivacy: FabricPrivacy @@ -76,39 +75,33 @@ class SetupWizardActivity : NoSplashAppCompatActivity() { override fun onResume() { super.onResume() swDefinition.activity = this - disposable.add(rxBus + disposable += rxBus .toObservable(EventPumpStatusChanged::class.java) .observeOn(aapsSchedulers.main) .subscribe({ updateButtons() }, fabricPrivacy::logException) - ) - disposable.add(rxBus + disposable += rxBus .toObservable(EventRileyLinkDeviceStatusChange::class.java) .observeOn(aapsSchedulers.main) .subscribe({ updateButtons() }, fabricPrivacy::logException) - ) - disposable.add(rxBus + disposable += rxBus .toObservable(EventNSClientStatus::class.java) .observeOn(aapsSchedulers.main) .subscribe({ updateButtons() }, fabricPrivacy::logException) - ) - disposable.add(rxBus + disposable += rxBus .toObservable(EventProfileSwitchChanged::class.java) .observeOn(aapsSchedulers.main) .subscribe({ updateButtons() }, fabricPrivacy::logException) - ) - disposable.add(rxBus + disposable += rxBus .toObservable(EventProfileStoreChanged::class.java) .observeOn(aapsSchedulers.main) .subscribe({ updateButtons() }, fabricPrivacy::logException) - ) - disposable.add(rxBus + disposable += rxBus .toObservable(EventSWUpdate::class.java) .observeOn(aapsSchedulers.main) .subscribe({ event: EventSWUpdate -> - if (event.redraw) generateLayout() - updateButtons() - }, fabricPrivacy::logException) - ) + if (event.redraw) generateLayout() + updateButtons() + }, fabricPrivacy::logException) updateButtons() } diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt index 3fc9940884..0f9afd9240 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt @@ -60,7 +60,7 @@ class SWPlugin(injector: HasAndroidInjector, private val definition: SWDefinitio val p = pluginsInCategory[i] rdBtn.id = View.generateViewId() rdBtn.text = p.name - if (p.isEnabled(pType!!)) { + if (p.isEnabled()) { rdBtn.isChecked = true selectedPlugin = p } @@ -78,7 +78,7 @@ class SWPlugin(injector: HasAndroidInjector, private val definition: SWDefinitio val plugin = rb.tag as PluginBase plugin.setPluginEnabled(pType!!, rb.isChecked) plugin.setFragmentVisible(pType!!, rb.isChecked && makeVisible) - configBuilderPlugin.processOnEnabledCategoryChanged(plugin, pType) + configBuilderPlugin.processOnEnabledCategoryChanged(plugin, pType!!) configBuilderPlugin.storeSettings("SetupWizard") rxBus.send(EventConfigBuilderChange()) rxBus.send(EventSWUpdate(false)) diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/DeviceStatusExtension.kt b/app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/extensions/DeviceStatusExtension.kt rename to app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt index a7b12a061f..ffc3ddc8ac 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/DeviceStatusExtension.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.androidaps.utils.extensions import android.os.Build import info.nightscout.androidaps.database.entities.DeviceStatus 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 new file mode 100644 index 0000000000..f11572cfd1 --- /dev/null +++ b/app/src/main/java/info/nightscout/androidaps/utils/extensions/TherapyEventExtension.kt @@ -0,0 +1,12 @@ +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/utils/tabs/TabPageAdapter.kt b/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt index 2743c7f21c..90d3bd65bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt @@ -4,6 +4,7 @@ import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.viewpager2.adapter.FragmentStateAdapter import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.androidaps.interfaces.PluginFragment import java.util.* class TabPageAdapter(private val activity: AppCompatActivity) : FragmentStateAdapter(activity) { @@ -13,6 +14,7 @@ class TabPageAdapter(private val activity: AppCompatActivity) : FragmentStateAda override fun getItemCount(): Int = visibleFragmentList.size override fun createFragment(position: Int): Fragment = activity.supportFragmentManager.fragmentFactory.instantiate(ClassLoader.getSystemClassLoader(), visibleFragmentList[position].pluginDescription.fragmentClass ?: Fragment::class.java.name) + .also { if (it is PluginFragment) it.plugin = getPluginAt(position) } fun getPluginAt(position: Int): PluginBase = visibleFragmentList[position] 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 81fc9752dd..eb70bcc3e3 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt @@ -6,19 +6,19 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.database.AppRepository -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus 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.androidaps.utils.T +import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import java.util.Calendar import javax.inject.Inject @@ -36,7 +36,7 @@ class PreparePredictionsWorker( @Inject lateinit var repository: AppRepository @Inject lateinit var rxBus: RxBus @Inject lateinit var config: Config - @Inject lateinit var nsDeviceStatus: NSDeviceStatus + @Inject lateinit var processedDeviceStatusData: ProcessedDeviceStatusData @Inject lateinit var loop: Loop @Inject lateinit var overviewMenus: OverviewMenus @Inject lateinit var dataWorkerStorage: DataWorkerStorage @@ -56,7 +56,7 @@ class PreparePredictionsWorker( val data = dataWorkerStorage.pickupObject(inputData.getLong(DataWorkerStorage.STORE_KEY, -1)) as PreparePredictionsData? ?: return Result.failure(workDataOf("Error" to "missing input data")) - val apsResult = if (config.APS) loop.lastRun?.constraintsProcessed else nsDeviceStatus.getAPSResult(injector) + val apsResult = if (config.APS) loop.lastRun?.constraintsProcessed else processedDeviceStatusData.getAPSResult(injector) val predictionsAvailable = if (config.APS) loop.lastRun?.request?.hasPredictions == true else config.NSCLIENT val menuChartSettings = overviewMenus.setting // align to hours diff --git a/app/src/main/res/layout/ns_client_fragment.xml b/app/src/main/res/layout/ns_client_fragment.xml index 199f4075d8..91016d058e 100644 --- a/app/src/main/res/layout/ns_client_fragment.xml +++ b/app/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.general.nsclient.NSClientFragment"> + tools:context=".plugins.sync.nsShared.NSClientFragment"> protection absorption_category_settings ns_temporary_target_last_sync - temporary_target_new_data_id ns_glucose_value_last_sync - ns_glucose_value_new_data_id ns_food_last_sync ns_therapy_event_last_sync bolussnooze_dia_divisor @@ -45,14 +43,14 @@ ns_bolus_last_synced_id ns_device_status_last_synced_id ns_temporary_basal_last_synced_id - ns_temporary_basal_new_data_id ns_extended_bolus_last_synced_id - ns_extended_bolus_new_data_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] @@ -68,6 +66,7 @@ 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 @@ -111,6 +110,8 @@ Which APS algorithm should make therapy adjustments? General These are some general plugins you might find useful. + Synchronization + Data upload and synchronization plugins. Which constraints are applied? Constraints Loop @@ -236,6 +237,8 @@ Executing Virtual pump settings Upload status to NS + NSClientV3 + NSV3 NSClient NSCI URL: @@ -247,6 +250,9 @@ 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 @@ -438,7 +444,7 @@ Percentage calculation Loop enabled APS selected - NSClient has write permission + Synchronization service has write permission Closed mode enabled Maximal IOB set properly BG available from selected source @@ -584,7 +590,6 @@ Calculations included in the Wizard result: Display Settings General Settings - Enable NSClient Welcome to setup wizard. It will guide you through the setup process\n Read status Skip setup wizard @@ -592,7 +597,7 @@ startupwizard_processed Sensitivity plugin is used for sensitivity detection and COB calculation. For more info visit: https://androidaps.readthedocs.io/en/latest/Configuration/Sensitivity-detection-and-COB.html - NSClient handles connection to Nightscout. You can skip this part now but you will not be able to pass objectives until you set it up. + Synchronize data to the cloud. You can skip this part now but you will not be able to pass objectives until you set it up. Please remember: new insulin profiles require DIA at least 5h. DIA 5–6h on new profile is equal to DIA 3h on old insulin profiles. Select one from availables algorithms. They are sorted from oldest to newest. Newer algorithm is usually more powerful and more aggressive. Thus if you are new looper you may probably start with AMA and not with latest one. Do not forget to read the OpenAPS documentation and configure it before use. Please configure your RileyLink below. After selecting a RileyLink, it will be possible to continue setup once the RileyLink status is \"Connected\". This might take a minute.\n diff --git a/app/src/main/res/xml/pref_nsclientinternal.xml b/app/src/main/res/xml/pref_nsclientinternal.xml index bf7ef4678e..fff4e93e93 100644 --- a/app/src/main/res/xml/pref_nsclientinternal.xml +++ b/app/src/main/res/xml/pref_nsclientinternal.xml @@ -26,6 +26,15 @@ validate:minLength="12" validate:testType="minLength"/> + + diff --git a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 78bd435dc5..d3aeee31d2 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -6,7 +6,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InsulinConfiguration import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator 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 e160d208fa..ecf9dbe9ab 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -132,7 +132,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { insightDbHelper = InsightDbHelper(insightDatabaseDao) danaPump = DanaPump(aapsLogger, sp, dateUtil, injector) hardLimits = HardLimits(aapsLogger, rxBus, sp, rh, context, repository) - objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, rh, activePlugin, sp, config, dateUtil, uel) + objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, rh, activePlugin, sp, config) comboPlugin = ComboPlugin(injector, aapsLogger, rxBus, rh, profileFunction, sp, commandQueue, context, pumpSync, dateUtil, ruffyScripter) danaRPlugin = DanaRPlugin(injector, aapsLogger, aapsSchedulers, rxBus, context, rh, constraintChecker, activePlugin, sp, commandQueue, danaPump, dateUtil, fabricPrivacy, pumpSync) danaRSPlugin = diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt index 421635b0b6..da937f0aa9 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt @@ -7,10 +7,10 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before @@ -40,7 +40,7 @@ class ObjectivesPluginTest : TestBase() { } @Before fun prepareMock() { - objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, rh, activePlugin, sp, config, dateUtil, uel) + objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, rh, activePlugin, sp, config) objectivesPlugin.onStart() `when`(rh.gs(R.string.objectivenotstarted, 9)).thenReturn("Objective 9 not started") `when`(rh.gs(R.string.objectivenotstarted, 8)).thenReturn("Objective 8 not started") 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 4fa83a6062..581d87d18c 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 @@ -6,7 +6,7 @@ import info.nightscout.androidaps.TestBase import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus +import info.nightscout.androidaps.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.plugins.general.maintenance.LoggerUtils import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegateTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt similarity index 98% rename from app/src/test/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegateTest.kt rename to app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt index 0a98a6876d..cd70af2694 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegateTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.general.nsclient +package info.nightscout.androidaps.plugins.sync.nsclient import android.content.Context import info.nightscout.androidaps.R diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/tidepool/comm/SessionTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/SessionTest.kt similarity index 80% rename from app/src/test/java/info/nightscout/androidaps/plugins/general/tidepool/comm/SessionTest.kt rename to app/src/test/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/SessionTest.kt index f7af8d995b..4d9f61fbe0 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/tidepool/comm/SessionTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/SessionTest.kt @@ -1,12 +1,13 @@ -package info.nightscout.androidaps.plugins.general.tidepool.comm +package info.nightscout.androidaps.plugins.sync.tidepool.comm -import info.nightscout.androidaps.plugins.general.tidepool.messages.AuthReplyMessage -import info.nightscout.androidaps.plugins.general.tidepool.messages.DatasetReplyMessage +import info.nightscout.androidaps.plugins.sync.tidepool.messages.AuthReplyMessage +import info.nightscout.androidaps.plugins.sync.tidepool.messages.DatasetReplyMessage import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Test class SessionTest { + @Test fun populateBody() { val session = Session("", "", null) diff --git a/automation/build.gradle b/automation/build.gradle index 9e341a7efb..320fffc2b2 100644 --- a/automation/build.gradle +++ b/automation/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 869f17b626..edb91245cc 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile diff --git a/build.gradle b/build.gradle index 84bd819423..c4af65575f 100644 --- a/build.gradle +++ b/build.gradle @@ -26,6 +26,7 @@ buildscript { work_version = '2.7.1' tink_version = '1.5.0' json_version = '20220320' + serialization_version = '1.4.1' joda_version = '2.12.1' junit_version = '4.13.2' diff --git a/core/allopen_dependencies.gradle b/core/allopen_dependencies.gradle new file mode 100644 index 0000000000..002600b6c0 --- /dev/null +++ b/core/allopen_dependencies.gradle @@ -0,0 +1,4 @@ +allOpen { + // allows mocking for classes w/o directly opening them for release builds + annotation 'info.nightscout.androidaps.annotations.OpenForTesting' +} diff --git a/core/android_dependencies.gradle b/core/android_dependencies.gradle index 0997a3fcc9..43ea057c27 100644 --- a/core/android_dependencies.gradle +++ b/core/android_dependencies.gradle @@ -19,10 +19,6 @@ android { debug { testCoverageEnabled(project.hasProperty('coverage')) } -// firebaseDisable { -// System.setProperty("disableFirebase", "true") -// ext.enableCrashlytics = false -// } } sourceSets { diff --git a/core/android_module_dependencies.gradle b/core/android_module_dependencies.gradle index ffe86f3cc1..bcc7585a61 100644 --- a/core/android_module_dependencies.gradle +++ b/core/android_module_dependencies.gradle @@ -40,8 +40,3 @@ dependencies { implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" } - -allOpen { - // allows mocking for classes w/o directly opening them for release builds - annotation 'info.nightscout.androidaps.annotations.OpenForTesting' -} diff --git a/core/build.gradle b/core/build.gradle index 65c02d25e4..9e6e9006c2 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,13 +1,16 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-parcelize' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-parcelize' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: 'core_dependencies.gradle' apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt index 2c22ed8729..e91acf1be7 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt @@ -9,22 +9,22 @@ import android.view.Window import android.view.WindowManager import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.core.R import info.nightscout.androidaps.core.databinding.DialogProfileviewerBinding import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.extensions.getCustomizedName -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.androidaps.utils.extensions.getCustomizedName +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.bus.RxBus import org.json.JSONObject @@ -63,8 +63,10 @@ class ProfileViewerDialog : DaggerDialogFragment() { // onDestroyView. private val binding get() = _binding!! - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { // load data from bundle (savedInstanceState ?: arguments)?.let { bundle -> time = bundle.getLong("time", 0) @@ -107,8 +109,8 @@ class ProfileViewerDialog : DaggerDialogFragment() { binding.datelayout.visibility = View.VISIBLE } - Mode.CUSTOM_PROFILE -> { - profile = pureProfileFromJson(JSONObject(customProfileJson), dateUtil)?.let { ProfileSealed.Pure(it)} + Mode.CUSTOM_PROFILE -> { + profile = pureProfileFromJson(JSONObject(customProfileJson), dateUtil)?.let { ProfileSealed.Pure(it) } profile2 = null profileName = customProfileName date = "" @@ -116,15 +118,15 @@ class ProfileViewerDialog : DaggerDialogFragment() { } Mode.PROFILE_COMPARE -> { - profile = pureProfileFromJson(JSONObject(customProfileJson), dateUtil)?.let { ProfileSealed.Pure(it)} - profile2 = pureProfileFromJson(JSONObject(customProfileJson2), dateUtil)?.let { ProfileSealed.Pure(it)} + profile = pureProfileFromJson(JSONObject(customProfileJson), dateUtil)?.let { ProfileSealed.Pure(it) } + profile2 = pureProfileFromJson(JSONObject(customProfileJson2), dateUtil)?.let { ProfileSealed.Pure(it) } profileName = customProfileName binding.headerIcon.setImageResource(R.drawable.ic_compare_profiles) date = "" binding.datelayout.visibility = View.GONE } - Mode.DB_PROFILE -> { + Mode.DB_PROFILE -> { //val profileList = databaseHelper.getProfileSwitchData(time, true) val profileList = repository.getAllProfileSwitches().blockingGet() profile = if (profileList.isNotEmpty()) ProfileSealed.PS(profileList[0]) else null @@ -237,12 +239,15 @@ class ProfileViewerDialog : DaggerDialogFragment() { prev1 = val1 prev2 = val2 } - s.append(formatColors( - " ∑ ", - profile1.baseBasalSum(), - profile2.baseBasalSum(), - DecimalFormat("0.00"), - rh.gs(R.string.insulin_unit_shortname))) + s.append( + formatColors( + " ∑ ", + profile1.baseBasalSum(), + profile2.baseBasalSum(), + DecimalFormat("0.00"), + rh.gs(R.string.insulin_unit_shortname) + ) + ) return HtmlHelper.fromHtml(s.toString()) } @@ -293,8 +298,18 @@ class ProfileViewerDialog : DaggerDialogFragment() { val val1h = profile1.getTargetHighMgdlTimeFromMidnight(hour * 60 * 60) val val2l = profile2.getTargetLowMgdlTimeFromMidnight(hour * 60 * 60) val val2h = profile2.getTargetHighMgdlTimeFromMidnight(hour * 60 * 60) - val txt1 = dateUtil.formatHHMM(hour * 60 * 60) + " " + Profile.toUnitsString(val1l, val1l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString(val1h, val1h * Constants.MGDL_TO_MMOLL, units) + " " + units.asText - val txt2 = dateUtil.formatHHMM(hour * 60 * 60) + " " + Profile.toUnitsString(val2l, val2l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString(val2h, val2h * Constants.MGDL_TO_MMOLL, units) + " " + units.asText + val txt1 = + dateUtil.formatHHMM(hour * 60 * 60) + " " + Profile.toUnitsString(val1l, val1l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString( + val1h, + val1h * Constants.MGDL_TO_MMOLL, + units + ) + " " + units.asText + val txt2 = + dateUtil.formatHHMM(hour * 60 * 60) + " " + Profile.toUnitsString(val2l, val2l * Constants.MGDL_TO_MMOLL, units) + " - " + Profile.toUnitsString( + val2h, + val2h * Constants.MGDL_TO_MMOLL, + units + ) + " " + units.asText if (val1l != prev1l || val1h != prev1h || val2l != prev2l || val2h != prev2h) { s.append(formatColors(txt1, txt2)) s.append("
") diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt index f50728ad3b..9727aa143f 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt @@ -21,61 +21,4 @@ fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob { fun Bolus.iobCalc(time: Long, localInsulin: LocalInsulin): Iob { if (!isValid || type == Bolus.Type.PRIMING ) return Iob() return localInsulin.iobCalcForTreatment(this, time) -} - -fun Bolus.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = - JSONObject() - .put("eventType", if (type == Bolus.Type.SMB) TherapyEvent.Type.CORRECTION_BOLUS.text else TherapyEvent.Type.MEAL_BOLUS.text) - .put("insulin", amount) - .put("created_at", dateUtil.toISOString(timestamp)) - .put("date", timestamp) - .put("type", type.name) - .put("notes", notes) - .put("isValid", isValid) - .put("isSMB", type == Bolus.Type.SMB).also { - if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) - if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) - if (interfaceIDs.pumpSerial != null) it.put("pumpSerial", interfaceIDs.pumpSerial) - if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) - } - -/* - create fake object with nsID and isValid == false - */ -fun bolusFromNsIdForInvalidating(nsId: String): Bolus = - bolusFromJson( - JSONObject() - .put("mills", 1) - .put("insulin", -1.0) - .put("_id", nsId) - .put("isValid", false) - )!! - -fun bolusFromJson(jsonObject: JSONObject): Bolus? { - val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null - val amount = JsonHelper.safeGetDoubleAllowNull(jsonObject, "insulin") ?: return null - val type = Bolus.Type.fromString(JsonHelper.safeGetString(jsonObject, "type")) - val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) - val notes = JsonHelper.safeGetStringAllowNull(jsonObject, "notes", null) - val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null - val pumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "pumpId", null) - val pumpType = InterfaceIDs.PumpType.fromString(JsonHelper.safeGetStringAllowNull(jsonObject, "pumpType", null)) - val pumpSerial = JsonHelper.safeGetStringAllowNull(jsonObject, "pumpSerial", null) - - if (timestamp == 0L) return null - if (amount == 0.0) return null - - return Bolus( - timestamp = timestamp, - amount = amount, - type = type, - notes = notes, - isValid = isValid, - ).also { - it.interfaceIDs.nightscoutId = id - it.interfaceIDs.pumpId = pumpId - it.interfaceIDs.pumpType = pumpType - it.interfaceIDs.pumpSerial = pumpSerial - } -} - +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt index 5cc69e1968..daf803471a 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt @@ -1,20 +1,16 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.ExtendedBolus import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.interfaces.Insulin +import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.androidaps.utils.T -import org.json.JSONObject import kotlin.math.ceil import kotlin.math.max import kotlin.math.min @@ -50,84 +46,6 @@ fun ExtendedBolus.toTemporaryBasal(profile: Profile): TemporaryBasal = type = TemporaryBasal.Type.FAKE_EXTENDED ) -fun ExtendedBolus.toJson(isAdd: Boolean, profile: Profile, dateUtil: DateUtil): JSONObject = - if (isEmulatingTempBasal) - toTemporaryBasal(profile) - .toJson(isAdd, profile, dateUtil) - .put("extendedEmulated", toRealJson(isAdd, dateUtil)) - else toRealJson(isAdd, dateUtil) - -fun ExtendedBolus.toRealJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = - JSONObject() - .put("created_at", dateUtil.toISOString(timestamp)) - .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", TherapyEvent.Type.COMBO_BOLUS.text) - .put("duration", T.msecs(duration).mins()) - .put("durationInMilliseconds", duration) - .put("splitNow", 0) - .put("splitExt", 100) - .put("enteredinsulin", amount) - .put("relative", rate) - .put("isValid", isValid) - .put("isEmulatingTempBasal", isEmulatingTempBasal) - .also { - if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) - if (interfaceIDs.endId != null) it.put("endId", interfaceIDs.endId) - if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) - if (interfaceIDs.pumpSerial != null) it.put("pumpSerial", interfaceIDs.pumpSerial) - if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) - } - -/* - create fake object with nsID and isValid == false - */ -fun extendedBolusFromNsIdForInvalidating(nsId: String): ExtendedBolus = - extendedBolusFromJson( - JSONObject() - .put("mills", 1) - .put("amount", -1.0) - .put("enteredinsulin", -1.0) - .put("duration", -1.0) - .put("splitNow", 0) - .put("splitExt", 100) - .put("_id", nsId) - .put("isValid", false) - )!! - -fun extendedBolusFromJson(jsonObject: JSONObject): ExtendedBolus? { - val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null - if (JsonHelper.safeGetIntAllowNull(jsonObject, "splitNow") != 0) return null - if (JsonHelper.safeGetIntAllowNull(jsonObject, "splitExt") != 100) return null - val amount = JsonHelper.safeGetDoubleAllowNull(jsonObject, "enteredinsulin") ?: return null - val duration = JsonHelper.safeGetLongAllowNull(jsonObject, "duration") ?: return null - val durationInMilliseconds = JsonHelper.safeGetLongAllowNull(jsonObject, "durationInMilliseconds") - val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) - val isEmulatingTempBasal = JsonHelper.safeGetBoolean(jsonObject, "isEmulatingTempBasal", false) - val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null - val pumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "pumpId", null) - val endPumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "endId", null) - val pumpType = InterfaceIDs.PumpType.fromString(JsonHelper.safeGetStringAllowNull(jsonObject, "pumpType", null)) - val pumpSerial = JsonHelper.safeGetStringAllowNull(jsonObject, "pumpSerial", null) - - if (timestamp == 0L) return null - if (duration == 0L && durationInMilliseconds == 0L) return null - if (amount == 0.0) return null - - return ExtendedBolus( - timestamp = timestamp, - amount = amount, - duration = durationInMilliseconds ?: T.mins(duration).msecs(), - isEmulatingTempBasal = isEmulatingTempBasal, - isValid = isValid - ).also { - it.interfaceIDs.nightscoutId = id - it.interfaceIDs.pumpId = pumpId - it.interfaceIDs.endId = endPumpId - it.interfaceIDs.pumpType = pumpType - it.interfaceIDs.pumpSerial = pumpSerial - } -} - fun ExtendedBolus.iobCalc(time: Long, profile: Profile, insulinInterface: Insulin): IobTotal { val result = IobTotal(time) val realDuration = getPassedDurationToTimeInMinutes(time) @@ -156,7 +74,15 @@ fun ExtendedBolus.iobCalc(time: Long, profile: Profile, insulinInterface: Insuli return result } -fun ExtendedBolus.iobCalc(time: Long, profile: Profile, lastAutosensResult: AutosensResult, exercise_mode: Boolean, half_basal_exercise_target: Int, isTempTarget: Boolean, insulinInterface: Insulin): IobTotal { +fun ExtendedBolus.iobCalc( + time: Long, + profile: Profile, + lastAutosensResult: AutosensResult, + exercise_mode: Boolean, + half_basal_exercise_target: Int, + isTempTarget: Boolean, + insulinInterface: Insulin +): IobTotal { val result = IobTotal(time) val realDuration = getPassedDurationToTimeInMinutes(time) var sensitivityRatio = lastAutosensResult.ratio diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt index cf03d76f96..c4f297fc20 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt @@ -1,19 +1,18 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.androidaps.utils.extensions import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.ProfileSwitch -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.extensions.blockFromJsonArray +import info.nightscout.androidaps.extensions.targetBlockFromJsonArray import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.androidaps.utils.T import org.json.JSONObject -import java.util.* +import java.util.TimeZone fun List.isPSEvent5minBack(time: Long): Boolean { for (event in this) { @@ -27,88 +26,23 @@ fun List.isPSEvent5minBack(time: Long): Boolean { return false } -fun ProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = - JSONObject() - .put("timeshift", timeshift) - .put("percentage", percentage) - .put("duration", T.msecs(duration).mins()) - .put("profile", getCustomizedName()) - .put("originalProfileName", profileName) - .put("originalDuration", duration) - .put("created_at", dateUtil.toISOString(timestamp)) - .put("enteredBy", "openaps://" + "AndroidAPS") - .put("isValid", isValid) - .put("eventType", TherapyEvent.Type.PROFILE_SWITCH.text) - .also { // remove customization to store original profileJson in toPureNsJson call - timeshift = 0 - percentage = 100 - } - .put("profileJson", ProfileSealed.PS(this).toPureNsJson(dateUtil).toString()) - .also { - if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) - if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) - if (interfaceIDs.pumpSerial != null) it.put("pumpSerial", interfaceIDs.pumpSerial) - if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) - } - -/* NS PS -{ - "_id":"608ffa268db0676196a772d7", - "enteredBy":"undefined", - "eventType":"Profile Switch", - "duration":10, - "profile":"LocalProfile0", - "created_at":"2021-05-03T13:26:58.537Z", - "utcOffset":0, - "mills":1620048418537, - "mgdl":98 -} - */ -fun profileSwitchFromJson(jsonObject: JSONObject, dateUtil: DateUtil, activePlugin: ActivePlugin): ProfileSwitch? { - val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null - val duration = JsonHelper.safeGetLong(jsonObject, "duration") - val originalDuration = JsonHelper.safeGetLongAllowNull(jsonObject, "originalDuration") - val timeshift = JsonHelper.safeGetLong(jsonObject, "timeshift") - val percentage = JsonHelper.safeGetInt(jsonObject, "percentage", 100) - val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) - val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) - val profileName = JsonHelper.safeGetStringAllowNull(jsonObject, "profile", null) ?: return null - val originalProfileName = JsonHelper.safeGetStringAllowNull(jsonObject, "originalProfileName", null) - val profileJson = JsonHelper.safeGetStringAllowNull(jsonObject, "profileJson", null) - val pumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "pumpId", null) - val pumpType = InterfaceIDs.PumpType.fromString(JsonHelper.safeGetStringAllowNull(jsonObject, "pumpType", null)) - val pumpSerial = JsonHelper.safeGetStringAllowNull(jsonObject, "pumpSerial", null) - - if (timestamp == 0L) return null - val pureProfile = - if (profileJson == null) { // entered through NS, no JSON attached - val profilePlugin = activePlugin.activeProfileSource - val store = profilePlugin.profile ?: return null - store.getSpecificProfile(profileName) ?: return null - } else pureProfileFromJson(JSONObject(profileJson), dateUtil) ?: return null - val profileSealed = ProfileSealed.Pure(pureProfile) - - return ProfileSwitch( - timestamp = timestamp, - basalBlocks = profileSealed.basalBlocks, - isfBlocks = profileSealed.isfBlocks, - icBlocks = profileSealed.icBlocks, - targetBlocks = profileSealed.targetBlocks, - glucoseUnit = ProfileSwitch.GlucoseUnit.fromConstant(profileSealed.units), - profileName = originalProfileName ?: profileName, - timeshift = timeshift, - percentage = percentage, - duration = originalDuration ?: T.mins(duration).msecs(), - insulinConfiguration = profileSealed.insulinConfiguration, - isValid = isValid - ).also { - it.interfaceIDs.nightscoutId = id - it.interfaceIDs.pumpId = pumpId - it.interfaceIDs.pumpType = pumpType - it.interfaceIDs.pumpSerial = pumpSerial +fun ProfileSwitch.getCustomizedName(): String { + var name: String = profileName + if (Constants.LOCAL_PROFILE == name) { + name = to2Decimal(ProfileSealed.PS(this).percentageBasalSum()) + "U " } + if (timeshift != 0L || percentage != 100) { + name += "($percentage%" + if (timeshift != 0L) name += "," + T.msecs(timeshift).hours() + "h" + name += ")" + } + return name } +fun ProfileSwitch.GlucoseUnit.Companion.fromConstant(units: GlucoseUnit): ProfileSwitch.GlucoseUnit = + if (units == GlucoseUnit.MGDL) ProfileSwitch.GlucoseUnit.MGDL + else ProfileSwitch.GlucoseUnit.MMOL + /** * Pure profile doesn't contain timestamp, percentage, timeshift, profileName */ @@ -140,21 +74,4 @@ fun pureProfileFromJson(jsonObject: JSONObject, dateUtil: DateUtil, defaultUnits } catch (ignored: Exception) { return null } -} - -fun ProfileSwitch.getCustomizedName(): String { - var name: String = profileName - if (Constants.LOCAL_PROFILE == name) { - name = to2Decimal(ProfileSealed.PS(this).percentageBasalSum()) + "U " - } - if (timeshift != 0L || percentage != 100) { - name += "($percentage%" - if (timeshift != 0L) name += "," + T.msecs(timeshift).hours() + "h" - name += ")" - } - return name -} - -fun ProfileSwitch.GlucoseUnit.Companion.fromConstant(units: GlucoseUnit): ProfileSwitch.GlucoseUnit = - if (units == GlucoseUnit.MGDL) ProfileSwitch.GlucoseUnit.MGDL - else ProfileSwitch.GlucoseUnit.MMOL +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt index f6101e576b..e06ff75f4b 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt @@ -1,21 +1,16 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TemporaryBasal.Type.Companion.fromString -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.interfaces.Insulin +import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.androidaps.utils.T -import org.json.JSONObject import kotlin.math.ceil import kotlin.math.max import kotlin.math.min @@ -62,69 +57,6 @@ fun TemporaryBasal.toStringFull(profile: Profile, dateUtil: DateUtil): String { } } -fun TemporaryBasal.toJson(isAdd: Boolean, profile: Profile, dateUtil: DateUtil): JSONObject = - JSONObject() - .put("created_at", dateUtil.toISOString(timestamp)) - .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", TherapyEvent.Type.TEMPORARY_BASAL.text) - .put("isValid", isValid) - .put("duration", T.msecs(duration).mins()) - .put("durationInMilliseconds", duration) // rounded duration leads to different basal IOB - .put("type", type.name) - .put("rate", convertedToAbsolute(timestamp, profile)) // generated by OpenAPS, for compatibility - .also { - if (isAbsolute) it.put("absolute", rate) - else it.put("percent", rate - 100) - if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) - if (interfaceIDs.endId != null) it.put("endId", interfaceIDs.endId) - if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) - if (interfaceIDs.pumpSerial != null) it.put("pumpSerial", interfaceIDs.pumpSerial) - if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) - } - -@Suppress("IfThenToElvis", "CascadeIf") -fun temporaryBasalFromJson(jsonObject: JSONObject): TemporaryBasal? { - val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null - val percent = JsonHelper.safeGetDoubleAllowNull(jsonObject, "percent") - val absolute = JsonHelper.safeGetDoubleAllowNull(jsonObject, "absolute") - val duration = JsonHelper.safeGetLongAllowNull(jsonObject, "duration") ?: return null - val durationInMilliseconds = JsonHelper.safeGetLongAllowNull(jsonObject, "durationInMilliseconds") - val type = fromString(JsonHelper.safeGetString(jsonObject, "type")) - val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) - val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null - val pumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "pumpId", null) - val endPumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "endId", null) - val pumpType = InterfaceIDs.PumpType.fromString(JsonHelper.safeGetStringAllowNull(jsonObject, "pumpType", null)) - val pumpSerial = JsonHelper.safeGetStringAllowNull(jsonObject, "pumpSerial", null) - - val rate: Double - val isAbsolute: Boolean - if (absolute != null) { - rate = absolute - isAbsolute = true - } else if (percent != null) { - rate = percent + 100 - isAbsolute = false - } else return null - if (duration == 0L && durationInMilliseconds == null) return null - if (timestamp == 0L) return null - - return TemporaryBasal( - timestamp = timestamp, - rate = rate, - duration = durationInMilliseconds ?: T.mins(duration).msecs(), - type = type, - isAbsolute = isAbsolute, - isValid = isValid - ).also { - it.interfaceIDs.nightscoutId = id - it.interfaceIDs.pumpId = pumpId - it.interfaceIDs.endId = endPumpId - it.interfaceIDs.pumpType = pumpType - it.interfaceIDs.pumpSerial = pumpSerial - } -} - fun TemporaryBasal.toStringShort(): String = if (isAbsolute || type == TemporaryBasal.Type.FAKE_EXTENDED) to2Decimal(rate) + "U/h" else "${to0Decimal(rate)}%" diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt index ae7a846565..4a221c85bc 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt @@ -1,17 +1,13 @@ package info.nightscout.androidaps.extensions -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.androidaps.utils.T -import info.nightscout.androidaps.interfaces.ResourceHelper -import org.json.JSONObject +import info.nightscout.interfaces.Constants import java.util.concurrent.TimeUnit fun TemporaryTarget.isInProgress(dateUtil: DateUtil): Boolean = @@ -32,71 +28,3 @@ fun TemporaryTarget.friendlyDescription(units: GlucoseUnit, rh: ResourceHelper): Profile.toTargetRangeString(lowTarget, highTarget, GlucoseUnit.MGDL, units) + units.asText + "@" + rh.gs(R.string.format_mins, TimeUnit.MILLISECONDS.toMinutes(duration)) + "(" + reason.text + ")" - -/* - create fake object with nsID and isValid == false - */ -fun temporaryTargetFromNsIdForInvalidating(nsId: String): TemporaryTarget = - temporaryTargetFromJson( - JSONObject() - .put("mills", 1) - .put("duration", -1) - .put("reason", "fake") - .put("_id", nsId) - .put("isValid", false) - )!! - -fun temporaryTargetFromJson(jsonObject: JSONObject): TemporaryTarget? { - val units = GlucoseUnit.fromText(JsonHelper.safeGetString(jsonObject, "units", Constants.MGDL)) - val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null - val duration = JsonHelper.safeGetLongAllowNull(jsonObject, "duration", null) ?: return null - val durationInMilliseconds = JsonHelper.safeGetLongAllowNull(jsonObject, "durationInMilliseconds") - var low = JsonHelper.safeGetDouble(jsonObject, "targetBottom") - low = Profile.toMgdl(low, units) - var high = JsonHelper.safeGetDouble(jsonObject, "targetTop") - high = Profile.toMgdl(high, units) - val reasonString = if (duration != 0L) JsonHelper.safeGetStringAllowNull(jsonObject, "reason", null) - ?: return null else "" - // this string can be localized from NS, it will not work in this case CUSTOM will be used - val reason = TemporaryTarget.Reason.fromString(reasonString) - val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null - val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) - - if (timestamp == 0L) return null - - if (duration > 0L) { - // not ending event - if (low < Constants.MIN_TT_MGDL) return null - if (low > Constants.MAX_TT_MGDL) return null - if (high < Constants.MIN_TT_MGDL) return null - if (high > Constants.MAX_TT_MGDL) return null - if (low > high) return null - } - val tt = TemporaryTarget( - timestamp = timestamp, - duration = durationInMilliseconds ?: T.mins(duration).msecs(), - reason = reason, - lowTarget = low, - highTarget = high, - isValid = isValid - ) - tt.interfaceIDs.nightscoutId = id - return tt -} - -fun TemporaryTarget.toJson(isAdd: Boolean, units: GlucoseUnit, dateUtil: DateUtil): JSONObject = - JSONObject() - .put("eventType", TherapyEvent.Type.TEMPORARY_TARGET.text) - .put("duration", T.msecs(duration).mins()) - .put("durationInMilliseconds", duration) - .put("isValid", isValid) - .put("created_at", dateUtil.toISOString(timestamp)) - .put("timestamp", timestamp) - .put("enteredBy", "AndroidAPS").also { - if (lowTarget > 0) it - .put("reason", reason.text) - .put("targetBottom", Profile.fromMgdlToUnits(lowTarget, units)) - .put("targetTop", Profile.fromMgdlToUnits(highTarget, units)) - .put("units", units.asText) - if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) - } diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt index 50bb28ca31..18350b849d 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt @@ -1,27 +1,7 @@ package info.nightscout.androidaps.extensions -import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.nsclient.data.NSMbg -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.androidaps.utils.T -import org.json.JSONObject -import java.util.concurrent.TimeUnit - -fun TherapyEvent.age(useShortText: Boolean, rh: ResourceHelper, dateUtil: DateUtil): String { - val diff = dateUtil.computeDiff(timestamp, System.currentTimeMillis()) - var days = " " + rh.gs(R.string.days) + " " - var hours = " " + rh.gs(R.string.hours) + " " - if (useShortText) { - days = rh.gs(R.string.shortday) - hours = rh.gs(R.string.shorthour) - } - return diff[TimeUnit.DAYS].toString() + days + diff[TimeUnit.HOURS] + hours -} fun TherapyEvent.isOlderThan(hours: Double): Boolean { return getHoursFromStart() > hours @@ -31,81 +11,6 @@ fun TherapyEvent.getHoursFromStart(): Double { return (System.currentTimeMillis() - timestamp) / (60 * 60 * 1000.0) } -fun TherapyEvent.GlucoseUnit.toMainUnit(): GlucoseUnit = - if (this == TherapyEvent.GlucoseUnit.MGDL) GlucoseUnit.MGDL - else GlucoseUnit.MMOL - fun TherapyEvent.GlucoseUnit.Companion.fromConstant(units: GlucoseUnit): TherapyEvent.GlucoseUnit = if (units == GlucoseUnit.MGDL) TherapyEvent.GlucoseUnit.MGDL else TherapyEvent.GlucoseUnit.MMOL - -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 - ) -//.also { -// it.interfaceIDs.nightscoutId = mbg.id() // id will be different in treatments collection -//} - -/* - create fake object with nsID and isValid == false - */ - -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 - val type = TherapyEvent.Type.fromString(JsonHelper.safeGetString(jsonObject, "eventType", TherapyEvent.Type.NONE.text)) - val duration = JsonHelper.safeGetLong(jsonObject, "duration") - val durationInMilliseconds = JsonHelper.safeGetLongAllowNull(jsonObject, "durationInMilliseconds") - val glucose = JsonHelper.safeGetDoubleAllowNull(jsonObject, "glucose") - val glucoseType = TherapyEvent.MeterType.fromString(JsonHelper.safeGetString(jsonObject, "glucoseType")) - val enteredBy = JsonHelper.safeGetStringAllowNull(jsonObject, "enteredBy", null) - val note = JsonHelper.safeGetStringAllowNull(jsonObject, "notes", null) - val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null - val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) - - if (timestamp == 0L) return null - - val te = TherapyEvent( - timestamp = timestamp, - duration = durationInMilliseconds ?: T.mins(duration).msecs(), - glucoseUnit = glucoseUnit, - type = type, - glucose = glucose, - glucoseType = glucoseType, - enteredBy = enteredBy, - note = note, - isValid = isValid - ) - te.interfaceIDs.nightscoutId = id - return te -} - -fun TherapyEvent.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = - JSONObject() - .put("eventType", type.text) - .put("isValid", isValid) - .put("created_at", dateUtil.toISOString(timestamp)) - .put("enteredBy", enteredBy) - .put("units", if (glucoseUnit == TherapyEvent.GlucoseUnit.MGDL) Constants.MGDL else Constants.MMOL) - .also { - if (duration != 0L) it.put("duration", T.msecs(duration).mins()) - if (duration != 0L) it.put("durationInMilliseconds", duration) - if (note != null) it.put("notes", note) - if (glucose != null) it.put("glucose", glucose) - if (glucoseType != null) it.put("glucoseType", glucoseType!!.text) - if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) - if (type == TherapyEvent.Type.ANNOUNCEMENT) it.put("isAnnouncement", true) - } - -fun List.isTherapyEventEvent5minBack(time: Long): Boolean { - for (event in this) { - if (event.timestamp <= time && event.timestamp > time - T.mins(5).msecs()) { - return true - } - } - return false -} diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt index 55196b068b..5165d90c2d 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt @@ -60,6 +60,17 @@ interface ActivePlugin { */ val activeIobCobCalculator: IobCobCalculator + /** + * Currently selected NsClient plugin + */ + val activeNsClient: NsClient? + + /** + * Currently selected Sync plugin + */ + val firstActiveSync: Sync? + val activeSyncs: ArrayList + /** * List of all registered plugins */ diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt index 7e6c49a8d0..bf215d0229 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt @@ -29,22 +29,22 @@ interface DataSyncSelector { fun confirmLastBolusIdIfGreater(lastSynced: Long) fun changedBoluses() : List // Until NS v3 - fun processChangedBolusesCompat(): Boolean + fun processChangedBolusesCompat() fun confirmLastCarbsIdIfGreater(lastSynced: Long) fun changedCarbs() : List // Until NS v3 - fun processChangedCarbsCompat(): Boolean + fun processChangedCarbsCompat() fun confirmLastBolusCalculatorResultsIdIfGreater(lastSynced: Long) fun changedBolusCalculatorResults() : List // Until NS v3 - fun processChangedBolusCalculatorResultsCompat(): Boolean + fun processChangedBolusCalculatorResultsCompat() fun confirmLastTempTargetsIdIfGreater(lastSynced: Long) fun changedTempTargets() : List // Until NS v3 - fun processChangedTempTargetsCompat(): Boolean + fun processChangedTempTargetsCompat() fun confirmLastGlucoseValueIdIfGreater(lastSynced: Long) fun changedGlucoseValues() : List @@ -54,42 +54,42 @@ interface DataSyncSelector { fun confirmLastTherapyEventIdIfGreater(lastSynced: Long) fun changedTherapyEvents() : List // Until NS v3 - fun processChangedTherapyEventsCompat(): Boolean + fun processChangedTherapyEventsCompat() fun confirmLastFoodIdIfGreater(lastSynced: Long) fun changedFoods() : List // Until NS v3 - fun processChangedFoodsCompat(): Boolean + fun processChangedFoodsCompat() fun confirmLastDeviceStatusIdIfGreater(lastSynced: Long) fun changedDeviceStatuses() : List // Until NS v3 - fun processChangedDeviceStatusesCompat(): Boolean + fun processChangedDeviceStatusesCompat() fun confirmLastTemporaryBasalIdIfGreater(lastSynced: Long) fun changedTemporaryBasals() : List // Until NS v3 - fun processChangedTemporaryBasalsCompat(): Boolean + fun processChangedTemporaryBasalsCompat() fun confirmLastExtendedBolusIdIfGreater(lastSynced: Long) fun changedExtendedBoluses() : List // Until NS v3 - fun processChangedExtendedBolusesCompat(): Boolean + fun processChangedExtendedBolusesCompat() fun confirmLastProfileSwitchIdIfGreater(lastSynced: Long) fun changedProfileSwitch() : List // Until NS v3 - fun processChangedProfileSwitchesCompat(): Boolean + fun processChangedProfileSwitchesCompat() fun confirmLastEffectiveProfileSwitchIdIfGreater(lastSynced: Long) fun changedEffectiveProfileSwitch() : List // Until NS v3 - fun processChangedEffectiveProfileSwitchesCompat(): Boolean + fun processChangedEffectiveProfileSwitchesCompat() fun confirmLastOfflineEventIdIfGreater(lastSynced: Long) fun changedOfflineEvents() : List // Until NS v3 - fun processChangedOfflineEventsCompat(): Boolean + fun processChangedOfflineEventsCompat() fun confirmLastProfileStore(lastSynced: Long) fun processChangedProfileStore() diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/NsClient.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/NsClient.kt new file mode 100644 index 0000000000..4380940eb0 --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/NsClient.kt @@ -0,0 +1,30 @@ +package info.nightscout.androidaps.interfaces + +import android.text.Spanned +import org.json.JSONObject + +interface NsClient : Sync { + enum class Version { + NONE, V1, V3 + } + + val version: Version + val address: String + val nsClientService: NSClientService? + + fun pause(newState: Boolean) + fun resend(reason: String) + fun textLog(): Spanned + fun clearLog() + + fun updateLatestBgReceivedIfNewer(latestReceived: Long) + fun updateLatestTreatmentReceivedIfNewer(latestReceived: Long) + + fun resetToFullSync() + + interface NSClientService { + + fun dbAdd(collection: String, data: JSONObject, originalObject: Any, progress: String) + fun dbUpdate(collection: String, _id: String?, data: JSONObject?, originalObject: Any, progress: String) + } +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PluginFragment.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PluginFragment.kt new file mode 100644 index 0000000000..9bb570850e --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PluginFragment.kt @@ -0,0 +1,5 @@ +package info.nightscout.androidaps.interfaces + +interface PluginFragment { + var plugin: PluginBase? +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt index 6238e4ee1e..4909610ceb 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt @@ -4,11 +4,11 @@ import androidx.collection.ArrayMap import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import org.json.JSONException @@ -100,5 +100,5 @@ class ProfileStore(val injector: HasAndroidInjector, val data: JSONObject, val d .asSequence() .map { profileName -> getSpecificProfile(profileName.toString()) } .map { pureProfile -> pureProfile?.let { ProfileSealed.Pure(pureProfile).isValid("allProfilesValid", activePlugin.activePump, config, rh, rxBus, hardLimits, false) } } - .all { it?.isValid == true} + .all { it?.isValid == true } } diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Sync.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/Sync.kt new file mode 100644 index 0000000000..8139182f52 --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/Sync.kt @@ -0,0 +1,8 @@ +package info.nightscout.androidaps.interfaces + +interface Sync { + + val hasWritePermission: Boolean + val connected: Boolean + val status: String +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt b/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt index cc84ee76ba..458573003d 100644 --- a/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt +++ b/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt @@ -6,13 +6,13 @@ 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.UserEntryTransaction +import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.userEntry.UserEntryMapper import info.nightscout.androidaps.utils.userEntry.ValueWithUnitMapper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign -import io.reactivex.rxjava3.kotlin.subscribeBy import javax.inject.Inject import javax.inject.Singleton @@ -21,35 +21,37 @@ import javax.inject.Singleton class UserEntryLogger @Inject constructor( private val aapsLogger: AAPSLogger, private val repository: AppRepository, - private val aapsSchedulers: AapsSchedulers + private val aapsSchedulers: AapsSchedulers, + private val dateUtil: DateUtil ) { private val compositeDisposable = CompositeDisposable() - fun log(action: Action, source: Sources, note: String? ="", vararg listvalues: ValueWithUnit?) = log(action, source, note, listvalues.toList()) + fun log(action: Action, source: Sources, note: String? = "", vararg listValues: ValueWithUnit?) = log(action, source, note, listValues.toList()) - fun log(action: Action, source: Sources, vararg listvalues: ValueWithUnit?) = log(action, source,"", listvalues.toList()) + fun log(action: Action, source: Sources, vararg listValues: ValueWithUnit?) = log(action, source, "", listValues.toList()) - fun log(action: Action, source: Sources, note: String? ="", listvalues: List = listOf()) { - val filteredValues = listvalues.toList().filterNotNull() - compositeDisposable += repository.runTransaction(UserEntryTransaction( - action = action, - source = source, - note = note ?: "", - values = filteredValues - )) + fun log(action: Action, source: Sources, note: String? = "", listValues: List = listOf()) { + val filteredValues = listValues.toList().filterNotNull() + log(listOf(UserEntryTransaction.Entry(dateUtil.now(), action, source, note ?: "", filteredValues))) + } + + fun log(entries: List) { + compositeDisposable += repository.runTransactionForResult(UserEntryTransaction(entries)) .subscribeOn(aapsSchedulers.io) .observeOn(aapsSchedulers.io) - .subscribeBy( - onError = { aapsLogger.debug("ERRORED USER ENTRY: $action $source $note $filteredValues") }, - onComplete = { aapsLogger.debug("USER ENTRY: $action $source $note $filteredValues") } + .subscribe( + { result -> result.forEach { aapsLogger.debug("USER ENTRY: ${dateUtil.dateAndTimeAndSecondsString(it.timestamp)} ${it.action} ${it.source} ${it.note} ${it.values}") } }, + { aapsLogger.debug("FAILED USER ENTRY: $it $entries") }, ) } - fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String? ="", vararg listvalues: ValueWithUnitMapper?) = log(action.db, source.db, note, listvalues.toList().map {it?.db()}) + fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String? = "", vararg listValues: ValueWithUnitMapper?) = + log(action.db, source.db, note, listValues.toList().map { it?.db() }) - fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, vararg listvalues: ValueWithUnitMapper?) = log(action.db, source.db, "", listvalues.toList().map {it?.db()}) + fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, vararg listValues: ValueWithUnitMapper?) = log(action.db, source.db, "", listValues.toList().map { it?.db() }) - fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String? ="", listvalues: List = listOf()) = log(action.db, source.db, note, listvalues.map {it?.db()}) + fun log(action: UserEntryMapper.Action, source: UserEntryMapper.Sources, note: String? = "", listValues: List = listOf()) = + log(action.db, source.db, note, listValues.map { it?.db() }) } \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt b/core/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt index e790ec9f45..2e9a1ecc7a 100644 --- a/core/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt +++ b/core/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt @@ -37,6 +37,7 @@ class DataWorkerStorage @Inject constructor( return value } + @Suppress("unused") @Synchronized fun pickupString(key: Long): String? { val value = store[key] store.remove(key) @@ -63,9 +64,12 @@ class DataWorkerStorage @Inject constructor( fun enqueue(request: OneTimeWorkRequest) { WorkManager.getInstance(context) .enqueueUniqueWork(jobGroupName, ExistingWorkPolicy.APPEND_OR_REPLACE, request) - } + fun beginUniqueWork(jobName: String, request: OneTimeWorkRequest) = + WorkManager.getInstance(context) + .beginUniqueWork(jobName, ExistingWorkPolicy.APPEND_OR_REPLACE, request) + companion object { const val STORE_KEY = "storeKey" diff --git a/core/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt b/core/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt index 33b9cf70a4..4e33dec317 100644 --- a/core/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt +++ b/core/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt @@ -7,6 +7,8 @@ import android.net.Network import android.net.NetworkCapabilities import android.net.wifi.SupplicantState import android.net.wifi.WifiManager +import android.os.Handler +import android.os.HandlerThread import dagger.android.DaggerBroadcastReceiver import info.nightscout.interfaces.utils.StringUtils import info.nightscout.rx.bus.RxBus @@ -20,13 +22,14 @@ class NetworkChangeReceiver : DaggerBroadcastReceiver() { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var receiverStatusStore: ReceiverStatusStore + private val handler = Handler(HandlerThread(this::class.simpleName + "Handler").also { it.start() }.looper) override fun onReceive(context: Context, intent: Intent) { super.onReceive(context, intent) - rxBus.send(grabNetworkStatus(context, aapsLogger)) + handler.post { rxBus.send(grabNetworkStatus(context)) } } @Suppress("DEPRECATION") - private fun grabNetworkStatus(context: Context, aapsLogger: AAPSLogger): EventNetworkChange { + private fun grabNetworkStatus(context: Context): EventNetworkChange { val event = EventNetworkChange() val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager val networks: Array = cm.allNetworks diff --git a/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 2943970f80..9eca1f7df5 100644 --- a/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -5,9 +5,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore @@ -16,6 +14,8 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject diff --git a/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt b/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt index 8b29988c1d..dbcf168193 100644 --- a/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt @@ -6,14 +6,14 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.Config import info.nightscout.rx.TestAapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP @@ -30,7 +30,6 @@ import java.util.Calendar /** * Created by mike on 18.03.2018. */ -@Suppress("SpellCheckingInspection") class ProfileTest : TestBase() { @Mock lateinit var activePluginProvider: ActivePlugin @@ -47,11 +46,16 @@ class ProfileTest : TestBase() { private var okProfile = "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}]," + "\"sens\":[{\"time\":\"00:00\",\"value\":\"6\"},{\"time\":\"2:00\",\"value\":\"6.2\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" - private var belowLimitValidProfile = "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.001\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" - private var notAlignedBasalValidProfile = "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:30\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" - private var notStartingAtZeroValidProfile = "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:30\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" - private var noUnitsValidProfile = "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\"}" - private var wrongProfile = "{\"dia\":\"5\",\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" + private var belowLimitValidProfile = + "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.001\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" + private var notAlignedBasalValidProfile = + "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:30\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" + private var notStartingAtZeroValidProfile = + "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:30\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" + private var noUnitsValidProfile = + "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}],\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\"}" + private var wrongProfile = + "{\"dia\":\"5\",\"carbs_hr\":\"20\",\"delay\":\"20\",\"sens\":[{\"time\":\"00:00\",\"value\":\"100\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"4\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" //String profileStore = "{\"defaultProfile\":\"Default\",\"store\":{\"Default\":" + validProfile + "}}"; @@ -88,10 +92,12 @@ class ProfileTest : TestBase() { c[Calendar.HOUR_OF_DAY] = 2 Assert.assertEquals(111.6, p.getIsfMgdl(c.timeInMillis), 0.01) // Assert.assertEquals(110.0, p.getIsfTimeFromMidnight(2 * 60 * 60), 0.01) - Assert.assertEquals(""" + Assert.assertEquals( + """ 00:00 6,0 mmol/U 02:00 6,2 mmol/U - """.trimIndent(), p.getIsfList(rh, dateUtil).replace(".", ",")) + """.trimIndent(), p.getIsfList(rh, dateUtil).replace(".", ",") + ) Assert.assertEquals(30.0, p.getIc(c.timeInMillis), 0.01) Assert.assertEquals(30.0, p.getIcTimeFromMidnight(2 * 60 * 60), 0.01) Assert.assertEquals("00:00 30,0 g/U", p.getIcList(rh, dateUtil).replace(".", ",")) @@ -153,7 +159,8 @@ class ProfileTest : TestBase() { 00:00 6.2 mmol/U 01:00 6.0 mmol/U 03:00 6.2 mmol/U - """.trimIndent(), p.getIsfList(rh, dateUtil)) + """.trimIndent(), p.getIsfList(rh, dateUtil) + ) // Test hour alignment testPumpPlugin.pumpDescription.is30minBasalRatesCapable = false diff --git a/database/build.gradle b/database/build.gradle index 0bd96c99ff..82b79ab3f9 100644 --- a/database/build.gradle +++ b/database/build.gradle @@ -1,7 +1,10 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt b/database/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt index bea32f40d7..57361f0e33 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt @@ -5,12 +5,11 @@ import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import com.google.gson.annotations.SerializedName import info.nightscout.androidaps.database.TABLE_THERAPY_EVENTS import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.interfaces.DBEntryWithTimeAndDuration import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import java.util.TimeZone @Entity( tableName = TABLE_THERAPY_EVENTS, @@ -66,19 +65,16 @@ data class TherapyEvent( previous.interfaceIDs.nightscoutId == null && interfaceIDs.nightscoutId != null - enum class GlucoseUnit (val toString: String) { - MGDL (ValueWithUnit.MGDL), - MMOL (ValueWithUnit.MMOL); + enum class GlucoseUnit(val toString: String) { + MGDL(ValueWithUnit.MGDL), + MMOL(ValueWithUnit.MMOL); companion object } enum class MeterType(val text: String) { - @SerializedName("Finger") FINGER("Finger"), - @SerializedName("Sensor") SENSOR("Sensor"), - @SerializedName("Manual") MANUAL("Manual") ; @@ -91,99 +87,55 @@ data class TherapyEvent( @Suppress("unused") enum class Type(val text: String, val nsNative: Boolean = false) { - @SerializedName("Site Change") CANNULA_CHANGE("Site Change", nsNative = true), - @SerializedName("Insulin Change") INSULIN_CHANGE("Insulin Change", nsNative = true), - @SerializedName("Pump Battery Change") PUMP_BATTERY_CHANGE("Pump Battery Change", nsNative = true), - @SerializedName("Sensor Change") SENSOR_CHANGE("Sensor Change", nsNative = true), - @SerializedName("Sensor Start") SENSOR_STARTED("Sensor Start", nsNative = true), - @SerializedName("Sensor Stop") SENSOR_STOPPED("Sensor Stop", nsNative = true), - @SerializedName("BG Check") FINGER_STICK_BG_VALUE("BG Check", nsNative = true), - @SerializedName("Exercise") EXERCISE("Exercise", nsNative = true), - @SerializedName("Announcement") ANNOUNCEMENT("Announcement", nsNative = true), - @SerializedName("Question") QUESTION("Question", nsNative = true), - @SerializedName("Note") NOTE("Note", nsNative = true), - @SerializedName("OpenAPS Offline") APS_OFFLINE("OpenAPS Offline", nsNative = true), - @SerializedName("D.A.D. Alert") DAD_ALERT("D.A.D. Alert", nsNative = true), - @SerializedName("Mbg") NS_MBG("Mbg", nsNative = true), // Used but not as a Therapy Event (use constants only) - @SerializedName("Carb Correction") CARBS_CORRECTION("Carb Correction", nsNative = true), - @SerializedName("Bolus Wizard") BOLUS_WIZARD("Bolus Wizard", nsNative = true), - @SerializedName("Correction Bolus") CORRECTION_BOLUS("Correction Bolus", nsNative = true), - @SerializedName("Meal Bolus") MEAL_BOLUS("Meal Bolus", nsNative = true), - @SerializedName("Combo Bolus") COMBO_BOLUS("Combo Bolus", nsNative = true), - @SerializedName("Temporary Target") TEMPORARY_TARGET("Temporary Target", nsNative = true), - @SerializedName("Temporary Target Cancel") TEMPORARY_TARGET_CANCEL("Temporary Target Cancel", nsNative = true), - @SerializedName("Profile Switch") PROFILE_SWITCH("Profile Switch", nsNative = true), - @SerializedName("Snack Bolus") SNACK_BOLUS("Snack Bolus", nsNative = true), - @SerializedName("Temp Basal") TEMPORARY_BASAL("Temp Basal", nsNative = true), - @SerializedName("Temp Basal Start") TEMPORARY_BASAL_START("Temp Basal Start", nsNative = true), - @SerializedName("Temp Basal End") TEMPORARY_BASAL_END("Temp Basal End", nsNative = true), // Not supported by NS - @SerializedName("Tube Change") TUBE_CHANGE("Tube Change"), - @SerializedName("Falling Asleep") FALLING_ASLEEP("Falling Asleep"), - @SerializedName("Battery Empty") BATTERY_EMPTY("Battery Empty"), - @SerializedName("Reservoir Empty") RESERVOIR_EMPTY("Reservoir Empty"), - @SerializedName("Occlusion") OCCLUSION("Occlusion"), - @SerializedName("Pump Stopped") PUMP_STOPPED("Pump Stopped"), - @SerializedName("Pump Started") PUMP_STARTED("Pump Started"), - @SerializedName("Pump Paused") PUMP_PAUSED("Pump Paused"), - @SerializedName("Waking Up") WAKING_UP("Waking Up"), - @SerializedName("Sickness") SICKNESS("Sickness"), - @SerializedName("Stress") STRESS("Stress"), - @SerializedName("Pre Period") PRE_PERIOD("Pre Period"), - @SerializedName("Alcohol") ALCOHOL("Alcohol"), - @SerializedName("Cortisone") CORTISONE("Cortisone"), - @SerializedName("Feeling Low") FEELING_LOW("Feeling Low"), - @SerializedName("Feeling High") FEELING_HIGH("Feeling High"), - @SerializedName("Leaking Infusion Set") LEAKING_INFUSION_SET("Leaking Infusion Set"), // Default - @SerializedName("") NONE("") ; diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt index 382aed5cde..939ebbe817 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt @@ -7,13 +7,10 @@ import info.nightscout.androidaps.database.entities.TherapyEvent /** * Inserts data from a CGM source into the database */ -class CgmSourceTransaction( +class CgmSourceTransaction constructor( private val glucoseValues: List, private val calibrations: List, - private val sensorInsertionTime: Long?, - private val syncer: Boolean = false // caller is not native source ie. NS - // syncer is allowed create records - // update synchronization ID + private val sensorInsertionTime: Long? ) : Transaction() { override fun run(): TransactionResult { @@ -26,7 +23,8 @@ class CgmSourceTransaction( value = it.value, noise = it.noise, trendArrow = it.trendArrow, - sourceSensor = it.sourceSensor + sourceSensor = it.sourceSensor, + isValid = it.isValid ).also { gv -> gv.interfaceIDs.nightscoutId = it.nightscoutId } @@ -37,31 +35,31 @@ class CgmSourceTransaction( current?.let { existing -> glucoseValue.isValid = existing.isValid } when { // new record, create new - current == null -> { + current == null -> { database.glucoseValueDao.insertNewEntry(glucoseValue) result.inserted.add(glucoseValue) } // different record, update - !current.contentEqualsTo(glucoseValue) && !syncer -> { + !current.contentEqualsTo(glucoseValue) -> { glucoseValue.id = current.id database.glucoseValueDao.updateExistingEntry(glucoseValue) result.updated.add(glucoseValue) } // update NS id if didn't exist and now provided - current.interfaceIDs.nightscoutId == null && it.nightscoutId != null && syncer -> { - glucoseValue.id = current.id - database.glucoseValueDao.updateExistingEntry(glucoseValue) - result.updated.add(glucoseValue) + current.interfaceIDs.nightscoutId == null && it.nightscoutId != null -> { + current.interfaceIDs.nightscoutId = it.nightscoutId + database.glucoseValueDao.updateExistingEntry(current) + result.updatedNsId.add(glucoseValue) } } } calibrations.forEach { if (database.therapyEventDao.findByTimestamp(TherapyEvent.Type.FINGER_STICK_BG_VALUE, it.timestamp) == null) { val therapyEvent = TherapyEvent( - timestamp = it.timestamp, - type = TherapyEvent.Type.FINGER_STICK_BG_VALUE, - glucose = it.value, - glucoseUnit = it.glucoseUnit + timestamp = it.timestamp, + type = TherapyEvent.Type.FINGER_STICK_BG_VALUE, + glucose = it.value, + glucoseUnit = it.glucoseUnit ) database.therapyEventDao.insertNewEntry(therapyEvent) result.calibrationsInserted.add(therapyEvent) @@ -88,7 +86,8 @@ class CgmSourceTransaction( val noise: Double?, val trendArrow: GlucoseValue.TrendArrow, val nightscoutId: String? = null, - val sourceSensor: GlucoseValue.SourceSensor + val sourceSensor: GlucoseValue.SourceSensor, + val isValid: Boolean = true ) data class Calibration( @@ -101,6 +100,7 @@ class CgmSourceTransaction( val inserted = mutableListOf() val updated = mutableListOf() + val updatedNsId = mutableListOf() val calibrationsInserted = mutableListOf() val sensorInsertionsInserted = mutableListOf() diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt index 7ac50e32d2..bc9d4b0c07 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt @@ -5,41 +5,42 @@ import info.nightscout.androidaps.database.entities.BolusCalculatorResult /** * Sync the BolusCalculatorResult from NS */ -class SyncNsBolusCalculatorResultTransaction(private val bolusCalculatorResult: BolusCalculatorResult) : +class SyncNsBolusCalculatorResultTransaction(private val bolusCalculatorResults: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - val current: BolusCalculatorResult? = - bolusCalculatorResult.interfaceIDs.nightscoutId?.let { - database.bolusCalculatorResultDao.findByNSId(it) + for (bolusCalculatorResult in bolusCalculatorResults) { + val current: BolusCalculatorResult? = + bolusCalculatorResult.interfaceIDs.nightscoutId?.let { + database.bolusCalculatorResultDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !bolusCalculatorResult.isValid) { + current.isValid = false + database.bolusCalculatorResultDao.updateExistingEntry(current) + result.invalidated.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !bolusCalculatorResult.isValid) { - current.isValid = false - database.bolusCalculatorResultDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val existing = database.bolusCalculatorResultDao.findByTimestamp(bolusCalculatorResult.timestamp) + if (existing != null && existing.interfaceIDs.nightscoutId == null) { + // the same record, update nsId only + existing.interfaceIDs.nightscoutId = bolusCalculatorResult.interfaceIDs.nightscoutId + existing.isValid = bolusCalculatorResult.isValid + database.bolusCalculatorResultDao.updateExistingEntry(existing) + result.updatedNsId.add(existing) + } else { + database.bolusCalculatorResultDao.insertNewEntry(bolusCalculatorResult) + result.inserted.add(bolusCalculatorResult) } - return result - } - - // not known nsId - val existing = database.bolusCalculatorResultDao.findByTimestamp(bolusCalculatorResult.timestamp) - if (existing != null && existing.interfaceIDs.nightscoutId == null) { - // the same record, update nsId only - existing.interfaceIDs.nightscoutId = bolusCalculatorResult.interfaceIDs.nightscoutId - existing.isValid = bolusCalculatorResult.isValid - database.bolusCalculatorResultDao.updateExistingEntry(existing) - result.updatedNsId.add(existing) - } else { - database.bolusCalculatorResultDao.insertNewEntry(bolusCalculatorResult) - result.inserted.add(bolusCalculatorResult) } return result - } class TransactionResult { diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt index 9457f2d802..a7f1c8b7f4 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt @@ -5,46 +5,47 @@ import info.nightscout.androidaps.database.entities.Bolus /** * Sync the Bolus from NS */ -class SyncNsBolusTransaction(private val bolus: Bolus) : Transaction() { +class SyncNsBolusTransaction(private val boluses: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - val current: Bolus? = - bolus.interfaceIDs.nightscoutId?.let { - database.bolusDao.findByNSId(it) + for (bolus in boluses) { + val current: Bolus? = + bolus.interfaceIDs.nightscoutId?.let { + database.bolusDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation or amount update (for drivers setting full amount upfront) + if (current.isValid && !bolus.isValid) { + current.isValid = false + database.bolusDao.updateExistingEntry(current) + result.invalidated.add(current) + } + if (current.amount != bolus.amount) { + current.amount = bolus.amount + database.bolusDao.updateExistingEntry(current) + result.updated.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation or amount update (for drivers setting full amount upfront) - if (current.isValid && !bolus.isValid) { - current.isValid = false - database.bolusDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val existing = database.bolusDao.findByTimestamp(bolus.timestamp) + if (existing != null && existing.interfaceIDs.nightscoutId == null) { + // the same record, update nsId only and amount + existing.interfaceIDs.nightscoutId = bolus.interfaceIDs.nightscoutId + existing.isValid = bolus.isValid + existing.amount = bolus.amount + database.bolusDao.updateExistingEntry(existing) + result.updatedNsId.add(existing) + } else { + database.bolusDao.insertNewEntry(bolus) + result.inserted.add(bolus) } - if (current.amount != bolus.amount) { - current.amount = bolus.amount - database.bolusDao.updateExistingEntry(current) - result.updated.add(current) - } - return result - } - - // not known nsId - val existing = database.bolusDao.findByTimestamp(bolus.timestamp) - if (existing != null && existing.interfaceIDs.nightscoutId == null) { - // the same record, update nsId only and amount - existing.interfaceIDs.nightscoutId = bolus.interfaceIDs.nightscoutId - existing.isValid = bolus.isValid - existing.amount = bolus.amount - database.bolusDao.updateExistingEntry(existing) - result.updatedNsId.add(existing) - } else { - database.bolusDao.insertNewEntry(bolus) - result.inserted.add(bolus) } return result - } class TransactionResult { diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt index ce916a321e..5e3bb60d94 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt @@ -5,47 +5,48 @@ import info.nightscout.androidaps.database.entities.Carbs /** * Sync the carbs from NS */ -class SyncNsCarbsTransaction(private val carbs: Carbs) : Transaction() { +class SyncNsCarbsTransaction(private val carbs: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - val current: Carbs? = - carbs.interfaceIDs.nightscoutId?.let { - database.carbsDao.findByNSId(it) + for (carb in carbs) { + val current: Carbs? = + carb.interfaceIDs.nightscoutId?.let { + database.carbsDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !carb.isValid) { + current.isValid = false + database.carbsDao.updateExistingEntry(current) + result.invalidated.add(current) + } + // and change duration + if (current.duration != carb.duration) { + current.amount = carb.amount + current.duration = carb.duration + database.carbsDao.updateExistingEntry(current) + result.updated.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !carbs.isValid) { - current.isValid = false - database.carbsDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val existing = database.carbsDao.findByTimestamp(carb.timestamp) + if (existing != null && existing.interfaceIDs.nightscoutId == null) { + // the same record, update nsId only + existing.interfaceIDs.nightscoutId = carb.interfaceIDs.nightscoutId + existing.isValid = carb.isValid + database.carbsDao.updateExistingEntry(existing) + result.updatedNsId.add(existing) + } else { + database.carbsDao.insertNewEntry(carb) + result.inserted.add(carb) } - // and change duration - if (current.duration != carbs.duration) { - current.amount = carbs.amount - current.duration = carbs.duration - database.carbsDao.updateExistingEntry(current) - result.updated.add(current) - } - return result - } - - // not known nsId - val existing = database.carbsDao.findByTimestamp(carbs.timestamp) - if (existing != null && existing.interfaceIDs.nightscoutId == null) { - // the same record, update nsId only - existing.interfaceIDs.nightscoutId = carbs.interfaceIDs.nightscoutId - existing.isValid = carbs.isValid - database.carbsDao.updateExistingEntry(existing) - result.updatedNsId.add(existing) - } else { - database.carbsDao.insertNewEntry(carbs) - result.inserted.add(carbs) } return result - } class TransactionResult { diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt index 93579275e4..81d264e79a 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt @@ -5,37 +5,39 @@ import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch /** * Sync the EffectiveProfileSwitch from NS */ -class SyncNsEffectiveProfileSwitchTransaction(private val effectiveProfileSwitch: EffectiveProfileSwitch) : Transaction() { +class SyncNsEffectiveProfileSwitchTransaction(private val effectiveProfileSwitches: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - val current: EffectiveProfileSwitch? = - effectiveProfileSwitch.interfaceIDs.nightscoutId?.let { - database.effectiveProfileSwitchDao.findByNSId(it) + for (effectiveProfileSwitch in effectiveProfileSwitches) { + val current: EffectiveProfileSwitch? = + effectiveProfileSwitch.interfaceIDs.nightscoutId?.let { + database.effectiveProfileSwitchDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !effectiveProfileSwitch.isValid) { + current.isValid = false + database.effectiveProfileSwitchDao.updateExistingEntry(current) + result.invalidated.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !effectiveProfileSwitch.isValid) { - current.isValid = false - database.effectiveProfileSwitchDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val existing = database.effectiveProfileSwitchDao.findByTimestamp(effectiveProfileSwitch.timestamp) + if (existing != null && existing.interfaceIDs.nightscoutId == null) { + // the same record, update nsId only + existing.interfaceIDs.nightscoutId = effectiveProfileSwitch.interfaceIDs.nightscoutId + existing.isValid = effectiveProfileSwitch.isValid + database.effectiveProfileSwitchDao.updateExistingEntry(existing) + result.updatedNsId.add(existing) + } else { + database.effectiveProfileSwitchDao.insertNewEntry(effectiveProfileSwitch) + result.inserted.add(effectiveProfileSwitch) } - return result - } - - // not known nsId - val existing = database.effectiveProfileSwitchDao.findByTimestamp(effectiveProfileSwitch.timestamp) - if (existing != null && existing.interfaceIDs.nightscoutId == null) { - // the same record, update nsId only - existing.interfaceIDs.nightscoutId = effectiveProfileSwitch.interfaceIDs.nightscoutId - existing.isValid = effectiveProfileSwitch.isValid - database.effectiveProfileSwitchDao.updateExistingEntry(existing) - result.updatedNsId.add(existing) - } else { - database.effectiveProfileSwitchDao.insertNewEntry(effectiveProfileSwitch) - result.inserted.add(effectiveProfileSwitch) } return result } diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt index 1d7b7eba6e..cd8f3accd1 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt @@ -7,66 +7,68 @@ import kotlin.math.abs /** * Sync the Extended bolus from NS */ -class SyncNsExtendedBolusTransaction(private val extendedBolus: ExtendedBolus) : +class SyncNsExtendedBolusTransaction(private val extendedBoluses: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - if (extendedBolus.duration != 0L) { - // not ending event - val current: ExtendedBolus? = - extendedBolus.interfaceIDs.nightscoutId?.let { - database.extendedBolusDao.findByNSId(it) + for (extendedBolus in extendedBoluses) { + if (extendedBolus.duration != 0L) { + // not ending event + val current: ExtendedBolus? = + extendedBolus.interfaceIDs.nightscoutId?.let { + database.extendedBolusDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !extendedBolus.isValid) { + current.isValid = false + database.extendedBolusDao.updateExistingEntry(current) + result.invalidated.add(current) + } + if (current.duration != extendedBolus.duration) { + current.duration = extendedBolus.duration + current.amount = extendedBolus.amount + database.extendedBolusDao.updateExistingEntry(current) + result.updatedDuration.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !extendedBolus.isValid) { - current.isValid = false - database.extendedBolusDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val running = database.extendedBolusDao.getExtendedBolusActiveAt(extendedBolus.timestamp).blockingGet() + if (running != null && abs(running.timestamp - extendedBolus.timestamp) < 1000 && running.interfaceIDs.nightscoutId == null) { // allow missing milliseconds + // the same record, update nsId only + running.interfaceIDs.nightscoutId = extendedBolus.interfaceIDs.nightscoutId + database.extendedBolusDao.updateExistingEntry(running) + result.updatedNsId.add(running) + } else if (running != null) { + // another running record. end current and insert new + val pctRun = (extendedBolus.timestamp - running.timestamp) / running.duration.toDouble() + running.amount *= pctRun + running.end = extendedBolus.timestamp + database.extendedBolusDao.updateExistingEntry(running) + database.extendedBolusDao.insertNewEntry(extendedBolus) + result.ended.add(running) + result.inserted.add(extendedBolus) + } else { + database.extendedBolusDao.insertNewEntry(extendedBolus) + result.inserted.add(extendedBolus) } - if (current.duration != extendedBolus.duration) { - current.duration = extendedBolus.duration - current.amount = extendedBolus.amount - database.extendedBolusDao.updateExistingEntry(current) - result.updatedDuration.add(current) - } - return result - } + continue - // not known nsId - val running = database.extendedBolusDao.getExtendedBolusActiveAt(extendedBolus.timestamp).blockingGet() - if (running != null && abs(running.timestamp - extendedBolus.timestamp) < 1000 && running.interfaceIDs.nightscoutId == null) { // allow missing milliseconds - // the same record, update nsId only - running.interfaceIDs.nightscoutId = extendedBolus.interfaceIDs.nightscoutId - database.extendedBolusDao.updateExistingEntry(running) - result.updatedNsId.add(running) - } else if (running != null) { - // another running record. end current and insert new - val pctRun = (extendedBolus.timestamp - running.timestamp) / running.duration.toDouble() - running.amount *= pctRun - running.end = extendedBolus.timestamp - database.extendedBolusDao.updateExistingEntry(running) - database.extendedBolusDao.insertNewEntry(extendedBolus) - result.ended.add(running) - result.inserted.add(extendedBolus) } else { - database.extendedBolusDao.insertNewEntry(extendedBolus) - result.inserted.add(extendedBolus) - } - return result - - } else { - // ending event - val running = database.extendedBolusDao.getExtendedBolusActiveAt(extendedBolus.timestamp).blockingGet() - if (running != null) { - val pctRun = (extendedBolus.timestamp - running.timestamp) / running.duration.toDouble() - running.amount *= pctRun - running.end = extendedBolus.timestamp - database.extendedBolusDao.updateExistingEntry(running) - result.ended.add(running) + // ending event + val running = database.extendedBolusDao.getExtendedBolusActiveAt(extendedBolus.timestamp).blockingGet() + if (running != null) { + val pctRun = (extendedBolus.timestamp - running.timestamp) / running.duration.toDouble() + running.amount *= pctRun + running.end = extendedBolus.timestamp + database.extendedBolusDao.updateExistingEntry(running) + result.ended.add(running) + } } } return result diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt index d5fa356039..e787c591f3 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt @@ -7,61 +7,63 @@ import kotlin.math.abs /** * Sync the OfflineEvent from NS */ -class SyncNsOfflineEventTransaction(private val offlineEvent: OfflineEvent) : +class SyncNsOfflineEventTransaction(private val offlineEvents: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - if (offlineEvent.duration != 0L) { - // not ending event - val current: OfflineEvent? = - offlineEvent.interfaceIDs.nightscoutId?.let { - database.offlineEventDao.findByNSId(it) + for (offlineEvent in offlineEvents) { + if (offlineEvent.duration != 0L) { + // not ending event + val current: OfflineEvent? = + offlineEvent.interfaceIDs.nightscoutId?.let { + database.offlineEventDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !offlineEvent.isValid) { + current.isValid = false + database.offlineEventDao.updateExistingEntry(current) + result.invalidated.add(current) + } + if (current.duration != offlineEvent.duration) { + current.duration = offlineEvent.duration + database.offlineEventDao.updateExistingEntry(current) + result.updatedDuration.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !offlineEvent.isValid) { - current.isValid = false - database.offlineEventDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val running = database.offlineEventDao.getOfflineEventActiveAt(offlineEvent.timestamp).blockingGet() + if (running != null && abs(running.timestamp - offlineEvent.timestamp) < 1000 && running.interfaceIDs.nightscoutId == null) { // allow missing milliseconds + // the same record, update nsId only + running.interfaceIDs.nightscoutId = offlineEvent.interfaceIDs.nightscoutId + database.offlineEventDao.updateExistingEntry(running) + result.updatedNsId.add(running) + } else if (running != null) { + // another running record. end current and insert new + running.end = offlineEvent.timestamp + database.offlineEventDao.updateExistingEntry(running) + database.offlineEventDao.insertNewEntry(offlineEvent) + result.ended.add(running) + result.inserted.add(offlineEvent) + } else { + database.offlineEventDao.insertNewEntry(offlineEvent) + result.inserted.add(offlineEvent) } - if (current.duration != offlineEvent.duration) { - current.duration = offlineEvent.duration - database.offlineEventDao.updateExistingEntry(current) - result.updatedDuration.add(current) - } - return result - } + continue - // not known nsId - val running = database.offlineEventDao.getOfflineEventActiveAt(offlineEvent.timestamp).blockingGet() - if (running != null && abs(running.timestamp - offlineEvent.timestamp) < 1000 && running.interfaceIDs.nightscoutId == null) { // allow missing milliseconds - // the same record, update nsId only - running.interfaceIDs.nightscoutId = offlineEvent.interfaceIDs.nightscoutId - database.offlineEventDao.updateExistingEntry(running) - result.updatedNsId.add(running) - } else if (running != null) { - // another running record. end current and insert new - running.end = offlineEvent.timestamp - database.offlineEventDao.updateExistingEntry(running) - database.offlineEventDao.insertNewEntry(offlineEvent) - result.ended.add(running) - result.inserted.add(offlineEvent) } else { - database.offlineEventDao.insertNewEntry(offlineEvent) - result.inserted.add(offlineEvent) - } - return result - - } else { - // ending event - val running = database.offlineEventDao.getOfflineEventActiveAt(offlineEvent.timestamp).blockingGet() - if (running != null) { - running.end = offlineEvent.timestamp - database.offlineEventDao.updateExistingEntry(running) - result.ended.add(running) + // ending event + val running = database.offlineEventDao.getOfflineEventActiveAt(offlineEvent.timestamp).blockingGet() + if (running != null) { + running.end = offlineEvent.timestamp + database.offlineEventDao.updateExistingEntry(running) + result.ended.add(running) + } } } return result diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt index e99d79a334..e11f5ebad0 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt @@ -5,37 +5,39 @@ import info.nightscout.androidaps.database.entities.ProfileSwitch /** * Sync the ProfileSwitch from NS */ -class SyncNsProfileSwitchTransaction(private val profileSwitch: ProfileSwitch) : Transaction() { +class SyncNsProfileSwitchTransaction(private val profileSwitches: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - val current: ProfileSwitch? = - profileSwitch.interfaceIDs.nightscoutId?.let { - database.profileSwitchDao.findByNSId(it) + for (profileSwitch in profileSwitches) { + val current: ProfileSwitch? = + profileSwitch.interfaceIDs.nightscoutId?.let { + database.profileSwitchDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !profileSwitch.isValid) { + current.isValid = false + database.profileSwitchDao.updateExistingEntry(current) + result.invalidated.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !profileSwitch.isValid) { - current.isValid = false - database.profileSwitchDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val existing = database.profileSwitchDao.findByTimestamp(profileSwitch.timestamp) + if (existing != null && existing.interfaceIDs.nightscoutId == null) { + // the same record, update nsId only + existing.interfaceIDs.nightscoutId = profileSwitch.interfaceIDs.nightscoutId + existing.isValid = profileSwitch.isValid + database.profileSwitchDao.updateExistingEntry(existing) + result.updatedNsId.add(existing) + } else { + database.profileSwitchDao.insertNewEntry(profileSwitch) + result.inserted.add(profileSwitch) } - return result - } - - // not known nsId - val existing = database.profileSwitchDao.findByTimestamp(profileSwitch.timestamp) - if (existing != null && existing.interfaceIDs.nightscoutId == null) { - // the same record, update nsId only - existing.interfaceIDs.nightscoutId = profileSwitch.interfaceIDs.nightscoutId - existing.isValid = profileSwitch.isValid - database.profileSwitchDao.updateExistingEntry(existing) - result.updatedNsId.add(existing) - } else { - database.profileSwitchDao.insertNewEntry(profileSwitch) - result.inserted.add(profileSwitch) } return result } diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt index 8a4931617a..1789102029 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt @@ -7,54 +7,54 @@ import kotlin.math.abs /** * Sync the Temporary Basal from NS */ -class SyncNsTemporaryBasalTransaction( - private val temporaryBasal: TemporaryBasal -) : Transaction() { +class SyncNsTemporaryBasalTransaction(private val temporaryBasals: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - if (temporaryBasal.duration != 0L) { - // not ending event - val current: TemporaryBasal? = - temporaryBasal.interfaceIDs.nightscoutId?.let { - database.temporaryBasalDao.findByNSId(it) + for (temporaryBasal in temporaryBasals) { + if (temporaryBasal.duration != 0L) { + // not ending event + val current = temporaryBasal.interfaceIDs.nightscoutId?.let { + database.temporaryBasalDao.findByNSId(it) ?: temporaryBasal.interfaceIDs.pumpId?.let { + database.temporaryBasalDao.findByPumpIds(temporaryBasal.interfaceIDs.pumpId!!, temporaryBasal.interfaceIDs.pumpType!!, temporaryBasal.interfaceIDs.pumpSerial!!) + } } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !temporaryBasal.isValid) { - current.isValid = false - database.temporaryBasalDao.updateExistingEntry(current) - result.invalidated.add(current) + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !temporaryBasal.isValid) { + current.isValid = false + database.temporaryBasalDao.updateExistingEntry(current) + result.invalidated.add(current) + } + if (current.duration != temporaryBasal.duration) { + current.duration = temporaryBasal.duration + database.temporaryBasalDao.updateExistingEntry(current) + result.updatedDuration.add(current) + } + continue } - if (current.duration != temporaryBasal.duration) { - current.duration = temporaryBasal.duration - database.temporaryBasalDao.updateExistingEntry(current) - result.updatedDuration.add(current) - } - return result - } - // not known nsId - val running = database.temporaryBasalDao.getTemporaryBasalActiveAt(temporaryBasal.timestamp).blockingGet() - if (running != null && abs(running.timestamp - temporaryBasal.timestamp) < 1000 && running.interfaceIDs.nightscoutId == null) { // allow missing milliseconds - // the same record, update nsId only - running.interfaceIDs.nightscoutId = temporaryBasal.interfaceIDs.nightscoutId - database.temporaryBasalDao.updateExistingEntry(running) - result.updatedNsId.add(running) - } else if (running != null) { - // another running record. end current and insert new - running.end = temporaryBasal.timestamp - database.temporaryBasalDao.updateExistingEntry(running) - database.temporaryBasalDao.insertNewEntry(temporaryBasal) - result.ended.add(running) - result.inserted.add(temporaryBasal) - } else { - database.temporaryBasalDao.insertNewEntry(temporaryBasal) - result.inserted.add(temporaryBasal) + // not known nsId + val running = database.temporaryBasalDao.getTemporaryBasalActiveAt(temporaryBasal.timestamp).blockingGet() + if (running != null && abs(running.timestamp - temporaryBasal.timestamp) < 1000 && running.interfaceIDs.nightscoutId == null) { // allow missing milliseconds + // the same record, update nsId only + running.interfaceIDs.nightscoutId = temporaryBasal.interfaceIDs.nightscoutId + database.temporaryBasalDao.updateExistingEntry(running) + result.updatedNsId.add(running) + } else if (running != null) { + // another running record. end current and insert new + running.end = temporaryBasal.timestamp + database.temporaryBasalDao.updateExistingEntry(running) + database.temporaryBasalDao.insertNewEntry(temporaryBasal) + result.ended.add(running) + result.inserted.add(temporaryBasal) + } else { + database.temporaryBasalDao.insertNewEntry(temporaryBasal) + result.inserted.add(temporaryBasal) + } } - return result } return result } diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt index a3eff6d1e6..d3fcb29cf1 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt @@ -7,61 +7,62 @@ import kotlin.math.abs /** * Sync the TemporaryTarget from NS */ -class SyncNsTemporaryTargetTransaction(private val temporaryTarget: TemporaryTarget) : +class SyncNsTemporaryTargetTransaction(private val temporaryTargets: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - if (temporaryTarget.duration != 0L) { - // not ending event - val current: TemporaryTarget? = - temporaryTarget.interfaceIDs.nightscoutId?.let { - database.temporaryTargetDao.findByNSId(it) + for (temporaryTarget in temporaryTargets) { + if (temporaryTarget.duration != 0L) { + // not ending event + val current: TemporaryTarget? = + temporaryTarget.interfaceIDs.nightscoutId?.let { + database.temporaryTargetDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !temporaryTarget.isValid) { + current.isValid = false + database.temporaryTargetDao.updateExistingEntry(current) + result.invalidated.add(current) + } + if (current.duration != temporaryTarget.duration) { + current.duration = temporaryTarget.duration + database.temporaryTargetDao.updateExistingEntry(current) + result.updatedDuration.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !temporaryTarget.isValid) { - current.isValid = false - database.temporaryTargetDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val running = database.temporaryTargetDao.getTemporaryTargetActiveAt(temporaryTarget.timestamp).blockingGet() + if (running != null && abs(running.timestamp - temporaryTarget.timestamp) < 1000 && running.interfaceIDs.nightscoutId == null) { // allow missing milliseconds + // the same record, update nsId only + running.interfaceIDs.nightscoutId = temporaryTarget.interfaceIDs.nightscoutId + database.temporaryTargetDao.updateExistingEntry(running) + result.updatedNsId.add(running) + } else if (running != null) { + // another running record. end current and insert new + running.end = temporaryTarget.timestamp + database.temporaryTargetDao.updateExistingEntry(running) + database.temporaryTargetDao.insertNewEntry(temporaryTarget) + result.ended.add(running) + result.inserted.add(temporaryTarget) + } else { + database.temporaryTargetDao.insertNewEntry(temporaryTarget) + result.inserted.add(temporaryTarget) } - if (current.duration != temporaryTarget.duration) { - current.duration = temporaryTarget.duration - database.temporaryTargetDao.updateExistingEntry(current) - result.updatedDuration.add(current) - } - return result - } - - // not known nsId - val running = database.temporaryTargetDao.getTemporaryTargetActiveAt(temporaryTarget.timestamp).blockingGet() - if (running != null && abs(running.timestamp - temporaryTarget.timestamp) < 1000 && running.interfaceIDs.nightscoutId == null) { // allow missing milliseconds - // the same record, update nsId only - running.interfaceIDs.nightscoutId = temporaryTarget.interfaceIDs.nightscoutId - database.temporaryTargetDao.updateExistingEntry(running) - result.updatedNsId.add(running) - } else if (running != null) { - // another running record. end current and insert new - running.end = temporaryTarget.timestamp - database.temporaryTargetDao.updateExistingEntry(running) - database.temporaryTargetDao.insertNewEntry(temporaryTarget) - result.ended.add(running) - result.inserted.add(temporaryTarget) + continue } else { - database.temporaryTargetDao.insertNewEntry(temporaryTarget) - result.inserted.add(temporaryTarget) - } - return result - - } else { - // ending event - val running = database.temporaryTargetDao.getTemporaryTargetActiveAt(temporaryTarget.timestamp).blockingGet() - if (running != null) { - running.end = temporaryTarget.timestamp - database.temporaryTargetDao.updateExistingEntry(running) - result.ended.add(running) + // ending event + val running = database.temporaryTargetDao.getTemporaryTargetActiveAt(temporaryTarget.timestamp).blockingGet() + if (running != null) { + running.end = temporaryTarget.timestamp + database.temporaryTargetDao.updateExistingEntry(running) + result.ended.add(running) + } } } return result diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt index 5ed73cf9d8..f0fa5104c1 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt @@ -5,46 +5,47 @@ import info.nightscout.androidaps.database.entities.TherapyEvent /** * Sync the TherapyEvents from NS */ -class SyncNsTherapyEventTransaction(private val therapyEvent: TherapyEvent) : +class SyncNsTherapyEventTransaction(private val therapyEvents: List) : Transaction() { override fun run(): TransactionResult { val result = TransactionResult() - val current: TherapyEvent? = - therapyEvent.interfaceIDs.nightscoutId?.let { - database.therapyEventDao.findByNSId(it) + for (therapyEvent in therapyEvents) { + val current: TherapyEvent? = + therapyEvent.interfaceIDs.nightscoutId?.let { + database.therapyEventDao.findByNSId(it) + } + + if (current != null) { + // nsId exists, allow only invalidation + if (current.isValid && !therapyEvent.isValid) { + current.isValid = false + database.therapyEventDao.updateExistingEntry(current) + result.invalidated.add(current) + } + if (current.duration != therapyEvent.duration) { + current.duration = therapyEvent.duration + database.therapyEventDao.updateExistingEntry(current) + result.updatedDuration.add(current) + } + continue } - if (current != null) { - // nsId exists, allow only invalidation - if (current.isValid && !therapyEvent.isValid) { - current.isValid = false - database.therapyEventDao.updateExistingEntry(current) - result.invalidated.add(current) + // not known nsId + val existing = database.therapyEventDao.findByTimestamp(therapyEvent.type, therapyEvent.timestamp) + if (existing != null && existing.interfaceIDs.nightscoutId == null) { + // the same record, update nsId only + existing.interfaceIDs.nightscoutId = therapyEvent.interfaceIDs.nightscoutId + existing.isValid = therapyEvent.isValid + database.therapyEventDao.updateExistingEntry(existing) + result.updatedNsId.add(existing) + } else { + database.therapyEventDao.insertNewEntry(therapyEvent) + result.inserted.add(therapyEvent) } - if (current.duration != therapyEvent.duration) { - current.duration = therapyEvent.duration - database.therapyEventDao.updateExistingEntry(current) - result.updatedDuration.add(current) - } - return result - } - - // not known nsId - val existing = database.therapyEventDao.findByTimestamp(therapyEvent.type, therapyEvent.timestamp) - if (existing != null && existing.interfaceIDs.nightscoutId == null) { - // the same record, update nsId only - existing.interfaceIDs.nightscoutId = therapyEvent.interfaceIDs.nightscoutId - existing.isValid = therapyEvent.isValid - database.therapyEventDao.updateExistingEntry(existing) - result.updatedNsId.add(existing) - } else { - database.therapyEventDao.insertNewEntry(therapyEvent) - result.inserted.add(therapyEvent) } return result - } class TransactionResult { diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt b/database/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt index 714661fc36..6443041f2c 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt @@ -5,20 +5,28 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit -class UserEntryTransaction( - val action: Action, - val source: Sources, - val note: String, - val values: List = listOf() -) : Transaction() { +class UserEntryTransaction(private val entries: List) : Transaction>() { - override fun run() { - database.userEntryDao.insert(UserEntry( - timestamp = System.currentTimeMillis(), - action = action, - source = source, - note = note, - values = values - )) + data class Entry( + val timestamp: Long, + val action: Action, + val source: Sources, + val note: String, + val values: List = listOf() + ) + + override fun run(): List { + + for (entry in entries) + database.userEntryDao.insert( + UserEntry( + timestamp = entry.timestamp, + action = entry.action, + source = entry.source, + note = entry.note, + values = entry.values + ) + ) + return entries } } \ No newline at end of file diff --git a/graphview/build.gradle b/graphview/build.gradle index d4855aaefe..a7e69d8d3e 100644 --- a/graphview/build.gradle +++ b/graphview/build.gradle @@ -1,6 +1,8 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + } apply from: "${project.rootDir}/core/android_dependencies.gradle" diff --git a/implementation/build.gradle b/implementation/build.gradle index fd1b013ab8..c7648b67ef 100644 --- a/implementation/build.gradle +++ b/implementation/build.gradle @@ -1,12 +1,15 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { namespace 'info.nightscout.implementation' diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index 69cb50a4bd..9131218c6c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -9,7 +9,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper @@ -17,10 +16,7 @@ import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.dialogs.BolusProgressDialog -import info.nightscout.androidaps.extensions.getCustomizedName import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.AndroidPermission import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints @@ -31,14 +27,11 @@ import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning 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.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.queue.commands.Command.CommandType -import info.nightscout.interfaces.queue.CustomCommand import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.HtmlHelper +import info.nightscout.androidaps.utils.extensions.getCustomizedName import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus import info.nightscout.implementation.queue.commands.CommandCancelExtendedBolus @@ -57,8 +50,15 @@ import info.nightscout.implementation.queue.commands.CommandStartPump import info.nightscout.implementation.queue.commands.CommandStopPump import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute import info.nightscout.implementation.queue.commands.CommandTempBasalPercent +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.queue.CustomCommand +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventMobileToWear diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 78bd435dc5..c8c0e6e0e3 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -6,15 +6,15 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InsulinConfiguration import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import org.json.JSONObject import org.junit.Before diff --git a/insight/build.gradle b/insight/build.gradle index ff816bf0d1..55feaf304e 100644 --- a/insight/build.gradle +++ b/insight/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" diff --git a/interfaces/build.gradle b/interfaces/build.gradle index 09d5a2a9d5..e94dcc4ac3 100644 --- a/interfaces/build.gradle +++ b/interfaces/build.gradle @@ -1,10 +1,12 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'kotlin-parcelize' -apply plugin: 'com.hiya.jacoco-android' -apply plugin: 'kotlinx-serialization' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'kotlin-parcelize' + id 'kotlinx-serialization' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Constants.kt b/interfaces/src/main/java/info/nightscout/interfaces/Constants.kt index 9de3afd8cb..d72293006b 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/Constants.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/Constants.kt @@ -46,7 +46,7 @@ object Constants { const val MAX_TT_MMOL = 10.0 //NSClientInternal - const val MAX_LOG_LINES = 30 + const val MAX_LOG_LINES = 90 //Screen: Threshold for width/height to go into small width/height layout const val SMALL_WIDTH = 320 diff --git a/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt b/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt index 648b6bac9b..f57b33b863 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt @@ -6,5 +6,5 @@ package info.nightscout.interfaces * set by [info.nightscout.androidaps.interfaces.PluginDescription.mainType] */ enum class PluginType { - GENERAL, SENSITIVITY, PROFILE, APS, PUMP, CONSTRAINTS, LOOP, BGSOURCE, INSULIN + GENERAL, SENSITIVITY, PROFILE, APS, PUMP, CONSTRAINTS, LOOP, BGSOURCE, INSULIN, SYNC } \ No newline at end of file diff --git a/ns-sdk/.gitignore b/ns-sdk/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/ns-sdk/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/ns-sdk/build.gradle b/ns-sdk/build.gradle new file mode 100644 index 0000000000..d8c4d43bd3 --- /dev/null +++ b/ns-sdk/build.gradle @@ -0,0 +1,38 @@ +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlinx-serialization' +} + +apply from: "${project.rootDir}/core/android_dependencies.gradle" +apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/test_dependencies.gradle" + +android { + namespace 'info.nightscout.sdk' +} + +dependencies { + api "com.squareup.retrofit2:retrofit:$retrofit2_version" + api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version" + api "com.squareup.retrofit2:converter-gson:$retrofit2_version" + api "com.squareup.okhttp3:okhttp:$okhttp3_version" + api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" + + api "com.google.code.gson:gson:$gson_version" + + api "net.danlew:android.joda:$joda_version" + + api "io.reactivex.rxjava3:rxjava:$rxjava_version" + api "io.reactivex.rxjava3:rxandroid:$rxandroid_version" + api "io.reactivex.rxjava3:rxkotlin:$rxkotlin_version" + + api "androidx.core:core-ktx:$core_version" + api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" + api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" + api "org.jetbrains.kotlinx:kotlinx-coroutines-rx3:$coroutines_version" + + api "org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version" +} diff --git a/ns-sdk/proguard-rules.pro b/ns-sdk/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/ns-sdk/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/ns-sdk/src/main/AndroidManifest.xml b/ns-sdk/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..a8800291f3 --- /dev/null +++ b/ns-sdk/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidCallbackClientImpl.kt b/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidCallbackClientImpl.kt new file mode 100644 index 0000000000..1da0a47e9b --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidCallbackClientImpl.kt @@ -0,0 +1,27 @@ +package info.nightscout.sdk + +import info.nightscout.sdk.interfaces.NSAndroidCallbackClient +import info.nightscout.sdk.interfaces.NSAndroidClient +import info.nightscout.sdk.localmodel.Status +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.launch + +class NSAndroidCallbackClientImpl(private val client: NSAndroidClient) : + NSAndroidCallbackClient { + + private val scope = CoroutineScope(Dispatchers.IO + SupervisorJob()) + + @Suppress("TooGenericExceptionCaught") + override fun getStatus(callback: NSAndroidCallbackClient.NSCallback): NSAndroidCallbackClient.NSCancellable = + NSAndroidCallbackClient.NSJobCancellable( + scope.launch { + try { + callback.onSuccess(client.getStatus()) + } catch (e: Exception) { + callback.onFailure(e) + } + } + ) +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidClientImpl.kt b/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidClientImpl.kt new file mode 100644 index 0000000000..4a5b3ffa10 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidClientImpl.kt @@ -0,0 +1,175 @@ +package info.nightscout.sdk + +import android.content.Context +import info.nightscout.sdk.exceptions.DateHeaderOutOfToleranceException +import info.nightscout.sdk.exceptions.InvalidAccessTokenException +import info.nightscout.sdk.exceptions.TodoNightscoutException +import info.nightscout.sdk.interfaces.NSAndroidClient +import info.nightscout.sdk.localmodel.Status +import info.nightscout.sdk.localmodel.entry.NSSgvV3 +import info.nightscout.sdk.localmodel.treatment.NSTreatment +import info.nightscout.sdk.mapper.toLocal +import info.nightscout.sdk.mapper.toSgv +import info.nightscout.sdk.mapper.toTreatment +import info.nightscout.sdk.networking.NetworkStackBuilder +import info.nightscout.sdk.remotemodel.LastModified +import info.nightscout.sdk.remotemodel.RemoteDeviceStatus +import info.nightscout.sdk.remotemodel.RemoteEntry +import info.nightscout.sdk.remotemodel.RemoteTreatment +import info.nightscout.sdk.utils.retry +import info.nightscout.sdk.utils.toNotNull +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext + +/** + * + * This client uses suspend functions and therefore is only visible in Kotlin (@JvmSynthetic). + * An RxJava version can be found here [NSAndroidRxClientImpl] + * + * @param baseUrl the baseURL of the NightScout Instance + * @param accessToken the access token of a role found in the admin panel of the NightScout instance + * @param logging if set to true, all network communication will be logged to logcat + * @param dispatcher the coroutine dispatcher used for network calls. + * Per default all network calls will be done on the IO thread pool. Change for Unit-Tests + * @param context the application context. + * + * Todo: retry parameters (maxRetries, backoffFactor)? + * + * Todo: functions to modify baseUrl and accessToken? + * (not necessarily needed but might come handy if Client is provided by a DI framework like dagger) + * + * Todo: internal methods are still visible in Java bytecode -> tag @JvmSynthetic + * + * TODO: add message to Exceptions? wrap them? + * */ + +class NSAndroidClientImpl( + baseUrl: String, + accessToken: String, + context: Context, + logging: Boolean, + private val dispatcher: CoroutineDispatcher = Dispatchers.IO +) : NSAndroidClient { + + internal val api = NetworkStackBuilder.getApi( + baseUrl = baseUrl, + context = context, + accessToken = accessToken, + logging = logging + ) + + /* + * TODO: how should our result look like? + * + * Option A: + * Directly hat the user asked for or an Exception. We can have our own Exceptions + * -> re-throw to Exceptions with meaning + * -> usually not that liked in Java with checked Exceptions and Rx + * + * + * + * Option B: + * A Wrapper - sealed class that has success and error sub types. + * Typical for Rx. + * + * */ + + // TODO: we need a minimum NightscoutVersion for APIv3. Add to documentation + override suspend fun getVersion(): String = callWrapper(dispatcher) { + api.statusSimple().result!!.version + } + + override suspend fun getStatus(): Status = callWrapper(dispatcher) { + api.statusSimple().result!!.toLocal() + } + + // TODO: return something better than a String + // TODO: parameters like count? + // TODO: updated after timestamp + override suspend fun getEntries(): String = callWrapper(dispatcher) { + api.getEntries().toString() + } + + override suspend fun getLastModified(): LastModified = callWrapper(dispatcher) { + + val response = api.lastModified() + if (response.isSuccessful) { + return@callWrapper response.body()?.result ?: throw TodoNightscoutException() + } else { + throw TodoNightscoutException() // TODO: react to response errors (offline, ...) + } + } + + // TODO: parameters like count? + override suspend fun getSgvs(): List = callWrapper(dispatcher) { + + val response = api.getSgvs() + if (response.isSuccessful) { + return@callWrapper response.body()?.result?.map(RemoteEntry::toSgv).toNotNull() + } else { + throw TodoNightscoutException() // TODO: react to response errors (offline, ...) + } + } + + override suspend fun getSgvsModifiedSince(from: Long): List = callWrapper(dispatcher) { + + val response = api.getSgvsModifiedSince(from) + if (response.isSuccessful) { + return@callWrapper response.body()?.result?.map(RemoteEntry::toSgv).toNotNull() + } else { + throw TodoNightscoutException() // TODO: react to response errors (offline, ...) + } + } + + override suspend fun getSgvsNewerThan(from: Long, limit: Long): List = callWrapper(dispatcher) { + + val response = api.getSgvsNewerThan(from, limit) + if (response.isSuccessful) { + return@callWrapper response.body()?.result?.map(RemoteEntry::toSgv).toNotNull() + } else { + throw TodoNightscoutException() // TODO: react to response errors (offline, ...) + } + } + + override suspend fun getTreatmentsModifiedSince(from: Long, limit: Long): List = callWrapper(dispatcher) { + + val response = api.getTreatmentsModifiedSince(from, limit) + if (response.isSuccessful) { + return@callWrapper response.body()?.result?.map(RemoteTreatment::toTreatment).toNotNull() + } else { + throw TodoNightscoutException() // TODO: react to response errors (offline, ...) + } + } + + override suspend fun getDeviceStatusModifiedSince(from: Long): List = callWrapper(dispatcher) { + + val response = api.getDeviceStatusModifiedSince(from) + if (response.isSuccessful) { + return@callWrapper response.body()?.result.toNotNull() + } else { + throw TodoNightscoutException() // TODO: react to response errors (offline, ...) + } + } + + private suspend fun callWrapper(dispatcher: CoroutineDispatcher, block: suspend () -> T): T = + withContext(dispatcher) { + retry( + numberOfRetries = RETRIES, + delayBetweenRetries = RETRY_DELAY, + excludedExceptions = listOf( + InvalidAccessTokenException::class, + DateHeaderOutOfToleranceException::class + ) + ) { + block.invoke() + } + } + + companion object { + + // TODO: Parameters? + private const val RETRIES = 3 + private const val RETRY_DELAY = 100L + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidRxClientImpl.kt b/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidRxClientImpl.kt new file mode 100644 index 0000000000..93b11ca0ce --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/NSAndroidRxClientImpl.kt @@ -0,0 +1,23 @@ +package info.nightscout.sdk + +import info.nightscout.sdk.interfaces.NSAndroidClient +import info.nightscout.sdk.interfaces.NSAndroidRxClient +import info.nightscout.sdk.localmodel.Status +import info.nightscout.sdk.localmodel.entry.NSSgvV3 +import info.nightscout.sdk.localmodel.treatment.NSTreatment +import info.nightscout.sdk.remotemodel.LastModified +import info.nightscout.sdk.remotemodel.RemoteDeviceStatus +import io.reactivex.rxjava3.core.Single +import kotlinx.coroutines.rx3.rxSingle + +class NSAndroidRxClientImpl(private val client: NSAndroidClient) : NSAndroidRxClient { + + override fun getVersion(): Single = rxSingle { client.getVersion() } + override fun getStatus(): Single = rxSingle { client.getStatus() } + override fun getLastModified(): Single = rxSingle { client.getLastModified() } + override fun getSgvsModifiedSince(from: Long): Single> = rxSingle { client.getSgvsModifiedSince(from) } + override fun getTreatmentsModifiedSince(from: Long, limit: Long): Single> = + rxSingle { client.getTreatmentsModifiedSince(from, limit) } + override fun getDeviceStatusModifiedSince(from: Long): Single> = + rxSingle { client.getDeviceStatusModifiedSince(from) } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/DateHeaderOutOfToleranceException.kt b/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/DateHeaderOutOfToleranceException.kt new file mode 100644 index 0000000000..2cfcdc1bf6 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/DateHeaderOutOfToleranceException.kt @@ -0,0 +1,9 @@ +package info.nightscout.sdk.exceptions + +/** + * Will be thrown if the server responds with 401 UNAUTHORIZED due to the Date Header being off + * more than one hour. + * In practice this will happen if the server time and the phone time are off. + * + */ +class DateHeaderOutOfToleranceException : NightscoutException() diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/InvalidAccessTokenException.kt b/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/InvalidAccessTokenException.kt new file mode 100644 index 0000000000..6ae3735741 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/InvalidAccessTokenException.kt @@ -0,0 +1,3 @@ +package info.nightscout.sdk.exceptions + +class InvalidAccessTokenException : NightscoutException() diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/NightscoutException.kt b/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/NightscoutException.kt new file mode 100644 index 0000000000..ff7817e277 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/NightscoutException.kt @@ -0,0 +1,10 @@ +package info.nightscout.sdk.exceptions + +import java.io.IOException + +abstract class NightscoutException : IOException { + constructor() : super() + constructor(message: String) : super(message) + constructor(message: String, cause: Throwable) : super(message, cause) + constructor(cause: Throwable?) : super(cause) +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/TodoNightscoutException.kt b/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/TodoNightscoutException.kt new file mode 100644 index 0000000000..e90a172319 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/exceptions/TodoNightscoutException.kt @@ -0,0 +1,3 @@ +package info.nightscout.sdk.exceptions + +class TodoNightscoutException : NightscoutException() diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidCallbackClient.kt b/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidCallbackClient.kt new file mode 100644 index 0000000000..a21b12e964 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidCallbackClient.kt @@ -0,0 +1,26 @@ +package info.nightscout.sdk.interfaces + +import info.nightscout.sdk.localmodel.Status +import kotlinx.coroutines.Job + +interface NSAndroidCallbackClient { + + interface NSCallback { + + fun onSuccess(value: T) + fun onFailure(exception: Exception) + } + + interface NSCancellable { + + fun cancel() + } + + class NSJobCancellable(val job: Job) : NSCancellable { + + override fun cancel() = job.cancel() + } + + fun getStatus(callback: NSCallback): NSCancellable +} + diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidClient.kt b/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidClient.kt new file mode 100644 index 0000000000..918f4e8538 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidClient.kt @@ -0,0 +1,21 @@ +package info.nightscout.sdk.interfaces + +import info.nightscout.sdk.localmodel.Status +import info.nightscout.sdk.localmodel.entry.NSSgvV3 +import info.nightscout.sdk.localmodel.treatment.NSTreatment +import info.nightscout.sdk.remotemodel.LastModified +import info.nightscout.sdk.remotemodel.RemoteDeviceStatus + +interface NSAndroidClient { + + suspend fun getVersion(): String + suspend fun getStatus(): Status + suspend fun getEntries(): String + + suspend fun getLastModified(): LastModified + suspend fun getSgvs(): List + suspend fun getSgvsModifiedSince(from: Long): List + suspend fun getSgvsNewerThan(from: Long, limit: Long): List + suspend fun getTreatmentsModifiedSince(from: Long, limit: Long): List + suspend fun getDeviceStatusModifiedSince(from: Long): List +} \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidRxClient.kt b/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidRxClient.kt new file mode 100644 index 0000000000..77a88358a1 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/interfaces/NSAndroidRxClient.kt @@ -0,0 +1,19 @@ +package info.nightscout.sdk.interfaces + +import info.nightscout.sdk.localmodel.Status +import info.nightscout.sdk.localmodel.entry.NSSgvV3 +import info.nightscout.sdk.localmodel.treatment.NSTreatment +import info.nightscout.sdk.remotemodel.LastModified +import info.nightscout.sdk.remotemodel.RemoteDeviceStatus +import io.reactivex.rxjava3.core.Single + +interface NSAndroidRxClient { + + fun getVersion(): Single + fun getStatus(): Single + fun getLastModified(): Single + fun getSgvsModifiedSince(from: Long): Single> + fun getTreatmentsModifiedSince(from: Long, limit: Long): Single> + fun getDeviceStatusModifiedSince(from: Long): Single> +} + diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/ApiPermission.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/ApiPermission.kt new file mode 100644 index 0000000000..e84e3f3faf --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/ApiPermission.kt @@ -0,0 +1,11 @@ +package info.nightscout.sdk.localmodel + +data class ApiPermission( + val create: Boolean, + val read: Boolean, + val update: Boolean, + val delete: Boolean +) { + val full: Boolean + get() = this.create && this.read && this.update && this.delete +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/ApiPermissions.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/ApiPermissions.kt new file mode 100644 index 0000000000..d78861667a --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/ApiPermissions.kt @@ -0,0 +1,10 @@ +package info.nightscout.sdk.localmodel + +data class ApiPermissions( + val deviceStatus: ApiPermission, + val entries: ApiPermission, + val food: ApiPermission, + val profile: ApiPermission, + val settings: ApiPermission, + val treatments: ApiPermission +) diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/Status.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/Status.kt new file mode 100644 index 0000000000..12a497a5d1 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/Status.kt @@ -0,0 +1,9 @@ +package info.nightscout.sdk.localmodel + +data class Status( + val version: String, + val apiVersion: String, + val srvDate: Long, + val storage: Storage, + val apiPermissions: ApiPermissions +) diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/Storage.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/Storage.kt new file mode 100644 index 0000000000..f8b6ce2224 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/Storage.kt @@ -0,0 +1,3 @@ +package info.nightscout.sdk.localmodel + +data class Storage(val storage: String, val version: String) diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/Direction.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/Direction.kt new file mode 100644 index 0000000000..6fd2c91651 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/Direction.kt @@ -0,0 +1,51 @@ +package info.nightscout.sdk.localmodel.entry + +enum class Direction(val nsName: String, val txtIcon: String) { + TRIPLE_DOWN("TripleDown", "\u290B"), // ⤋ + DOUBLE_DOWN("DoubleDown", "\u21ca"), // ⇊ + SINGLE_DOWN("SingleDown", "\u2193"), // ↓ + FORTY_FIVE_DOWN("FortyFiveDown", "\u2198"), // ↘ + FLAT("Flat", "\u2192"), // → + FORTY_FIVE_UP("FortyFiveUp", "\u2197"), // ↗ + SINGLE_UP("SingleUp", "\u2191"), // ↑ + DOUBLE_UP("DoubleUp", "\u21c8"), // ⇈ + TRIPLE_UP("TripleUp", "\u290A"), // ⤊ + NONE("NONE", "⇼"), // + INVALID("", "-"), // +} + +/* + +Nightscout: + NONE: '⇼' + , TripleUp: '⤊' \u290A + , DoubleUp: '⇈' + , SingleUp: '↑' + , FortyFiveUp: '↗' + , Flat: '→' + , FortyFiveDown: '↘' + , SingleDown: '↓' + , DoubleDown: '⇊' + , TripleDown: '⤋' \u290B + , 'NOT COMPUTABLE': '-' + , 'RATE OUT OF RANGE': '⇕' \u21D5 + + xDrip: + + + if (slope_name.compareTo("DoubleDown") == 0) { + slope_by_minute = -3.5; + } else if (slope_name.compareTo("SingleDown") == 0) { + slope_by_minute = -2; + } else if (slope_name.compareTo("FortyFiveDown") == 0) { + slope_by_minute = -1; + } else if (slope_name.compareTo("Flat") == 0) { + slope_by_minute = 0; + } else if (slope_name.compareTo("FortyFiveUp") == 0) { + slope_by_minute = 2; + } else if (slope_name.compareTo("SingleUp") == 0) { + slope_by_minute = 3.5; + } else if (slope_name.compareTo("DoubleUp") == 0) { + + + */ diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/Entry.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/Entry.kt new file mode 100644 index 0000000000..561df012e8 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/Entry.kt @@ -0,0 +1,13 @@ +package info.nightscout.sdk.localmodel.entry + +interface Entry { + val date: Long + val device: String? + val identifier: String + val srvModified: Long + val srvCreated: Long + val utcOffset: Long? + val subject: String? + var isReadOnly: Boolean // TODO: nullability? + val isValid: Boolean +} \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/NSSgvV3.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/NSSgvV3.kt new file mode 100644 index 0000000000..8edcce0743 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/NSSgvV3.kt @@ -0,0 +1,20 @@ +package info.nightscout.sdk.localmodel.entry + +data class NSSgvV3( + override val date: Long, + override val device: String?, + override val identifier: String, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long?, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + val sgv: Double, // TODO: might be Double? + val units: NsUnits, + val direction: Direction, + val noise: Int?, // TODO: enum? + val filtered: Double?, // number in doc (I found decimal values in API v1 + val unfiltered: Double?, // number in doc (I found decimal values in API v1 + // TODO: add SVG fields +) : Entry diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/NsUnits.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/NsUnits.kt new file mode 100644 index 0000000000..8498c390ac --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/entry/NsUnits.kt @@ -0,0 +1,12 @@ +package info.nightscout.sdk.localmodel.entry + +enum class NsUnits(val value: String) { + MG_DL("mg/dl"), + MMOL_L("mmol") + ; + + companion object { + + fun fromString(name: String?) = values().firstOrNull { it.value == name } ?: MG_DL + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/EventType.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/EventType.kt new file mode 100644 index 0000000000..4f6d8620e5 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/EventType.kt @@ -0,0 +1,43 @@ +package info.nightscout.sdk.localmodel.treatment + +import com.google.gson.annotations.SerializedName + +@Suppress("unused") +enum class EventType(val text: String) { + + @SerializedName("Site Change") CANNULA_CHANGE("Site Change"), + @SerializedName("Insulin Change") INSULIN_CHANGE("Insulin Change"), + @SerializedName("Pump Battery Change") PUMP_BATTERY_CHANGE("Pump Battery Change"), + @SerializedName("Sensor Change") SENSOR_CHANGE("Sensor Change"), + @SerializedName("Sensor Start") SENSOR_STARTED("Sensor Start"), + @SerializedName("Sensor Stop") SENSOR_STOPPED("Sensor Stop"), + @SerializedName("BG Check") FINGER_STICK_BG_VALUE("BG Check"), + @SerializedName("Exercise") EXERCISE("Exercise"), + @SerializedName("Announcement") ANNOUNCEMENT("Announcement"), + @SerializedName("Question") QUESTION("Question"), + @SerializedName("Note") NOTE("Note"), + @SerializedName("OpenAPS Offline") APS_OFFLINE("OpenAPS Offline"), + @SerializedName("D.A.D. Alert") DAD_ALERT("D.A.D. Alert"), + @SerializedName("Mbg") NS_MBG("Mbg"), + + // Used but not as a Therapy Event (use constants only) + @SerializedName("Carb Correction") CARBS_CORRECTION("Carb Correction"), + @SerializedName("Bolus Wizard") BOLUS_WIZARD("Bolus Wizard"), + @SerializedName("Correction Bolus") CORRECTION_BOLUS("Correction Bolus"), + @SerializedName("Meal Bolus") MEAL_BOLUS("Meal Bolus"), + @SerializedName("Combo Bolus") COMBO_BOLUS("Combo Bolus"), + @SerializedName("Temporary Target") TEMPORARY_TARGET("Temporary Target"), + @SerializedName("Temporary Target Cancel") TEMPORARY_TARGET_CANCEL("Temporary Target Cancel"), + @SerializedName("Profile Switch") PROFILE_SWITCH("Profile Switch"), + @SerializedName("Snack Bolus") SNACK_BOLUS("Snack Bolus"), + @SerializedName("Temp Basal") TEMPORARY_BASAL("Temp Basal"), + @SerializedName("Temp Basal Start") TEMPORARY_BASAL_START("Temp Basal Start"), + @SerializedName("Temp Basal End") TEMPORARY_BASAL_END("Temp Basal End"), + + @SerializedName("") NONE(""); + + companion object { + + fun fromString(text: String?) = values().firstOrNull { it.text == text } ?: NONE + } +} \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/GlucoseType.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/GlucoseType.kt new file mode 100644 index 0000000000..bec75d0161 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/GlucoseType.kt @@ -0,0 +1,9 @@ +package info.nightscout.sdk.localmodel.treatment + +import com.google.gson.annotations.SerializedName + +enum class GlucoseType { + @SerializedName("Sensor") Sensor, + @SerializedName("Finger") Finger, + @SerializedName("Manual") Manual +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSBolus.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSBolus.kt new file mode 100644 index 0000000000..76d482f222 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSBolus.kt @@ -0,0 +1,36 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits + +data class NSBolus( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val insulin: Double, + val type: BolusType + +) : NSTreatment { + enum class BolusType { + NORMAL, + SMB, + PRIMING; + + companion object { + + fun fromString(name: String?) = values().firstOrNull { it.name == name } ?: NORMAL + } + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSBolusWizard.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSBolusWizard.kt new file mode 100644 index 0000000000..11a1ab3a48 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSBolusWizard.kt @@ -0,0 +1,25 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits +import org.json.JSONObject + +data class NSBolusWizard( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val bolusCalculatorResult: String?, + val glucose: Double?, +) : NSTreatment \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSCarbs.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSCarbs.kt new file mode 100644 index 0000000000..9f3dd66be2 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSCarbs.kt @@ -0,0 +1,24 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits + +data class NSCarbs( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val carbs: Double, + val duration: Long +) : NSTreatment \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSEffectiveProfileSwitch.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSEffectiveProfileSwitch.kt new file mode 100644 index 0000000000..4fa8b1e322 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSEffectiveProfileSwitch.kt @@ -0,0 +1,31 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits +import org.json.JSONObject + +data class NSEffectiveProfileSwitch( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val profileJson: JSONObject, + val originalProfileName: String, + val originalCustomizedName: String, + val originalTimeshift: Long, + val originalPercentage: Int, + val originalDuration: Long, + val originalEnd: Long + +) : NSTreatment \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSExtendedBolus.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSExtendedBolus.kt new file mode 100644 index 0000000000..0fc041d9e5 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSExtendedBolus.kt @@ -0,0 +1,25 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits + +data class NSExtendedBolus( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val duration: Long, + val enteredinsulin: Double, + val isEmulatingTempbasal: Boolean +) : NSTreatment diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSOfflineEvent.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSOfflineEvent.kt new file mode 100644 index 0000000000..1abffef44c --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSOfflineEvent.kt @@ -0,0 +1,39 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits + +data class NSOfflineEvent( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val duration: Long, + val reason: Reason +) : NSTreatment { + + enum class Reason { + DISCONNECT_PUMP, + SUSPEND, + DISABLE_LOOP, + SUPER_BOLUS, + OTHER + ; + + companion object { + + fun fromString(reason: String?) = values().firstOrNull { it.name == reason } ?: OTHER + } + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSProfileSwitch.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSProfileSwitch.kt new file mode 100644 index 0000000000..c97e5de38c --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSProfileSwitch.kt @@ -0,0 +1,30 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits +import org.json.JSONObject + +data class NSProfileSwitch( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val profileJson: JSONObject?, + val profileName: String, + val originalProfileName: String?, + val timeShift: Long?, + val percentage: Int?, + val duration: Long?, + val originalDuration: Long? +) : NSTreatment \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTemporaryBasal.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTemporaryBasal.kt new file mode 100644 index 0000000000..8a025e7097 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTemporaryBasal.kt @@ -0,0 +1,43 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits +import org.json.JSONObject + +data class NSTemporaryBasal( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val duration: Long, + val rate: Double, + val isAbsolute: Boolean, + val type: Type +) : NSTreatment { + + enum class Type { + NORMAL, + EMULATED_PUMP_SUSPEND, + PUMP_SUSPEND, + SUPERBOLUS, + FAKE_EXTENDED // in memory only + ; + + companion object { + + fun fromString(name: String?) = values().firstOrNull { it.name == name } ?: NORMAL + } + } + +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTemporaryTarget.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTemporaryTarget.kt new file mode 100644 index 0000000000..c4a03bca18 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTemporaryTarget.kt @@ -0,0 +1,45 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits + +data class NSTemporaryTarget( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val duration: Long, + val targetBottom: Double, + val targetTop: Double, + val reason: Reason, + + ) : NSTreatment { + + fun targetBottomAsMgdl() = targetBottom.asMgdl() + fun targetTopAsMgdl() = targetTop.asMgdl() + enum class Reason(val text: String) { + CUSTOM("Custom"), + HYPOGLYCEMIA("Hypo"), + ACTIVITY("Activity"), + EATING_SOON("Eating Soon"), + AUTOMATION("Automation"), + WEAR("Wear") + ; + + companion object { + + fun fromString(reason: String?) = values().firstOrNull { it.text == reason } ?: CUSTOM + } + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTherapyEvent.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTherapyEvent.kt new file mode 100644 index 0000000000..503c9ee65f --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTherapyEvent.kt @@ -0,0 +1,40 @@ +package info.nightscout.sdk.localmodel.treatment + +import com.google.gson.annotations.SerializedName +import info.nightscout.sdk.localmodel.entry.NsUnits + +data class NSTherapyEvent( + override val date: Long, + override val device: String?, + override val identifier: String, + override val units: NsUnits?, + override val srvModified: Long, + override val srvCreated: Long, + override val utcOffset: Long, + override val subject: String?, + override var isReadOnly: Boolean, + override val isValid: Boolean, + override val eventType: EventType, + override val notes: String?, + override val pumpId: Long?, + override val endId: Long?, + override val pumpType: String?, + override val pumpSerial: String?, + val duration: Long, + var enteredBy: String? = null, + var glucose: Double? = null, + var glucoseType: MeterType? = null, +) : NSTreatment { + + enum class MeterType(val text: String) { + @SerializedName("Finger") FINGER("Finger"), + @SerializedName("Sensor") SENSOR("Sensor"), + @SerializedName("Manual") MANUAL("Manual") + ; + + companion object { + + fun fromString(text: String?) = values().firstOrNull { it.text == text } ?: MANUAL + } + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTreatment.kt b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTreatment.kt new file mode 100644 index 0000000000..f522b0673c --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/localmodel/treatment/NSTreatment.kt @@ -0,0 +1,29 @@ +package info.nightscout.sdk.localmodel.treatment + +import info.nightscout.sdk.localmodel.entry.NsUnits + +interface NSTreatment { + val date: Long + val device: String? + val identifier: String + val units: NsUnits? + val eventType: EventType + val srvModified: Long + val srvCreated: Long + val utcOffset: Long + val subject: String? + var isReadOnly: Boolean + val isValid: Boolean + val notes: String? + val pumpId: Long? + val endId: Long? + val pumpType: String? + val pumpSerial: String? + + fun Double.asMgdl() = + when (units) { + NsUnits.MG_DL -> this + NsUnits.MMOL_L -> this * 18 + null -> this + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/mapper/ApiPermissionMapper.kt b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/ApiPermissionMapper.kt new file mode 100644 index 0000000000..b407cb1763 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/ApiPermissionMapper.kt @@ -0,0 +1,32 @@ +package info.nightscout.sdk.mapper + +import info.nightscout.sdk.localmodel.ApiPermission +import info.nightscout.sdk.localmodel.ApiPermissions +import info.nightscout.sdk.remotemodel.RemoteApiPermission +import info.nightscout.sdk.remotemodel.RemoteApiPermissions +import info.nightscout.sdk.remotemodel.read + +internal fun RemoteApiPermissions.toLocal(): ApiPermissions = + ApiPermissions( + deviceStatus = deviceStatus.toLocal(), + entries = entries.toLocal(), + food = food.toLocal(), + profile = profile.toLocal(), + settings = settings.toLocal(), + treatments = treatments.toLocal() + ) + +internal fun RemoteApiPermission.toLocal(): ApiPermission = + ApiPermission(create = create, read = read, update = update, delete = delete) + +internal val RemoteApiPermission.create: Boolean + get() = this.contains('c') + +internal val RemoteApiPermission.read: Boolean + get() = this.contains('r') + +internal val RemoteApiPermission.update: Boolean + get() = this.contains('u') + +internal val RemoteApiPermission.delete: Boolean + get() = this.contains('d') diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/mapper/StatusResponseMapper.kt b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/StatusResponseMapper.kt new file mode 100644 index 0000000000..1c9f5b419a --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/StatusResponseMapper.kt @@ -0,0 +1,12 @@ +package info.nightscout.sdk.mapper + +import info.nightscout.sdk.localmodel.Status +import info.nightscout.sdk.remotemodel.RemoteStatusResponse + +internal fun RemoteStatusResponse.toLocal() = Status( + version = version, + apiVersion = apiVersion, + srvDate = srvDate, + storage = storage.toLocal(), + apiPermissions = apiPermissions.toLocal() +) diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/mapper/StorageMapper.kt b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/StorageMapper.kt new file mode 100644 index 0000000000..c2d26f81e2 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/StorageMapper.kt @@ -0,0 +1,6 @@ +package info.nightscout.sdk.mapper + +import info.nightscout.sdk.localmodel.Storage +import info.nightscout.sdk.remotemodel.RemoteStorage + +internal fun RemoteStorage.toLocal() = Storage(storage = storage, version = version) diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/mapper/SvgMapper.kt b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/SvgMapper.kt new file mode 100644 index 0000000000..b91debc392 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/SvgMapper.kt @@ -0,0 +1,34 @@ +package info.nightscout.sdk.mapper + +import info.nightscout.sdk.localmodel.entry.Direction +import info.nightscout.sdk.localmodel.entry.NSSgvV3 +import info.nightscout.sdk.localmodel.entry.NsUnits +import info.nightscout.sdk.remotemodel.RemoteEntry + +@JvmSynthetic +internal fun RemoteEntry.toSgv(): NSSgvV3? { + + this.sgv ?: return null + if (this.type != "sgv") return null + + return NSSgvV3( + date = this.date, + device = this.device, + identifier = this.identifier, + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + direction = this.direction.toDirection(), + sgv = this.sgv, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + noise = this.noise, // TODO: to Enum? + filtered = this.filtered, + unfiltered = this.unfiltered, + units = NsUnits.fromString(this.units) + ) +} + +private fun String?.toDirection(): Direction = + Direction.values().firstOrNull { it.nsName == this } ?: Direction.INVALID diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/mapper/TreatmentMapper.kt b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/TreatmentMapper.kt new file mode 100644 index 0000000000..7af6badcbb --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/mapper/TreatmentMapper.kt @@ -0,0 +1,338 @@ +package info.nightscout.sdk.mapper + +import info.nightscout.sdk.localmodel.entry.NsUnits +import info.nightscout.sdk.localmodel.treatment.EventType +import info.nightscout.sdk.localmodel.treatment.NSBolus +import info.nightscout.sdk.localmodel.treatment.NSBolusWizard +import info.nightscout.sdk.localmodel.treatment.NSCarbs +import info.nightscout.sdk.localmodel.treatment.NSEffectiveProfileSwitch +import info.nightscout.sdk.localmodel.treatment.NSExtendedBolus +import info.nightscout.sdk.localmodel.treatment.NSOfflineEvent +import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch +import info.nightscout.sdk.localmodel.treatment.NSTemporaryBasal +import info.nightscout.sdk.localmodel.treatment.NSTemporaryTarget +import info.nightscout.sdk.localmodel.treatment.NSTherapyEvent +import info.nightscout.sdk.localmodel.treatment.NSTreatment +import info.nightscout.sdk.remotemodel.RemoteTreatment +import org.json.JSONObject +import java.util.concurrent.TimeUnit + +internal fun RemoteTreatment.toTreatment(): NSTreatment? { + val treatmentTimestamp = timestamp() + when { + insulin != null && insulin > 0 -> + return NSBolus( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + insulin = this.insulin, + type = NSBolus.BolusType.fromString(this.type), + ) + + carbs != null && carbs > 0 -> + return NSCarbs( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + carbs = this.carbs, + duration = this.duration ?: 0L + ) + + eventType == EventType.TEMPORARY_TARGET -> { + if (treatmentTimestamp == 0L) return null + + this.duration ?: return null + this.targetBottom ?: return null + this.targetTop ?: return null + + return NSTemporaryTarget( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + duration = this.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(this.duration), + targetBottom = this.targetBottom, + targetTop = this.targetTop, + reason = NSTemporaryTarget.Reason.fromString(this.reason) + ) + } + + // Convert back emulated TBR -> EB + eventType == EventType.TEMPORARY_BASAL && extendedEmulated != null -> { + + return NSExtendedBolus( + date = treatmentTimestamp, + device = device, + identifier = identifier, + units = NsUnits.fromString(extendedEmulated.units), + srvModified = srvModified, + srvCreated = srvCreated, + utcOffset = utcOffset ?: 0, + subject = subject, + isReadOnly = extendedEmulated.isReadOnly ?: false, + isValid = extendedEmulated.isValid ?: true, + eventType = extendedEmulated.eventType, + notes = extendedEmulated.notes, + pumpId = extendedEmulated.pumpId, + endId = extendedEmulated.endId, + pumpType = extendedEmulated.pumpType, + pumpSerial = extendedEmulated.pumpSerial, + enteredinsulin = extendedEmulated.enteredinsulin ?: 0.0, + duration = extendedEmulated.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(extendedEmulated.duration ?: 0L), + isEmulatingTempbasal = extendedEmulated.isEmulatingTempBasal + ) + } + + eventType == EventType.TEMPORARY_BASAL -> { + if (treatmentTimestamp == 0L) return null + + this.absolute ?: this.percent ?: return null + this.duration ?: return null + if (this.duration == 0L && this.durationInMilliseconds == null) return null + + return NSTemporaryBasal( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + duration = this.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(this.duration), + isAbsolute = this.absolute != null, + rate = this.absolute ?: (this.percent?.plus(100.0)) ?: 0.0, + type = NSTemporaryBasal.Type.fromString(this.type) + ) + } + + eventType == EventType.NOTE && this.originalProfileName != null -> { + if (treatmentTimestamp == 0L) return null + this.profileJson ?: return null + this.originalCustomizedName ?: return null + this.originalTimeshift ?: return null + this.originalPercentage ?: return null + this.originalDuration ?: return null + this.originalEnd ?: return null + + return NSEffectiveProfileSwitch( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + profileJson = JSONObject(this.profileJson), + originalProfileName = this.originalProfileName, + originalCustomizedName = this.originalCustomizedName, + originalTimeshift = this.originalTimeshift, + originalPercentage = this.originalPercentage, + originalDuration = this.originalDuration, + originalEnd = this.originalEnd + ) + } + + eventType == EventType.PROFILE_SWITCH -> { + if (treatmentTimestamp == 0L) return null + this.profile ?: return null + + return NSProfileSwitch( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + profileJson = this.profileJson?.let { JSONObject(this.profileJson) }, + profileName = this.profile, + originalProfileName = this.originalProfileName, + originalDuration = this.originalDuration, + duration = this.duration, + timeShift = this.timeshift, + percentage = this.percentage, + ) + } + + eventType == EventType.BOLUS_WIZARD -> { + if (treatmentTimestamp == 0L) return null + this.bolusCalculatorResult ?: return null + + return NSBolusWizard( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + bolusCalculatorResult = this.bolusCalculatorResult, + glucose = this.glucose + ) + } + + eventType == EventType.CANNULA_CHANGE || + eventType == EventType.INSULIN_CHANGE || + eventType == EventType.SENSOR_CHANGE || + eventType == EventType.FINGER_STICK_BG_VALUE || + eventType == EventType.NONE || + eventType == EventType.ANNOUNCEMENT || + eventType == EventType.QUESTION || + eventType == EventType.EXERCISE || + eventType == EventType.NOTE || + eventType == EventType.PUMP_BATTERY_CHANGE -> { + if (treatmentTimestamp == 0L) return null + + return NSTherapyEvent( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + duration = this.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(this.duration ?: 0L), + glucose = this.glucose, + enteredBy = this.enteredBy, + glucoseType = NSTherapyEvent.MeterType.fromString(this.glucoseType) + ) + } + + eventType == EventType.APS_OFFLINE -> { + if (treatmentTimestamp == 0L) return null + + return NSOfflineEvent( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + duration = this.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(this.duration ?: 0L), + reason = NSOfflineEvent.Reason.fromString(this.reason) + ) + } + + eventType == EventType.COMBO_BOLUS -> { + if (treatmentTimestamp == 0L) return null + this.enteredinsulin ?: return null + + return NSExtendedBolus( + date = treatmentTimestamp, + device = this.device, + identifier = this.identifier, + units = NsUnits.fromString(this.units), + srvModified = this.srvModified, + srvCreated = this.srvCreated, + utcOffset = this.utcOffset ?: 0, + subject = this.subject, + isReadOnly = this.isReadOnly ?: false, + isValid = this.isValid ?: true, + eventType = this.eventType, + notes = this.notes, + pumpId = this.pumpId, + endId = this.endId, + pumpType = this.pumpType, + pumpSerial = this.pumpSerial, + enteredinsulin = this.enteredinsulin, + duration = this.durationInMilliseconds ?: TimeUnit.MINUTES.toMillis(this.duration ?: 0L), + isEmulatingTempbasal = this.isEmulatingTempBasal + ) + } + } + + return null +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/networking/NSAuthInterceptor.kt b/ns-sdk/src/main/java/info/nightscout/sdk/networking/NSAuthInterceptor.kt new file mode 100644 index 0000000000..a5dd72d87b --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/networking/NSAuthInterceptor.kt @@ -0,0 +1,68 @@ +package info.nightscout.sdk.networking + +import info.nightscout.sdk.exceptions.DateHeaderOutOfToleranceException +import info.nightscout.sdk.exceptions.InvalidAccessTokenException +import info.nightscout.sdk.networking.Status.MESSAGE_DATE_HEADER_OUT_OF_TOLERANCE +import info.nightscout.sdk.remotemodel.RemoteAuthResponse +import okhttp3.Interceptor +import okhttp3.Request +import okhttp3.Response +import retrofit2.Retrofit +import java.lang.System.currentTimeMillis + +internal class NSAuthInterceptor(private val refreshToken: String, private val retrofit: Retrofit) : + Interceptor { + + private var jwtToken = "" // the actual Bearer token + + @Suppress("MagicNumber") + override fun intercept(chain: Interceptor.Chain): Response { + + val originalRequest = chain.request() + val authenticationRequest = requestWithBearer(originalRequest) + val initialResponse = chain.proceed(authenticationRequest) + + return when (initialResponse.code) { + 403, 401 -> refreshTokenAndRetry(originalRequest, initialResponse, chain) + else -> initialResponse + } + } + + private fun requestWithBearer(originalRequest: Request): Request = originalRequest.newBuilder() + .addHeader("Date", currentTimeMillis().toString()) + .addHeader("Authorization", "Bearer $jwtToken") + .build() + + @Suppress("MagicNumber") + private fun refreshTokenAndRetry( + originalRequest: Request, + initialResponse: Response, + chain: Interceptor.Chain + ): Response { + + testCanRefresh(initialResponse) + + val authResponseResponse: retrofit2.Response? = retrofit + .create(NightscoutAuthRefreshService::class.java) + .refreshToken(refreshToken) + .execute() + + return when { + authResponseResponse == null -> initialResponse + authResponseResponse.code() in listOf(401, 403) -> throw InvalidAccessTokenException() + authResponseResponse.code() != 200 -> initialResponse + else -> { + authResponseResponse.body()?.token?.let { jwtToken = it } + val newAuthenticationRequest = requestWithBearer(originalRequest) + chain.proceed(newAuthenticationRequest) + } + } + } + + private fun testCanRefresh(initialResponse: Response) { + // Todo: use proper reason code once it is supplied by remote + if (initialResponse.body?.string()?.contains(MESSAGE_DATE_HEADER_OUT_OF_TOLERANCE) == true) { + throw DateHeaderOutOfToleranceException() + } + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/networking/NetworkStackBuilder.kt b/ns-sdk/src/main/java/info/nightscout/sdk/networking/NetworkStackBuilder.kt new file mode 100644 index 0000000000..87d7e6ef4a --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/networking/NetworkStackBuilder.kt @@ -0,0 +1,93 @@ +package info.nightscout.sdk.networking + +import android.content.Context +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import okhttp3.Cache +import okhttp3.OkHttpClient +import okhttp3.logging.HttpLoggingInterceptor +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory +import java.util.concurrent.TimeUnit + +internal object NetworkStackBuilder { + + @JvmSynthetic + internal fun getApi( + baseUrl: String, + context: Context, + accessToken: String, // refresh token + logging: Boolean = false + ): NightscoutRemoteService = getRetrofit( + baseUrl = baseUrl, + context = context, + refreshToken = accessToken, + logging = logging + ).create(NightscoutRemoteService::class.java) + + private fun getRetrofit( + baseUrl: String, + context: Context, + refreshToken: String, + logging: Boolean + ): Retrofit = + Retrofit.Builder() + .baseUrl("https://$baseUrl/api/") + .client( + getOkHttpClient( + context = context, + logging = logging, + refreshToken = refreshToken, + authRefreshRetrofit = getAuthRefreshRetrofit(baseUrl, context, logging) + ) + ) + .addConverterFactory(GsonConverterFactory.create(provideGson())) + .build() + + private fun getAuthRefreshRetrofit( + baseUrl: String, + context: Context, + logging: Boolean + ): Retrofit = + Retrofit.Builder() + .baseUrl("https://$baseUrl/api/") + .client(getAuthRefreshOkHttpClient(context = context, logging = logging)) + .addConverterFactory(GsonConverterFactory.create(provideGson())) + .build() + + private fun getOkHttpClient( + context: Context, + logging: Boolean, + refreshToken: String, + authRefreshRetrofit: Retrofit + ): OkHttpClient = OkHttpClient.Builder().run { + addInterceptor(NSAuthInterceptor(refreshToken, authRefreshRetrofit)) + commonOkHttpSetup(logging, context) + } + + private fun getAuthRefreshOkHttpClient( + context: Context, + logging: Boolean, + ): OkHttpClient = OkHttpClient.Builder().run { commonOkHttpSetup(logging, context) } + + private fun OkHttpClient.Builder.commonOkHttpSetup( + logging: Boolean, + context: Context + ): OkHttpClient { + if (logging) { + addNetworkInterceptor( + HttpLoggingInterceptor().also { it.level = HttpLoggingInterceptor.Level.BODY } + ) + } + cache(Cache(context.cacheDir, OK_HTTP_CACHE_SIZE)) + readTimeout(OK_HTTP_READ_TIMEOUT, TimeUnit.MILLISECONDS) + writeTimeout(OK_HTTP_WRITE_TIMEOUT, TimeUnit.MILLISECONDS) + return build() + } + + private fun provideGson(): Gson = GsonBuilder().create() + + private const val OK_HTTP_CACHE_SIZE = 10L * 1024 * 1024 + private const val OK_HTTP_READ_TIMEOUT = 60L * 1000 + private const val OK_HTTP_WRITE_TIMEOUT = 60L * 1000 +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/networking/NightscoutAuthRefreshService.kt b/ns-sdk/src/main/java/info/nightscout/sdk/networking/NightscoutAuthRefreshService.kt new file mode 100644 index 0000000000..373de8e6a7 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/networking/NightscoutAuthRefreshService.kt @@ -0,0 +1,16 @@ +package info.nightscout.sdk.networking + +import info.nightscout.sdk.remotemodel.RemoteAuthResponse +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Path + +/** + * Created by adrian on 2019-01-04. + */ + +internal interface NightscoutAuthRefreshService { + + @GET("/api/v2/authorization/request/{refreshToken}") + fun refreshToken(@Path("refreshToken") refreshToken: String): Call +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/networking/NightscoutRemoteService.kt b/ns-sdk/src/main/java/info/nightscout/sdk/networking/NightscoutRemoteService.kt new file mode 100644 index 0000000000..4619aef0c0 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/networking/NightscoutRemoteService.kt @@ -0,0 +1,51 @@ +package info.nightscout.sdk.networking + +import com.google.gson.JsonElement +import info.nightscout.sdk.remotemodel.LastModified +import info.nightscout.sdk.remotemodel.RemoteDeviceStatus +import info.nightscout.sdk.remotemodel.NSResponse +import info.nightscout.sdk.remotemodel.RemoteEntry +import info.nightscout.sdk.remotemodel.RemoteStatusResponse +import info.nightscout.sdk.remotemodel.RemoteTreatment +import retrofit2.Response +import retrofit2.http.GET +import retrofit2.http.Path +import retrofit2.http.Query + +/** + * Created by adrian on 2019-12-23. + * + * https://github.com/nightscout/cgm-remote-monitor/blob/master/lib/api3/doc/tutorial.md + * + */ + +internal interface NightscoutRemoteService { + + @GET("v3/status") + // used to get the raw response for more error checking. E.g. to give the user better feedback after new settings. + suspend fun statusVerbose(): Response> + + @GET("v3/status") + suspend fun statusSimple(): NSResponse + + @GET("v3/entries") + suspend fun getEntries(): List + + @GET("v3/lastModified") + suspend fun lastModified(): Response> + + @GET("v3/entries?sort\$desc=date&type=sgv") + suspend fun getSgvs(): Response>> + + @GET("v3/entries") + suspend fun getSgvsNewerThan(@Query(value = "date\$gt", encoded = true) date: Long, @Query("limit") limit: Long): Response>> + + @GET("v3/entries/history/{from}") + suspend fun getSgvsModifiedSince(@Path("from") from: Long): Response>> + + @GET("v3/treatments/history/{from}") + suspend fun getTreatmentsModifiedSince(@Path("from") from: Long, @Query("limit") limit: Long): Response>> + + @GET("v3/devicestatus/history/{from}") + suspend fun getDeviceStatusModifiedSince(@Path("from") from: Long): Response>> +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/networking/Status.kt b/ns-sdk/src/main/java/info/nightscout/sdk/networking/Status.kt new file mode 100644 index 0000000000..d153d37931 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/networking/Status.kt @@ -0,0 +1,6 @@ +package info.nightscout.sdk.networking + +internal object Status { + + const val MESSAGE_DATE_HEADER_OUT_OF_TOLERANCE = "Date header out of tolerance" +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/LastModified.kt b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/LastModified.kt new file mode 100644 index 0000000000..1f7b3344f4 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/LastModified.kt @@ -0,0 +1,23 @@ +package info.nightscout.sdk.remotemodel + +import com.google.gson.annotations.SerializedName +import kotlinx.serialization.Serializable + +/** + * Timestamp of last modification of every collection + * + **/ +@Serializable +data class LastModified( + @SerializedName("collections") val collections: Collections +) { + + @Serializable + data class Collections( + + @SerializedName("devicestatus") var devicestatus: Long, // devicestatus collection + @SerializedName("entries") var entries: Long, // entries collection + @SerializedName("profile") var profile: Long, // profile collection + @SerializedName("treatments") var treatments: Long // treatments collection + ) +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteAuthResponse.kt b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteAuthResponse.kt new file mode 100644 index 0000000000..5e8a9fdb9c --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteAuthResponse.kt @@ -0,0 +1,3 @@ +package info.nightscout.sdk.remotemodel + +internal data class RemoteAuthResponse(val token: String, val iat: Long, val exp: Long) diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteDeviceStatus.kt b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteDeviceStatus.kt new file mode 100644 index 0000000000..26ff3364f0 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteDeviceStatus.kt @@ -0,0 +1,67 @@ +package info.nightscout.sdk.remotemodel + +import com.google.gson.annotations.SerializedName +import kotlinx.serialization.Contextual +import kotlinx.serialization.Serializable +import org.json.JSONObject + +/** + * DeviceStatus coming from uploader or AAPS + * + **/ +@Serializable +data class RemoteDeviceStatus( + @SerializedName("identifier") val identifier: String?, // string Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. + @SerializedName("srvCreated") val srvCreated: Long?, // integer($int64) example: 1525383610088 The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. + @SerializedName("srvModified") val srvModified: Long?, // integer($int64) example: 1525383610088 The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). + @SerializedName("created_at") val createdAt: String?, // string or string timestamp on previous version of api, in my examples, a lot of treatments don't have date, only created_at, some of them with string others with long... + @SerializedName("uploaderBattery") val uploaderBattery: Int?,// integer($int64) + @SerializedName("device") val device: String?, // "openaps://samsung SM-G970F" + + @SerializedName("uploader") val uploader: Uploader?, + @SerializedName("pump") val pump: Pump?, + @SerializedName("openaps") val openaps: OpenAps?, + @SerializedName("configuration") val configuration: Configuration? +) { + + @Serializable data class Pump( + @SerializedName("clock") val clock: String?, // timestamp in ISO + @SerializedName("reservoir") val reservoir: Double?, + @SerializedName("reservoir_display_override") val reservoirDisplayOverride: String?, + @SerializedName("battery") val battery: Battery?, + @SerializedName("status") val status: Status?, + @Contextual @SerializedName("extended") val extended: JSONObject? // Gson, content depending on pump driver + ) { + + @Serializable data class Battery( + @SerializedName("percent") val percent: Int?, + @SerializedName("voltage") val voltage: Double? + ) + + @Serializable data class Status( + @SerializedName("status") val status: String?, + @SerializedName("timestamp") val timestamp: String? + ) + } + + @Serializable data class OpenAps( + @Contextual @SerializedName("suggested") val suggested: JSONObject?, // Gson + @Contextual @SerializedName("enacted") val enacted: JSONObject?, // Gson + @Contextual @SerializedName("iob") val iob: JSONObject? // Gson + ) + + @Serializable data class Uploader( + @SerializedName("battery") val battery: Int?, + ) + + @Serializable data class Configuration( + @SerializedName("pump") val pump: String?, + @SerializedName("version") val version: String?, + @SerializedName("insulin") val insulin: Int?, + @SerializedName("sensitivity") val sensitivity: Int?, + @Contextual @SerializedName("insulinConfiguration") val insulinConfiguration: JSONObject?, + @Contextual @SerializedName("sensitivityConfiguration") val sensitivityConfiguration: JSONObject?, + @Contextual @SerializedName("overviewConfiguration") val overviewConfiguration: JSONObject?, + @Contextual @SerializedName("safetyConfiguration") val safetyConfiguration: JSONObject? + ) +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteEntry.kt b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteEntry.kt new file mode 100644 index 0000000000..c4b3135579 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteEntry.kt @@ -0,0 +1,37 @@ +package info.nightscout.sdk.remotemodel + +import com.google.gson.annotations.SerializedName +import info.nightscout.sdk.localmodel.treatment.EventType + +/* +* Depending on the type, different other fields are present. +* Those technically need to be optional. +* +* On upload a sanity check still needs to be done to verify that all mandatory fields for that type are there. +* +* TODO: Find out all types with their optional and mandatory fields +* +* */ +internal data class RemoteEntry( + @SerializedName("type") val type: String, // sgv, mbg, cal, etc; Bolus type NORMAL, SMB, PRIMING + @SerializedName("sgv") val sgv: Double?, // number The glucose reading. (only available for sgv types) + @SerializedName("dateString") val dateString: String, + @SerializedName("date") val date: Long, // required ? TODO: date and dateString are redundant - are both needed? how to handle inconsistency then? Only expose one to clients? + @SerializedName("device") val device: String?, // The device from which the data originated (including serial number of the device, if it is relevant and safe). + @SerializedName("direction") val direction: String?, // TODO: what implicit convention for the directions exists? + @SerializedName("identifier") val identifier: String, + @SerializedName("srvModified") val srvModified: Long, + @SerializedName("srvCreated") val srvCreated: Long, + // Philoul Others fields below found in API v3 doc + // @SerializedName("app") val app : String, // TODO required ? Application or system in which the record was entered by human or device for the first time. + @SerializedName("utcOffset") val utcOffset: Long?, // Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming document) or it is + // automatically parsed from the date field. + @SerializedName("subject") val subject: String?, // Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed token or JWT. + @SerializedName("modifiedBy") val modifiedBy: String?, // Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. + @SerializedName("isValid") val isValid: Boolean?, // A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) + @SerializedName("isReadOnly") val isReadOnly: Boolean?, // A flag set by client that locks the document from any changes. Every document marked with isReadOnly=true is forever immutable and cannot even be deleted. + @SerializedName("noise") val noise: Int?, // 0 or 1 found in the export, I don't know if other values possible ? + @SerializedName("filtered") val filtered: Double?, // The raw filtered value directly from CGM transmitter. (only available for sgv types) + @SerializedName("unfiltered") val unfiltered: Double?, // The raw unfiltered value directly from CGM transmitter. (only available for sgv types) + @SerializedName("units") val units: String?, // The units for the glucose value, mg/dl or mmol/l. It is strongly recommended to fill in this field. +) diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteStatusResponse.kt b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteStatusResponse.kt new file mode 100644 index 0000000000..15055f9051 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteStatusResponse.kt @@ -0,0 +1,47 @@ +package info.nightscout.sdk.remotemodel + +import com.google.gson.annotations.SerializedName + +internal data class NSResponse(val result: T?) + +internal data class RemoteStatusResponse( + @SerializedName("version") val version: String, + @SerializedName("apiVersion") val apiVersion: String, + @SerializedName("srvDate") val srvDate: Long, + @SerializedName("storage") val storage: RemoteStorage, + @SerializedName("apiPermissions") val apiPermissions: RemoteApiPermissions +) + +internal data class RemoteStorage( + @SerializedName("storage") val storage: String, + @SerializedName("version") val version: String +) + +internal data class RemoteApiPermissions( + @SerializedName("devicestatus") val deviceStatus: RemoteApiPermission, + @SerializedName("entries") val entries: RemoteApiPermission, + @SerializedName("food") val food: RemoteApiPermission, + @SerializedName("profile") val profile: RemoteApiPermission, + @SerializedName("settings") val settings: RemoteApiPermission, + @SerializedName("treatments") val treatments: RemoteApiPermission +) + +internal typealias RemoteApiPermission = String + +internal val RemoteApiPermission.create: Boolean + get() = this.contains('c') + +internal val RemoteApiPermission.read: Boolean + get() = this.contains('r') + +internal val RemoteApiPermission.update: Boolean + get() = this.contains('u') + +internal val RemoteApiPermission.delete: Boolean + get() = this.contains('d') + +internal val RemoteApiPermission.readCreate: Boolean + get() = this.read && this.create + +internal val RemoteApiPermission.full: Boolean + get() = this.create && this.read && this.update && this.delete diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteTreatment.kt b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteTreatment.kt new file mode 100644 index 0000000000..80929a2133 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/RemoteTreatment.kt @@ -0,0 +1,97 @@ +package info.nightscout.sdk.remotemodel + +import com.google.gson.Gson +import com.google.gson.annotations.SerializedName +import info.nightscout.sdk.localmodel.treatment.EventType +import org.joda.time.DateTime +import org.joda.time.format.ISODateTimeFormat +import org.json.JSONObject + +/* +* Depending on the type, different other fields are present. +* Those technically need to be optional. +* +* On upload a sanity check still needs to be done to verify that all mandatory fields for that type are there. +* +* TODO: Find out all types with their optional and mandatory fields +* +* */ +internal data class RemoteTreatment( + @SerializedName("identifier") val identifier: String, // string Main addressing, required field that identifies document in the collection. The client should not create the identifier, the server automatically assigns it when the document is inserted. + @SerializedName("date") val date: Long?, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix epoch in milliseconds (1525383610088), Unix epoch in seconds (1525383610), ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') + @SerializedName("mills") val mills: Long?, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix + @SerializedName("timestamp") val timestamp: Long?, // integer($int64) or string required timestamp when the record or event occurred, you can choose from three input formats Unix epoch in milliseconds (1525383610088), Unix epoch in seconds (1525383610), ISO 8601 with optional timezone ('2018-05-03T21:40:10.088Z' or '2018-05-03T23:40:10.088+02:00') + @SerializedName("created_at") val created_at: String, // integer($int64) or string timestamp on previous version of api, in my examples, a lot of treatments don't have date, only created_at, some of them with string others with long... + @SerializedName("utcOffset") val utcOffset: Long?, // integer Local UTC offset (timezone) of the event in minutes. This field can be set either directly by the client (in the incoming + // document) or it is automatically parsed from the date field. + // @SerializedName("app") val app : String, // TODO required ? Application or system in which the record was entered by human or device for the first time. + @SerializedName("device") val device: String?, // string The device from which the data originated (including serial number of the device, if it is relevant and safe). + @SerializedName("srvCreated") val srvCreated: Long, // integer($int64) example: 1525383610088 The server's timestamp of document insertion into the database (Unix epoch in ms). This field appears only for documents which were inserted by API v3. + @SerializedName("subject") val subject: String?, // string Name of the security subject (within Nightscout scope) which has created the document. This field is automatically set by the server from the passed token or JWT. + @SerializedName("srvModified") val srvModified: Long, // integer($int64) example: 1525383610088 The server's timestamp of the last document modification in the database (Unix epoch in ms). This field appears only for documents which were somehow modified by API v3 (inserted, updated or deleted). + @SerializedName("modifiedBy") val modifiedBy: String?, // string Name of the security subject (within Nightscout scope) which has patched or deleted the document for the last time. This field is automatically set by the server. + @SerializedName("isValid") val isValid: Boolean?, // boolean A flag set by the server only for deleted documents. This field appears only within history operation and for documents which were deleted by API v3 (and they always have a false value) + @SerializedName("isReadOnly") val isReadOnly: Boolean?, // boolean A flag set by client that locks the document from any changes. Every document marked with isReadOnly=true is forever immutable and cannot even be deleted. + @SerializedName("eventType") val eventType: EventType, // string "BG Check", "Snack Bolus", "Meal Bolus", "Correction Bolus", "Carb Correction", "Combo Bolus", "Announcement", "Note", "Question", "Exercise", "Site Change", "Sensor Start", "Sensor Change", "Pump Battery Change", "Insulin Change", "Temp Basal", "Profile Switch", "D.A.D. Alert", "Temporary Target", "OpenAPS Offline", "Bolus Wizard" + @SerializedName("glucose") val glucose: Double?, // double Current glucose + @SerializedName("glucoseType") val glucoseType: String?, // string example: "Sensor", "Finger", "Manual" + @SerializedName("units") val units: String?, // string The units for the glucose value, mg/dl or mmol/l. It is strongly recommended to fill in this field. + @SerializedName("carbs") val carbs: Double?, // number... Amount of carbs given. + @SerializedName("protein") val protein: Int?, // number... Amount of protein given. + @SerializedName("fat") val fat: Int?, // number... Amount of fat given. + @SerializedName("insulin") val insulin: Double?, // number... Amount of insulin, if any. + @SerializedName("duration") val duration: Long?, // number... Duration in minutes. + @SerializedName("durationInMilliseconds") val durationInMilliseconds: Long?, // number... Duration in milliseconds. + @SerializedName("preBolus") val preBolus: Int?, // number... How many minutes the bolus was given before the meal started. + @SerializedName("splitNow") val splitNow: Int?, // number... Immediate part of combo bolus (in percent). + @SerializedName("splitExt") val splitExt: Int?, // number... Extended part of combo bolus (in percent). + @SerializedName("percent") val percent: Double?, // number... Eventual basal change in percent. + @SerializedName("absolute") val absolute: Double?, // number... Eventual basal change in absolute value (insulin units per hour). + @SerializedName("targetTop") val targetTop: Double?, // number... Top limit of temporary target. + @SerializedName("targetBottom") val targetBottom: Double?, // number... Bottom limit of temporary target. + @SerializedName("profile") val profile: String?, // string Name of the profile to which the pump has been switched. + @SerializedName("reason") val reason: String?, // string For example the reason why the profile has been switched or why the temporary target has been set. + @SerializedName("notes") val notes: String?, // string Description/notes of treatment. + @SerializedName("enteredBy") val enteredBy: String?, // string Who entered the treatment. + + @SerializedName("endId") val endId: Long?, // long id of record which ended this + @SerializedName("pumpId") val pumpId: Long?, // long or "Meal Bolus", "Correction Bolus", "Combo Bolus" ex 4102 not sure if long or int + @SerializedName("pumpType") val pumpType: String?, // string "Meal Bolus", "Correction Bolus", "Combo Bolus" ex "ACCU_CHEK_INSIGHT_BLUETOOTH", + @SerializedName("pumpSerial") val pumpSerial: String?, // string "Meal Bolus", "Correction Bolus", "Combo Bolus" "33013206", + + // other fields found in examples but not in documentation + @SerializedName("profileJson") val profileJson: String?, // string "Profile Switch" ex json toString "{\"units\":\"mg\\/dl\",\"dia\":5,\"timezone\":\"Africa\\/Cairo\", + // \"sens\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":60},{\"time\":\"07:00\",\"timeAsSeconds\":25200,\"value\":60},{\"time\":\"08:00\",\"timeAsSeconds\":28800,\"value\":61.33333333333333},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":65.33333333333333},{\"time\":\"10:00\",\"timeAsSeconds\":36000,\"value\":69.33333333333333},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":73.33333333333333},{\"time\":\"13:00\",\"timeAsSeconds\":46800,\"value\":72},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":68},{\"time\":\"15:00\",\"timeAsSeconds\":54000,\"value\":65.33333333333333},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":65.33333333333333}],\"carbratio\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":5.7333333333333325},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":7.333333333333333},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":6.666666666666666}],\"basal\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":0.5249999999999999},{\"time\":\"01:00\",\"timeAsSeconds\":3600,\"value\":0.585},{\"time\":\"02:00\",\"timeAsSeconds\":7200,\"value\":0.6375},{\"time\":\"03:00\",\"timeAsSeconds\":10800,\"value\":0.5625},{\"time\":\"04:00\",\"timeAsSeconds\":14400,\"value\":0.4575},{\"time\":\"05:00\",\"timeAsSeconds\":18000,\"value\":0.5175},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":0.48},{\"time\":\"07:00\",\"timeAsSeconds\":25200,\"value\":0.51},{\"time\":\"08:00\",\"timeAsSeconds\":28800,\"value\":0.48750000000000004},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":0.48},{\"time\":\"10:00\",\"timeAsSeconds\":36000,\"value\":0.48750000000000004},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":0.5025000000000001},{\"time\":\"12:00\",\"timeAsSeconds\":43200,\"value\":0.5549999999999999},{\"time\":\"13:00\",\"timeAsSeconds\":46800,\"value\":0.5700000000000001},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":0.5700000000000001},{\"time\":\"15:00\",\"timeAsSeconds\":54000,\"value\":0.5775},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":0.51},{\"time\":\"17:00\",\"timeAsSeconds\":61200,\"value\":0.54},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":0.48750000000000004},{\"time\":\"19:00\",\"timeAsSeconds\":68400,\"value\":0.5249999999999999},{\"time\":\"20:00\",\"timeAsSeconds\":72000,\"value\":0.46499999999999997},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":0.46499999999999997},{\"time\":\"22:00\",\"timeAsSeconds\":79200,\"value\":0.43499999999999994},{\"time\":\"23:00\",\"timeAsSeconds\":82800,\"value\":0.41250000000000003}],\"target_low\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":100},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":90},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":100},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":90},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":100},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":90},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":100}],\"target_high\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":100},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":90},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":100},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":90},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":100},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":90},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":100}]}", + @SerializedName("originalProfileName") val originalProfileName: String?, // string "Effective Profile Switch" + @SerializedName("originalCustomizedName") val originalCustomizedName: String?, // string "Effective Profile Switch" + @SerializedName("originalTimeshift") val originalTimeshift: Long?, // long "Effective Profile Switch" + @SerializedName("originalPercentage") val originalPercentage: Int?, // int "Effective Profile Switch" + @SerializedName("originalDuration") val originalDuration: Long?, // long "Effective Profile Switch" + @SerializedName("originalEnd") val originalEnd: Long?, // long "Effective Profile Switch" + + @SerializedName("bolusCalculatorResult") val bolusCalculatorResult: String?, // string "Bolus Wizard" json toString ex "bolusCalculatorResult": "{\"basalIOB\":-0.247,\"bolusIOB\":-1.837,\"carbs\":45.0,\"carbsInsulin\":9.0,\"cob\":0.0,\"cobInsulin\":0.0,\"dateCreated\":1626202788810,\"glucoseDifference\":44.0,\"glucoseInsulin\":0.8979591836734694,\"glucoseTrend\":5.5,\"glucoseValue\":134.0,\"ic\":5.0,\"id\":331,\"interfaceIDs_backing\":{\"nightscoutId\":\"60ede2a4c574da0004a3869d\"},\"isValid\":true,\"isf\":49.0,\"note\":\"\",\"otherCorrection\":0.0,\"percentageCorrection\":90,\"profileName\":\"Tuned 13/01 90%Lyum\",\"superbolusInsulin\":0.0,\"targetBGHigh\":90.0,\"targetBGLow\":90.0,\"timestamp\":1626202783325,\"totalInsulin\":7.34,\"trendInsulin\":0.336734693877551,\"utcOffset\":7200000,\"version\":1,\"wasBasalIOBUsed\":true,\"wasBolusIOBUsed\":true,\"wasCOBUsed\":true,\"wasGlucoseUsed\":true,\"wasSuperbolusUsed\":false,\"wasTempTargetUsed\":false,\"wasTrendUsed\":true,\"wereCarbsUsed\":false}", + @SerializedName("type") val type: String?, // string "Meal Bolus", "Correction Bolus", "Combo Bolus", "Temp Basal" type of bolus "NORMAL", "SMB", "FAKE_EXTENDED" + @SerializedName("isSMB") val isSMB: Boolean, // boolean "Meal Bolus", "Correction Bolus", "Combo Bolus" + @SerializedName("enteredinsulin") val enteredinsulin: Double?, // number... "Combo Bolus" insulin is missing only enteredinsulin field found + @SerializedName("relative") val relative: Double?, // number... "Combo Bolus", "extendedEmulated" (not in doc see below) + @SerializedName("isEmulatingTempBasal") val isEmulatingTempBasal: Boolean, // boolean "Combo Bolus", "extendedEmulated" (not in doc see below) + @SerializedName("isAnnouncement") val isAnnouncement: Boolean, // boolean "Announcement" + @SerializedName("rate") val rate: Double?, // Double "Temp Basal" absolute rate (could be calculated with percent and profile information...) + @SerializedName("extendedEmulated") val extendedEmulated: RemoteTreatment?, // Gson of emulated EB + @SerializedName("timeshift") val timeshift: Long, // integer "Profile Switch" + @SerializedName("percentage") val percentage: Int?, // integer "Profile Switch" +) { + + fun timestamp(): Long { + return date ?: mills ?: timestamp ?: fromISODateString(created_at) + } + + private fun fromISODateString(isoDateString: String): Long = + try { + val parser = ISODateTimeFormat.dateTimeParser() + val dateTime = DateTime.parse(isoDateString, parser) + dateTime.toDate().time + } catch (e: Exception) { + 0L + } +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/examples.json b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/examples.json new file mode 100644 index 0000000000..87b19cad8b --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/remotemodel/examples.json @@ -0,0 +1,490 @@ +// Entry +{ + "device": "xDrip-Follower", + "date": 1549414398005, + "dateString": "2019-02-06T01:53:18.005+0100", + "sgv": 98, + "delta": -1.132, + "direction": "Flat", + "type": "sgv", + "filtered": 90336, + "unfiltered": 89712, + "rssi": 100, + "noise": 1, + "sysTime": "2019-02-06T01:53:18.005+0100", + "identifier": "5c5a3007e0196f4d3d9aeafc", + "srvModified": 1549414398005, + "srvCreated": 1549414398005 +}, + +// G6 AAPS +{ + "_id": "60bace9f51e8150004f0973a", + "device": "AndroidAPS-DexcomG6", + "date": 1622855221000, + "dateString": "2021-06-05T01:07:01.000Z", + "isValid": true, + "sgv": 76, + "direction": "Flat", // DoubleDown, SingleDown, FortyFiveDown, Flat, FortyFiveUp, SingleUp, DoubleUp + "type": "sgv", + "created_at": "2021-06-05T01:08:47.234Z" +}, +// G6 DEXCOM APP Share +{ + "_id": "60cd4e7d5bcdeb30e43a248d", + "sgv": 90, + "date": 1624067551000, + "dateString": "2021-06-19T01:52:31.000Z", + "trend": 4, // 7 , 6 , 5 , 4 , 3 , 2 , 1 + "direction": "Flat", // DoubleDown, SingleDown, FortyFiveDown, Flat, FortyFiveUp, SingleUp, DoubleUp + "device": "share2", + "type": "sgv", + "utcOffset": 0, + "sysTime": "2021-06-19T01:52:31.000Z" +}, +// FSL1 xDrip +{ + "device": "AndroidAPS", + "date": 1588557121000, + "dateString": "2020-05-04T01:52:01Z", + "sgv": 76, + "direction": "Flat", // DoubleDown, SingleDown, FortyFiveDown, Flat, FortyFiveUp, SingleUp, DoubleUp + "type": "sgv", + "systime": "2020-05-04T01:52:01Z", + "utcOffset": 120 +}, +// LimiTTer xDrip +{ + "_id": "5ed06c9a0ea4dcb70fac6cc7", + "device": "xDrip-LimiTTer", + "date": 1590717591357, + "dateString": "2020-05-29T01:59:51.357Z", + "sgv": 114, + "delta": -2.942, + "direction": "Flat", + "type": "sgv", + "filtered": 127411.75515, + "unfiltered": 127411.75515, + "rssi": 100, + "noise": 1, + "sysTime": "2020-05-29T01:59:51.357Z", + "utcOffset": 120 +}, + +// API v3 requests for treatments +{ + "eventType": "BG Check", + "created_at": 1616966443000, + "units": "mg/dl", + "glucose": 57, + "NSCLIENT_ID": "1616966443000", + "identifier": "6060f32e9b9c5900045c858b", + "srvModified": 1616966443000, + "srvCreated": 1616966443000 +}, +{ + "eventType": "BG Check", + "created_at": 1617365936000, + "enteredBy": "AndroidAPS", + "units": "mg/dl", + "notes": "Coucou", + "glucose": 94, + "glucoseType": "Finger", + "identifier": "606727c058f71500041e1ed3", + "srvModified": 1617365936000, + "srvCreated": 1617365936000 +}, +{ + "eventType": "Meal Bolus", + "carbs": 45, + "created_at": "2021-07-13T18:19:43.325Z", + "isValid": true, + "date": 1626200383325, + "identifier": "60ede2a4c574da0004a3869c", + "srvModified": 1626200383325, + "srvCreated": 1626200383325 +}, +{ + "eventType": "Meal Bolus", + "insulin": 8.1, + "created_at": "2021-07-13T11:25:12.664Z", + "date": 1626175512664, + "type": "NORMAL", + "isValid": true, + "isSMB": false, + "pumpId": 4102, + "pumpType": "ACCU_CHEK_INSIGHT_BLUETOOTH", + "pumpSerial": "33013206", + "identifier": "60ed782dc574da0004a38595", + "srvModified": 1626175512664, + "srvCreated": 1626175512664 +}, +{ + "eventType": "Correction Bolus", + "insulin": 0.25, + "created_at": "2021-07-13T20:44:14.441Z", + "date": 1626209054441, + "type": "SMB", + "isValid": true, + "isSMB": true, + "pumpId": 4148, + "pumpType": "ACCU_CHEK_INSIGHT_BLUETOOTH", + "pumpSerial": "33013206", + "identifier": "60edfb34c574da0004a386d4", + "srvModified": 1626209054441, + "srvCreated": 1626209054441 +},{ + "eventType": "Carb Correction", + "carbs": 5, + "created_at": "2021-06-17T09:00:34.000Z", + "isValid": true, + "date": 1623920434000, + "identifier": "60cb2f351a94d4000483b692", + "srvModified": 1623920434000, + "srvCreated": 1623920434000 +}, +{ +"created_at": "2021-05-28T19:46:43.851Z", +"enteredBy": "openaps://AndroidAPS", +"eventType": "Combo Bolus", +"duration": 5, +"splitNow": 0, +"splitExt": 100, +"enteredinsulin": 0.7890262726962469, +"relative": 8.893749414356174, +"isValid": true, +"isEmulatingTempBasal": false, +"pumpId": 4, +"pumpType": "ACCU_CHEK_INSIGHT_BLUETOOTH", +"pumpSerial": "33010032", +"identifier": "60b148b419cf4300040b0195", +"srvModified": 1622231203851, +"srvCreated": 1622231203851 +}, +{ + "eventType": "Announcement", + "created_at": 1617350431592, + "enteredBy": "AndroidAPS", + "units": "mg/dl", + "notes": "5g de glucides requis dans 40 min.", + "isAnnouncement": true, + "identifier": "6066cf2508a6ed0004b4ed44", + "srvModified": 1617350431592, + "srvCreated": 1617350431592 +}, +{ + "eventType": "Note", + "created_at": 1617023462485, + "units": "mg/dl", + "notes": "AndroidAPS started - Logicom Le Hola FR", + "identifier": "6061d20b17619800047216b2", + "srvModified": 1617023462485, + "srvCreated": 1617023462485 +}, +{ + "eventType": "Exercise", + "created_at": 1617373066000, + "enteredBy": "AndroidAPS", + "units": "mg/dl", + "duration": 20, + "notes": "ten tab", + "identifier": "606727a658f71500041e1ed2", + "srvModified": 1617373066000, + "srvCreated": 1617373066000 +}, +{ + "eventType": "Exercise", + "isValid": true, + "created_at": "2021-07-09T18:15:22.000Z", + "enteredBy": "AndroidAPS", + "units": "mg/dl", + "duration": 105, + "notes": "🏓", + "identifier": "60e8b223b98ea2000472cbb3", + "srvModified": 1625854522000, + "srvCreated": 1625854522000 +}, +{ + "eventType": "Site Change", + "created_at": 1616312250000, + "units": "mg/dl", + "notes": "", + "NSCLIENT_ID": "1616312250000", + "identifier": "6056f7c1bc2dc60004e75499", + "srvModified": 1616312250000, + "srvCreated": 1616312250000 +}, +{ + "eventType": "Sensor Change", + "created_at": 1617373059000, + "enteredBy": "AndroidAPS", + "units": "mg/dl", + "identifier": "6067278d58f71500041e1ed1", + "srvModified": 1617373059000, + "srvCreated": 1617373059000 +}, +{ + "enteredBy": "AndroidAPS-DexcomG6", + "created_at": 1617799461000, + "eventType": "Sensor Change", + "NSCLIENT_ID": "1617961262771", + "identifier": "60702190403172000451e5dc", + "srvModified": 1617799461000, + "srvCreated": 1617799461000 +}, +{ + "eventType": "Pump Battery Change", + "created_at": 1616517575000, + "enteredBy": "AndroidAPS", + "units": "mg/dl", + "notes": "à peu près...", + "NSCLIENT_ID": "1616517575000", + "identifier": "605cbce3f9ed3b0004694ee8", + "srvModified": 1616517575000, + "srvCreated": 1616517575000 +}, +{ + "created_at": 1617576811000, + "eventType": "Pump Battery Change", + "NSCLIENT_ID": "1617577097394", + "glucoseType": "Manual", + "isValid": true, + "units": "mg/dl", + "identifier": "606a448d7c31f00004bb47ac", + "srvModified": 1617576811000, + "srvCreated": 1617576811000 +}, +{ + "eventType": "Insulin Change", + "created_at": 1616342559000, + "units": "mg/dl", + "notes": "Ajout manuel pour UE", + "NSCLIENT_ID": "1616342559000", + "identifier": "60576e6b5a34f900043e25f6", + "srvModified": 1616342559000, + "srvCreated": 1616342559000 +}, +{ + "created_at": "2021-07-13T20:44:12.891Z", + "enteredBy": "openaps://AndroidAPS", + "eventType": "Temp Basal", + "isValid": true, + "duration": 60, + "rate": 0, + "type": "NORMAL", + "absolute": 0, + "pumpId": 284835, + "pumpType": "ACCU_CHEK_INSIGHT_BLUETOOTH", + "pumpSerial": "33013206", + "identifier": "60edfb34c574da0004a386d3", + "srvModified": 1626209052891, + "srvCreated": 1626209052891 +}, +{ + "created_at": "2021-07-13T20:40:29.896Z", + "enteredBy": "openaps://AndroidAPS", + "eventType": "Temp Basal", + "isValid": true, + "duration": 3, + "rate": 2.4391549295774646, + "type": "FAKE_EXTENDED", + "absolute": 2.4391549295774646, + "pumpId": 4147, + "pumpType": "ACCU_CHEK_INSIGHT_BLUETOOTH", + "pumpSerial": "33013206", + "extendedEmulated": { + "created_at": "2021-07-13T20:40:29.896Z", + "enteredBy": "openaps://AndroidAPS", + "eventType": "Combo Bolus", + "duration": 3, + "splitNow": 0, + "splitExt": 100, + "enteredinsulin": 0.11, + "relative": 1.8591549295774648, + "isValid": true, + "isEmulatingTempBasal": true, + "pumpId": 4147, + "pumpType": "ACCU_CHEK_INSIGHT_BLUETOOTH", + "pumpSerial": "33013206" + }, + "identifier": "60edfa51c574da0004a386d0", + "srvModified": 1626208829896, + "srvCreated": 1626208829896 +}, +{ + "eventType": "OpenAPS Offline", + "created_at": 1616391934628, + "enteredBy": "openaps://AndroidAPS", + "units": "mg/dl", + "duration": 15, + "NSCLIENT_ID": "1616391934628", + "identifier": "60582f005a34f900043e2845", + "srvModified": 1616391934628, + "srvCreated": 1616391934628 +}, +{ + "created_at": "2021-06-26T13:36:47.000Z", + "enteredBy": "openaps://AndroidAPS", + "isValid": true, + "eventType": "Profile Switch", + "duration": 0, + "profile": "Tuned 13/01 90%Lyum", + "profileJson": "{\"units\":\"mg\\/dl\",\"dia\":5,\"timezone\":\"Africa\\/Cairo\",\"sens\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":45},{\"time\":\"07:00\",\"timeAsSeconds\":25200,\"value\":45},{\"time\":\"08:00\",\"timeAsSeconds\":28800,\"value\":46},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":49},{\"time\":\"10:00\",\"timeAsSeconds\":36000,\"value\":52},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":55},{\"time\":\"13:00\",\"timeAsSeconds\":46800,\"value\":54},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":51},{\"time\":\"15:00\",\"timeAsSeconds\":54000,\"value\":49},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":49}],\"carbratio\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":4.3},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":5.5},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":5}],\"basal\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":0.7},{\"time\":\"01:00\",\"timeAsSeconds\":3600,\"value\":0.78},{\"time\":\"02:00\",\"timeAsSeconds\":7200,\"value\":0.85},{\"time\":\"03:00\",\"timeAsSeconds\":10800,\"value\":0.75},{\"time\":\"04:00\",\"timeAsSeconds\":14400,\"value\":0.61},{\"time\":\"05:00\",\"timeAsSeconds\":18000,\"value\":0.69},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":0.64},{\"time\":\"07:00\",\"timeAsSeconds\":25200,\"value\":0.68},{\"time\":\"08:00\",\"timeAsSeconds\":28800,\"value\":0.65},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":0.64},{\"time\":\"10:00\",\"timeAsSeconds\":36000,\"value\":0.65},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":0.67},{\"time\":\"12:00\",\"timeAsSeconds\":43200,\"value\":0.74},{\"time\":\"13:00\",\"timeAsSeconds\":46800,\"value\":0.76},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":0.76},{\"time\":\"15:00\",\"timeAsSeconds\":54000,\"value\":0.77},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":0.68},{\"time\":\"17:00\",\"timeAsSeconds\":61200,\"value\":0.72},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":0.65},{\"time\":\"19:00\",\"timeAsSeconds\":68400,\"value\":0.7},{\"time\":\"20:00\",\"timeAsSeconds\":72000,\"value\":0.62},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":0.62},{\"time\":\"22:00\",\"timeAsSeconds\":79200,\"value\":0.58},{\"time\":\"23:00\",\"timeAsSeconds\":82800,\"value\":0.55}],\"target_low\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":100},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":90},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":100},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":90},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":100},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":90},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":100}],\"target_high\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":100},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":90},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":100},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":90},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":100},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":90},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":100}]}", + "timeshift": 0, + "percentage": 100, + "identifier": "60d72d80aec46a0004f95163", + "srvModified": 1624714607000, + "srvCreated": 1624714607000 +}, +{ + "created_at": "2021-06-13T07:20:33.000Z", + "enteredBy": "openaps://AndroidAPS", + "isValid": true, + "eventType": "Profile Switch", + "duration": 150, + "profile": "Tuned 13/01 90%Lyum(75%)", + "profileJson": "{\"units\":\"mg\\/dl\",\"dia\":5,\"timezone\":\"Africa\\/Cairo\",\"sens\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":60},{\"time\":\"07:00\",\"timeAsSeconds\":25200,\"value\":60},{\"time\":\"08:00\",\"timeAsSeconds\":28800,\"value\":61.33333333333333},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":65.33333333333333},{\"time\":\"10:00\",\"timeAsSeconds\":36000,\"value\":69.33333333333333},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":73.33333333333333},{\"time\":\"13:00\",\"timeAsSeconds\":46800,\"value\":72},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":68},{\"time\":\"15:00\",\"timeAsSeconds\":54000,\"value\":65.33333333333333},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":65.33333333333333}],\"carbratio\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":5.7333333333333325},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":7.333333333333333},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":6.666666666666666}],\"basal\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":0.5249999999999999},{\"time\":\"01:00\",\"timeAsSeconds\":3600,\"value\":0.585},{\"time\":\"02:00\",\"timeAsSeconds\":7200,\"value\":0.6375},{\"time\":\"03:00\",\"timeAsSeconds\":10800,\"value\":0.5625},{\"time\":\"04:00\",\"timeAsSeconds\":14400,\"value\":0.4575},{\"time\":\"05:00\",\"timeAsSeconds\":18000,\"value\":0.5175},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":0.48},{\"time\":\"07:00\",\"timeAsSeconds\":25200,\"value\":0.51},{\"time\":\"08:00\",\"timeAsSeconds\":28800,\"value\":0.48750000000000004},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":0.48},{\"time\":\"10:00\",\"timeAsSeconds\":36000,\"value\":0.48750000000000004},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":0.5025000000000001},{\"time\":\"12:00\",\"timeAsSeconds\":43200,\"value\":0.5549999999999999},{\"time\":\"13:00\",\"timeAsSeconds\":46800,\"value\":0.5700000000000001},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":0.5700000000000001},{\"time\":\"15:00\",\"timeAsSeconds\":54000,\"value\":0.5775},{\"time\":\"16:00\",\"timeAsSeconds\":57600,\"value\":0.51},{\"time\":\"17:00\",\"timeAsSeconds\":61200,\"value\":0.54},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":0.48750000000000004},{\"time\":\"19:00\",\"timeAsSeconds\":68400,\"value\":0.5249999999999999},{\"time\":\"20:00\",\"timeAsSeconds\":72000,\"value\":0.46499999999999997},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":0.46499999999999997},{\"time\":\"22:00\",\"timeAsSeconds\":79200,\"value\":0.43499999999999994},{\"time\":\"23:00\",\"timeAsSeconds\":82800,\"value\":0.41250000000000003}],\"target_low\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":100},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":90},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":100},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":90},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":100},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":90},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":100}],\"target_high\":[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":100},{\"time\":\"06:00\",\"timeAsSeconds\":21600,\"value\":90},{\"time\":\"09:00\",\"timeAsSeconds\":32400,\"value\":100},{\"time\":\"11:00\",\"timeAsSeconds\":39600,\"value\":90},{\"time\":\"14:00\",\"timeAsSeconds\":50400,\"value\":100},{\"time\":\"18:00\",\"timeAsSeconds\":64800,\"value\":90},{\"time\":\"21:00\",\"timeAsSeconds\":75600,\"value\":100}]}", + "timeshift": 0, + "percentage": 100, + "identifier": "60c5b1f41b3715000420af27", + "srvModified": 1623568833000, + "srvCreated": 1623568833000 +}, +{ + "eventType": "Temporary Target", + "duration": 60, + "isValid": true, + "created_at": "2021-07-10T05:04:11.566Z", + "enteredBy": "AndroidAPS", + "reason": "Automation", + "targetBottom": 110, + "targetTop": 110, + "units": "mg/dl", + "identifier": "60e92a644fc2eb00045ece1b", + "srvModified": 1625893451566, + "srvCreated": 1625893451566 +}, +{ + "eventType": "Temporary Target", + "duration": 120, + "isValid": true, + "created_at": "2021-07-09T20:30:21.627Z", + "enteredBy": "AndroidAPS", + "reason": "Hypo", + "targetBottom": 140, + "targetTop": 140, + "units": "mg/dl", + "identifier": "60e8b1f2b98ea2000472cbb1", + "srvModified": 1625862621627, + "srvCreated": 1625862621627 +}, +{ + "eventType": "Bolus Wizard", + "created_at": "2021-07-13T18:59:43.325Z", + "isValid": true, + "bolusCalculatorResult": "{\"basalIOB\":-0.247,\"bolusIOB\":-1.837,\"carbs\":45.0,\"carbsInsulin\":9.0,\"cob\":0.0,\"cobInsulin\":0.0,\"dateCreated\":1626202788810,\"glucoseDifference\":44.0,\"glucoseInsulin\":0.8979591836734694,\"glucoseTrend\":5.5,\"glucoseValue\":134.0,\"ic\":5.0,\"id\":331,\"interfaceIDs_backing\":{\"nightscoutId\":\"60ede2a4c574da0004a3869d\"},\"isValid\":true,\"isf\":49.0,\"note\":\"\",\"otherCorrection\":0.0,\"percentageCorrection\":90,\"profileName\":\"Tuned 13/01 90%Lyum\",\"superbolusInsulin\":0.0,\"targetBGHigh\":90.0,\"targetBGLow\":90.0,\"timestamp\":1626202783325,\"totalInsulin\":7.34,\"trendInsulin\":0.336734693877551,\"utcOffset\":7200000,\"version\":1,\"wasBasalIOBUsed\":true,\"wasBolusIOBUsed\":true,\"wasCOBUsed\":true,\"wasGlucoseUsed\":true,\"wasSuperbolusUsed\":false,\"wasTempTargetUsed\":false,\"wasTrendUsed\":true,\"wereCarbsUsed\":false}", + "date": 1626202783325, + "glucose": 134, + "units": "mg/dl", + "notes": "", + "identifier": "60ede2a4c574da0004a3869d", + "srvModified": 1626202783325, + "srvCreated": 1626202783325 +}, + +DEVICE STATUS with configuration +--------------------------------- +{ + "_id": "635abf2069a34517e83768cd", + "created_at": "2022-10-27T17:25:49.730Z", + "device": "openaps://samsung SM-G970F", + "pump": { + "battery": { + "percent": 100 + }, + "status": { + "status": "normal", + "timestamp": "2022-10-27T17:16:11.504Z" + }, + "extended": { + "Version": "3.1.0.3-dev-c-nscv3-8da78d7351-2022.10.25-19:56", + "LastBolus": "10/27/22 18:40", + "LastBolusAmount": 0.35, + "TempBasalAbsoluteRate": 0, + "TempBasalStart": "10/27/22 18:50", + "TempBasalRemaining": 24, + "BaseBasalRate": 1, + "ActiveProfile": "LocalProfile1" + }, + "reservoir": 191, + "clock": "2022-10-27T17:25:49.759Z" + }, + "openaps": { + "suggested": { + "temp": "absolute", + "bg": 72, + "tick": -6, + "eventualBG": 4, + "snoozeBG": 4, + "predBGs": { + "IOB": [72, 61, 51, 42, 39, 39, 39, 39, 39, 39, 39, 39, 39] + }, + "COB": 0, + "IOB": 0.052, + "reason": "COB: 0, Dev: -66, BGI: -0.88, ISF: 2.0, Target: 6.0; BG 4.0<4.4, but 25m left and 0 ~ req 0U/hr: no action required", + "timestamp": "2022-10-27T17:25:49.726Z" + }, + "iob": { + "iob": 0.052, + "basaliob": 0.052, + "activity": 0.0049, + "time": "2022-10-27T17:25:49.726Z" + } + }, + "uploaderBattery": 100, + "configuration": { + "insulin": 5, + "insulinConfiguration": {}, + "sensitivity": 2, + "sensitivityConfiguration": { + "openapsama_min_5m_carbimpact": 10, + "absorption_cutoff": 4, + "autosens_max": 1.2, + "autosens_min": 0.7 + }, + "overviewConfiguration": { + "units": "mmol", + "eatingsoon_duration": 0, + "eatingsoon_target": 0, + "activity_duration": 0, + "activity_target": 0, + "hypo_duration": 0, + "hypo_target": 0, + "low_mark": 4, + "high_mark": 0, + "statuslights_cage_warning": 48, + "statuslights_cage_critical": 72, + "statuslights_iage_warning": 72, + "statuslights_iage_critical": 144, + "statuslights_sage_warning": 216, + "statuslights_sage_critical": 240, + "statuslights_sbat_warning": 25, + "statuslights_sbat_critical": 5, + "statuslights_bage_warning": 216, + "statuslights_bage_critical": 240, + "statuslights_res_warning": 80, + "statuslights_res_critical": 10, + "statuslights_bat_warning": 25, + "statuslights_bat_critical": 5, + "boluswizard_percentage": 60 + }, + "safetyConfiguration": { + "age": "teenage", + "treatmentssafety_maxbolus": 4, + "treatmentssafety_maxcarbs": 60 + }, + "pump": "DanaR", + "version": "3.1.0.3-dev-c-nscv3" + }, + "mills": 1666891549730 +} \ No newline at end of file diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/utils/CoroutineUtils.kt b/ns-sdk/src/main/java/info/nightscout/sdk/utils/CoroutineUtils.kt new file mode 100644 index 0000000000..9b6b777f13 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/utils/CoroutineUtils.kt @@ -0,0 +1,22 @@ +package info.nightscout.sdk.utils + +import kotlinx.coroutines.delay +import kotlin.reflect.KClass + +@Suppress("TooGenericExceptionCaught") +internal suspend fun retry( + numberOfRetries: Int, + delayBetweenRetries: Long, + excludedExceptions: List>, + block: suspend () -> T +): T { + repeat(numberOfRetries) { + try { + return block() + } catch (exception: Exception) { + if (exception::class in excludedExceptions) throw exception + } + delay(delayBetweenRetries) + } + return block() +} diff --git a/ns-sdk/src/main/java/info/nightscout/sdk/utils/ListUtils.kt b/ns-sdk/src/main/java/info/nightscout/sdk/utils/ListUtils.kt new file mode 100644 index 0000000000..12e326db36 --- /dev/null +++ b/ns-sdk/src/main/java/info/nightscout/sdk/utils/ListUtils.kt @@ -0,0 +1,4 @@ +package info.nightscout.sdk.utils + +@JvmSynthetic +internal fun List?.toNotNull(): List = this?.filterNotNull() ?: listOf() diff --git a/openhumans/build.gradle b/openhumans/build.gradle index 1d7f6b7f30..87b80dab73 100644 --- a/openhumans/build.gradle +++ b/openhumans/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/plugins/build.gradle b/plugins/build.gradle index f75226f9a9..0a538ec21d 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -1,12 +1,15 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { namespace 'info.nightscout.plugins' diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt index 484cececce..a64f354b03 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt @@ -1,6 +1,5 @@ package info.nightscout.plugins.general.autotune -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.database.AppRepository @@ -17,14 +16,15 @@ import info.nightscout.androidaps.extensions.toJson import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.plugins.sync.nsclient.extensions.toJson import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.interfaces.utils.Round import info.nightscout.androidaps.utils.T +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONObject @@ -41,6 +41,7 @@ open class AutotuneIob @Inject constructor( private val dateUtil: DateUtil, private val autotuneFS: AutotuneFS ) { + private var nsTreatments = ArrayList() private var dia: Double = Constants.defaultDIA var boluses: ArrayList = ArrayList() @@ -58,10 +59,10 @@ open class AutotuneIob @Inject constructor( nsTreatments.clear() meals.clear() boluses.clear() - tempBasals = ArrayList() + tempBasals = ArrayList() if (profileFunction.getProfile(from - range()) == null) return - initializeBgreadings(from, to) + initializeBgReadings(from, to) initializeTreatmentData(from - range(), to) initializeTempBasalData(from - range(), to, tunedProfile) initializeExtendedBolusData(from - range(), to, tunedProfile) @@ -87,14 +88,17 @@ open class AutotuneIob @Inject constructor( boluses = ArrayList(boluses.toList().sortedWith { o1: Bolus, o2: Bolus -> (o2.timestamp - o1.timestamp).toInt() }) } - private fun initializeBgreadings(from: Long, to: Long) { + private fun initializeBgReadings(from: Long, to: Long) { glucose = repository.compatGetBgReadingsDataFromTime(from, to, false).blockingGet() } //nsTreatment is used only for export data, meals is used in AutotunePrep private fun initializeTreatmentData(from: Long, to: Long) { val oldestBgDate = if (glucose.isNotEmpty()) glucose[glucose.size - 1].timestamp else from - aapsLogger.debug(LTag.AUTOTUNE, "Check BG date: BG Size: " + glucose.size + " OldestBG: " + dateUtil.dateAndTimeAndSecondsString(oldestBgDate) + " to: " + dateUtil.dateAndTimeAndSecondsString(to)) + aapsLogger.debug( + LTag.AUTOTUNE, + "Check BG date: BG Size: " + glucose.size + " OldestBG: " + dateUtil.dateAndTimeAndSecondsString(oldestBgDate) + " to: " + dateUtil.dateAndTimeAndSecondsString(to) + ) val tmpCarbs = repository.getCarbsDataFromTimeToTimeExpanded(from, to, false).blockingGet() aapsLogger.debug(LTag.AUTOTUNE, "Nb treatments after query: " + tmpCarbs.size) var nbCarbs = 0 @@ -170,7 +174,7 @@ open class AutotuneIob @Inject constructor( timestamp = newStart, rate = 100.0, duration = previousStart - newStart, - interfaceIDs_backing = InterfaceIDs(nightscoutId = "neutral_" + newStart.toString()), + interfaceIDs_backing = InterfaceIDs(nightscoutId = "neutral_$newStart"), type = TemporaryBasal.Type.NORMAL ) toSplittedTimestampTB(neutralTbr, tunedProfile) @@ -184,7 +188,7 @@ open class AutotuneIob @Inject constructor( timestamp = from, rate = 100.0, duration = previousStart - from, - interfaceIDs_backing = InterfaceIDs(nightscoutId = "neutral_" + from.toString()), + interfaceIDs_backing = InterfaceIDs(nightscoutId = "neutral_$from"), type = TemporaryBasal.Type.NORMAL ) toSplittedTimestampTB(neutralTbr, tunedProfile) @@ -202,7 +206,7 @@ open class AutotuneIob @Inject constructor( val endTimestamp = splittedTimestamp + splittedDuration while (splittedDuration > 0) { if (Profile.milliSecFromMidnight(splittedTimestamp) / cutInMilliSec == Profile.milliSecFromMidnight(endTimestamp) / cutInMilliSec) { - val newtb = TemporaryBasal( + val newTb = TemporaryBasal( isValid = true, isAbsolute = tb.isAbsolute, timestamp = splittedTimestamp, @@ -211,15 +215,15 @@ open class AutotuneIob @Inject constructor( interfaceIDs_backing = tb.interfaceIDs_backing, type = tb.type ) - tempBasals.add(newtb) - nsTreatments.add(NsTreatment(newtb)) + tempBasals.add(newTb) + nsTreatments.add(NsTreatment(newTb)) splittedDuration = 0 - val profile = profileFunction.getProfile(newtb.timestamp) ?:continue - boluses.addAll(convertToBoluses(newtb, profile, tunedProfile.profile)) // - // required for correct iob calculation with oref0 algo + val profile = profileFunction.getProfile(newTb.timestamp) ?: continue + boluses.addAll(convertToBoluses(newTb, profile, tunedProfile.profile)) // + // required for correct iob calculation with oref0 algo } else { val durationFilled = (cutInMilliSec - Profile.milliSecFromMidnight(splittedTimestamp) % cutInMilliSec) - val newtb = TemporaryBasal( + val newTb = TemporaryBasal( isValid = true, isAbsolute = tb.isAbsolute, timestamp = splittedTimestamp, @@ -228,20 +232,19 @@ open class AutotuneIob @Inject constructor( interfaceIDs_backing = tb.interfaceIDs_backing, type = tb.type ) - tempBasals.add(newtb) - nsTreatments.add(NsTreatment(newtb)) + tempBasals.add(newTb) + nsTreatments.add(NsTreatment(newTb)) splittedTimestamp += durationFilled splittedDuration -= durationFilled - val profile = profileFunction.getProfile(newtb.timestamp) ?:continue - boluses.addAll(convertToBoluses(newtb, profile, tunedProfile.profile)) // required for correct iob calculation with oref0 algo + val profile = profileFunction.getProfile(newTb.timestamp) ?: continue + boluses.addAll(convertToBoluses(newTb, profile, tunedProfile.profile)) // required for correct iob calculation with oref0 algo } } } } - open fun getIOB(time: Long, localInsulin: LocalInsulin): IobTotal { - return getCalculationToTimeTreatments(time, localInsulin).round() - } + open fun getIOB(time: Long, localInsulin: LocalInsulin): IobTotal = + getCalculationToTimeTreatments(time, localInsulin).round() private fun getCalculationToTimeTreatments(time: Long, localInsulin: LocalInsulin): IobTotal { val total = IobTotal(time) @@ -252,14 +255,19 @@ open class AutotuneIob @Inject constructor( if (t.timestamp > time || t.timestamp < time - localInsulin.duration) continue val tIOB = t.iobCalc(time, localInsulin) if (detailedLog) - log("iobCalc;${t.interfaceIDs.nightscoutId};$time;${t.timestamp};${tIOB.iobContrib};${tIOB.activityContrib};${dateUtil.dateAndTimeAndSecondsString(time)};${dateUtil.dateAndTimeAndSecondsString(t.timestamp)}") + log( + "iobCalc;${t.interfaceIDs.nightscoutId};$time;${t.timestamp};${tIOB.iobContrib};${tIOB.activityContrib};${dateUtil.dateAndTimeAndSecondsString(time)};${ + dateUtil.dateAndTimeAndSecondsString( + t.timestamp + ) + }" + ) total.iob += tIOB.iobContrib total.activity += tIOB.activityContrib } return total } - private fun convertToBoluses(eb: ExtendedBolus): MutableList { val result: MutableList = ArrayList() val aboutFiveMinIntervals = ceil(eb.duration / 5.0).toInt() @@ -285,11 +293,13 @@ open class AutotuneIob @Inject constructor( val realDuration = tbr.durationInMinutes val basalRate = profile.getBasal(tbr.timestamp) val tunedRate = tunedProfile.getBasal(tbr.timestamp) - val netBasalRate = Round.roundTo(if (tbr.isAbsolute) { - tbr.rate - tunedRate - } else { - tbr.rate / 100.0 * basalRate - tunedRate - }, 0.001) + val netBasalRate = Round.roundTo( + if (tbr.isAbsolute) { + tbr.rate - tunedRate + } else { + tbr.rate / 100.0 * basalRate - tunedRate + }, 0.001 + ) val aboutFiveMinIntervals = ceil(realDuration / 5.0).toInt() val tempBolusSpacing = realDuration / aboutFiveMinIntervals.toDouble() for (j in 0L until aboutFiveMinIntervals) { @@ -311,8 +321,8 @@ open class AutotuneIob @Inject constructor( @Synchronized fun glucoseToJSON(): String { val glucoseJson = JSONArray() - for (bgreading in glucose) - glucoseJson.put(bgreading.toJson(true, dateUtil)) + for (bgReading in glucose) + glucoseJson.put(bgReading.toJson(true, dateUtil)) return glucoseJson.toString(2) } @@ -368,7 +378,7 @@ open class AutotuneIob @Inject constructor( } fun toJson(): JSONObject? { - val cPjson = JSONObject() + val cpJson = JSONObject() return when (eventType) { TherapyEvent.Type.TEMPORARY_BASAL -> temporaryBasal?.let { tbr -> @@ -377,6 +387,7 @@ open class AutotuneIob @Inject constructor( tbr.toJson(true, it, dateUtil) } } + TherapyEvent.Type.COMBO_BOLUS -> extendedBolus?.let { ebr -> val profile = profileFunction.getProfile(ebr.timestamp) @@ -384,9 +395,10 @@ open class AutotuneIob @Inject constructor( ebr.toJson(true, it, dateUtil) } } + TherapyEvent.Type.CORRECTION_BOLUS -> bolusTreatment?.toJson(true, dateUtil) TherapyEvent.Type.CARBS_CORRECTION -> carbsTreatment?.toJson(true, dateUtil) - else -> cPjson + else -> cpJson } } } diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index d5c4e96f7e..489091dd06 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -6,7 +6,6 @@ import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.ValueWithUnit -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Autotune import info.nightscout.interfaces.BuildHelper @@ -23,6 +22,7 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index 6cd077fe99..e0c101320a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -7,9 +7,7 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.extensions.blockValueBySeconds -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile @@ -17,8 +15,10 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.interfaces.utils.Round import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.shared.SafeParse import info.nightscout.shared.sharedPreferences.SP 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 e67e5f1d6d..0af83f741a 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 @@ -11,10 +11,8 @@ 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.annotations.OpenForTesting import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.smsCommunicator.Sms import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.OfflineEvent import info.nightscout.androidaps.database.entities.TemporaryTarget @@ -29,32 +27,34 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop 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.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.interfaces.SmsCommunicator import info.nightscout.androidaps.interfaces.XDripBroadcast 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.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.SmsCommunicator +import info.nightscout.interfaces.data.smsCommunicator.Sms +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.queue.Callback import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.events.EventSmsCommunicatorUpdateGui import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword @@ -246,7 +246,7 @@ class SmsCommunicatorPlugin @Inject constructor( } fun processSms(receivedSms: Sms) { - if (!isEnabled(PluginType.GENERAL)) { + if (!isEnabled()) { aapsLogger.debug(LTag.SMS, "Ignoring SMS. Plugin disabled.") return } diff --git a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt index c3877334ba..a443d545ab 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -111,7 +111,7 @@ class StatusLinePlugin @Inject constructor( private fun sendStatus() { var status = "" // sent once on disable val profile = profileFunction.getProfile() - if (isEnabled(PluginType.GENERAL) && profile != null) { + if (isEnabled() && profile != null) { status = buildStatusString(profile) } //sendData diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index 175df21037..1821f8ddc2 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -11,7 +11,6 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.blockFromJsonArray -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.GlucoseUnit @@ -32,6 +31,7 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventLocalProfileChanged diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt new file mode 100644 index 0000000000..166d58dba8 --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt @@ -0,0 +1,52 @@ +package info.nightscout.plugins.sync.nsclient.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.interfaces.utils.JsonHelper +import org.json.JSONObject + +fun Bolus.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = + JSONObject() + .put("eventType", if (type == Bolus.Type.SMB) TherapyEvent.Type.CORRECTION_BOLUS.text else TherapyEvent.Type.MEAL_BOLUS.text) + .put("insulin", amount) + .put("created_at", dateUtil.toISOString(timestamp)) + .put("date", timestamp) + .put("type", type.name) + .put("notes", notes) + .put("isValid", isValid) + .put("isSMB", type == Bolus.Type.SMB).also { + if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) + if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) + if (interfaceIDs.pumpSerial != null) it.put("pumpSerial", interfaceIDs.pumpSerial) + if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) + } + +fun bolusFromJson(jsonObject: JSONObject): Bolus? { + val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null + val amount = JsonHelper.safeGetDoubleAllowNull(jsonObject, "insulin") ?: return null + val type = Bolus.Type.fromString(JsonHelper.safeGetString(jsonObject, "type")) + val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) + val notes = JsonHelper.safeGetStringAllowNull(jsonObject, "notes", null) + val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null + val pumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "pumpId", null) + val pumpType = InterfaceIDs.PumpType.fromString(JsonHelper.safeGetStringAllowNull(jsonObject, "pumpType", null)) + val pumpSerial = JsonHelper.safeGetStringAllowNull(jsonObject, "pumpSerial", null) + + if (timestamp == 0L) return null + if (amount == 0.0) return null + + return Bolus( + timestamp = timestamp, + amount = amount, + type = type, + notes = notes, + isValid = isValid, + ).also { + it.interfaceIDs.nightscoutId = id + it.interfaceIDs.pumpId = pumpId + it.interfaceIDs.pumpType = pumpType + it.interfaceIDs.pumpSerial = pumpSerial + } +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/CarbsExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt similarity index 86% rename from core/src/main/java/info/nightscout/androidaps/extensions/CarbsExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt index fecf881479..3a09d8165f 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/CarbsExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Carbs @@ -22,19 +22,6 @@ fun Carbs.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) } -/* - create fake object with nsID and isValid == false - */ -fun carbsFromNsIdForInvalidating(nsId: String): Carbs = - carbsFromJson( - JSONObject() - .put("mills", 1) - .put("carbs", -1.0) - .put("notes", null) - .put("_id", nsId) - .put("isValid", false) - )!! - fun carbsFromJson(jsonObject: JSONObject): Carbs? { val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null val duration = JsonHelper.safeGetLong(jsonObject, "duration") diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/EffectiveProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/extensions/EffectiveProfileSwitchExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index 517d12f81f..18e32b5dd3 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InterfaceIDs @@ -6,6 +6,7 @@ import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt new file mode 100644 index 0000000000..a6bdf85da5 --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt @@ -0,0 +1,74 @@ +package info.nightscout.plugins.sync.nsclient.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.ExtendedBolus +import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.androidaps.extensions.toTemporaryBasal +import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.plugins.sync.nsclient.extensions.toJson +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.T +import info.nightscout.interfaces.utils.JsonHelper +import org.json.JSONObject + +fun ExtendedBolus.toJson(isAdd: Boolean, profile: Profile, dateUtil: DateUtil): JSONObject = + if (isEmulatingTempBasal) + toTemporaryBasal(profile) + .toJson(isAdd, profile, dateUtil) + .put("extendedEmulated", toRealJson(isAdd, dateUtil)) + else toRealJson(isAdd, dateUtil) + +fun ExtendedBolus.toRealJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = + JSONObject() + .put("created_at", dateUtil.toISOString(timestamp)) + .put("enteredBy", "openaps://" + "AndroidAPS") + .put("eventType", TherapyEvent.Type.COMBO_BOLUS.text) + .put("duration", T.msecs(duration).mins()) + .put("durationInMilliseconds", duration) + .put("splitNow", 0) + .put("splitExt", 100) + .put("enteredinsulin", amount) + .put("relative", rate) + .put("isValid", isValid) + .put("isEmulatingTempBasal", isEmulatingTempBasal) + .also { + if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) + if (interfaceIDs.endId != null) it.put("endId", interfaceIDs.endId) + if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) + if (interfaceIDs.pumpSerial != null) it.put("pumpSerial", interfaceIDs.pumpSerial) + if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) + } + +fun extendedBolusFromJson(jsonObject: JSONObject): ExtendedBolus? { + val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null + if (JsonHelper.safeGetIntAllowNull(jsonObject, "splitNow") != 0) return null + if (JsonHelper.safeGetIntAllowNull(jsonObject, "splitExt") != 100) return null + val amount = JsonHelper.safeGetDoubleAllowNull(jsonObject, "enteredinsulin") ?: return null + val duration = JsonHelper.safeGetLongAllowNull(jsonObject, "duration") ?: return null + val durationInMilliseconds = JsonHelper.safeGetLongAllowNull(jsonObject, "durationInMilliseconds") + val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) + val isEmulatingTempBasal = JsonHelper.safeGetBoolean(jsonObject, "isEmulatingTempBasal", false) + val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null + val pumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "pumpId", null) + val endPumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "endId", null) + val pumpType = InterfaceIDs.PumpType.fromString(JsonHelper.safeGetStringAllowNull(jsonObject, "pumpType", null)) + val pumpSerial = JsonHelper.safeGetStringAllowNull(jsonObject, "pumpSerial", null) + + if (timestamp == 0L) return null + if (duration == 0L && durationInMilliseconds == 0L) return null + if (amount == 0.0) return null + + return ExtendedBolus( + timestamp = timestamp, + amount = amount, + duration = durationInMilliseconds ?: T.mins(duration).msecs(), + isEmulatingTempBasal = isEmulatingTempBasal, + isValid = isValid + ).also { + it.interfaceIDs.nightscoutId = id + it.interfaceIDs.pumpId = pumpId + it.interfaceIDs.endId = endPumpId + it.interfaceIDs.pumpType = pumpType + it.interfaceIDs.pumpSerial = pumpSerial + } +} \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/OfflineEventExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/extensions/OfflineEventExtension.kt rename to plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt index c150fd643c..cc729cb1d4 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/OfflineEventExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.OfflineEvent import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.androidaps.utils.T +import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject fun OfflineEvent.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt new file mode 100644 index 0000000000..58dd2466e7 --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt @@ -0,0 +1,96 @@ +package info.nightscout.plugins.sync.nsclient.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.database.entities.TherapyEvent +import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.extensions.fromConstant +import info.nightscout.androidaps.utils.extensions.getCustomizedName +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.utils.JsonHelper +import org.json.JSONObject + +fun ProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = + JSONObject() + .put("timeshift", timeshift) + .put("percentage", percentage) + .put("duration", T.msecs(duration).mins()) + .put("profile", getCustomizedName()) + .put("originalProfileName", profileName) + .put("originalDuration", duration) + .put("created_at", dateUtil.toISOString(timestamp)) + .put("enteredBy", "openaps://" + "AndroidAPS") + .put("isValid", isValid) + .put("eventType", TherapyEvent.Type.PROFILE_SWITCH.text) + .also { // remove customization to store original profileJson in toPureNsJson call + timeshift = 0 + percentage = 100 + } + .put("profileJson", ProfileSealed.PS(this).toPureNsJson(dateUtil).toString()) + .also { + if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) + if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) + if (interfaceIDs.pumpSerial != null) it.put("pumpSerial", interfaceIDs.pumpSerial) + if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) + } + +/* NS PS +{ + "_id":"608ffa268db0676196a772d7", + "enteredBy":"undefined", + "eventType":"Profile Switch", + "duration":10, + "profile":"LocalProfile0", + "created_at":"2021-05-03T13:26:58.537Z", + "utcOffset":0, + "mills":1620048418537, + "mgdl":98 +} + */ +fun profileSwitchFromJson(jsonObject: JSONObject, dateUtil: DateUtil, activePlugin: ActivePlugin): ProfileSwitch? { + val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null + val duration = JsonHelper.safeGetLong(jsonObject, "duration") + val originalDuration = JsonHelper.safeGetLongAllowNull(jsonObject, "originalDuration") + val timeshift = JsonHelper.safeGetLong(jsonObject, "timeshift") + val percentage = JsonHelper.safeGetInt(jsonObject, "percentage", 100) + val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) + val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) + val profileName = JsonHelper.safeGetStringAllowNull(jsonObject, "profile", null) ?: return null + val originalProfileName = JsonHelper.safeGetStringAllowNull(jsonObject, "originalProfileName", null) + val profileJson = JsonHelper.safeGetStringAllowNull(jsonObject, "profileJson", null) + val pumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "pumpId", null) + val pumpType = InterfaceIDs.PumpType.fromString(JsonHelper.safeGetStringAllowNull(jsonObject, "pumpType", null)) + val pumpSerial = JsonHelper.safeGetStringAllowNull(jsonObject, "pumpSerial", null) + + if (timestamp == 0L) return null + val pureProfile = + if (profileJson == null) { // entered through NS, no JSON attached + val profilePlugin = activePlugin.activeProfileSource + val store = profilePlugin.profile ?: return null + store.getSpecificProfile(profileName) ?: return null + } else pureProfileFromJson(JSONObject(profileJson), dateUtil) ?: return null + val profileSealed = ProfileSealed.Pure(pureProfile) + + return ProfileSwitch( + timestamp = timestamp, + basalBlocks = profileSealed.basalBlocks, + isfBlocks = profileSealed.isfBlocks, + icBlocks = profileSealed.icBlocks, + targetBlocks = profileSealed.targetBlocks, + glucoseUnit = ProfileSwitch.GlucoseUnit.fromConstant(profileSealed.units), + profileName = originalProfileName ?: profileName, + timeshift = timeshift, + percentage = percentage, + duration = originalDuration ?: T.mins(duration).msecs(), + insulinConfiguration = profileSealed.insulinConfiguration, + isValid = isValid + ).also { + it.interfaceIDs.nightscoutId = id + it.interfaceIDs.pumpId = pumpId + it.interfaceIDs.pumpType = pumpType + it.interfaceIDs.pumpSerial = pumpSerial + } +} diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt new file mode 100644 index 0000000000..92afb9d5c8 --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt @@ -0,0 +1,74 @@ +package info.nightscout.plugins.sync.nsclient.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.androidaps.database.entities.TemporaryBasal.Type.Companion.fromString +import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.androidaps.extensions.convertedToAbsolute +import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.T +import info.nightscout.interfaces.utils.JsonHelper +import org.json.JSONObject + +fun TemporaryBasal.toJson(isAdd: Boolean, profile: Profile, dateUtil: DateUtil): JSONObject = + JSONObject() + .put("created_at", dateUtil.toISOString(timestamp)) + .put("enteredBy", "openaps://" + "AndroidAPS") + .put("eventType", TherapyEvent.Type.TEMPORARY_BASAL.text) + .put("isValid", isValid) + .put("duration", T.msecs(duration).mins()) + .put("durationInMilliseconds", duration) // rounded duration leads to different basal IOB + .put("type", type.name) + .put("rate", convertedToAbsolute(timestamp, profile)) // generated by OpenAPS, for compatibility + .also { + if (isAbsolute) it.put("absolute", rate) + else it.put("percent", rate - 100) + if (interfaceIDs.pumpId != null) it.put("pumpId", interfaceIDs.pumpId) + if (interfaceIDs.endId != null) it.put("endId", interfaceIDs.endId) + if (interfaceIDs.pumpType != null) it.put("pumpType", interfaceIDs.pumpType!!.name) + if (interfaceIDs.pumpSerial != null) it.put("pumpSerial", interfaceIDs.pumpSerial) + if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) + } + +fun temporaryBasalFromJson(jsonObject: JSONObject): TemporaryBasal? { + val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null + val percent = JsonHelper.safeGetDoubleAllowNull(jsonObject, "percent") + val absolute = JsonHelper.safeGetDoubleAllowNull(jsonObject, "absolute") + val duration = JsonHelper.safeGetLongAllowNull(jsonObject, "duration") ?: return null + val durationInMilliseconds = JsonHelper.safeGetLongAllowNull(jsonObject, "durationInMilliseconds") + val type = fromString(JsonHelper.safeGetString(jsonObject, "type")) + val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) + val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null + val pumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "pumpId", null) + val endPumpId = JsonHelper.safeGetLongAllowNull(jsonObject, "endId", null) + val pumpType = InterfaceIDs.PumpType.fromString(JsonHelper.safeGetStringAllowNull(jsonObject, "pumpType", null)) + val pumpSerial = JsonHelper.safeGetStringAllowNull(jsonObject, "pumpSerial", null) + + val rate: Double + val isAbsolute: Boolean + if (absolute != null) { + rate = absolute + isAbsolute = true + } else if (percent != null) { + rate = percent + 100 + isAbsolute = false + } else return null + if (duration == 0L && durationInMilliseconds == null) return null + if (timestamp == 0L) return null + + return TemporaryBasal( + timestamp = timestamp, + rate = rate, + duration = durationInMilliseconds ?: T.mins(duration).msecs(), + type = type, + isAbsolute = isAbsolute, + isValid = isValid + ).also { + it.interfaceIDs.nightscoutId = id + it.interfaceIDs.pumpId = pumpId + it.interfaceIDs.endId = endPumpId + it.interfaceIDs.pumpType = pumpType + it.interfaceIDs.pumpSerial = pumpSerial + } +} \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt new file mode 100644 index 0000000000..f924c7c45c --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -0,0 +1,66 @@ +package info.nightscout.plugins.sync.nsclient.extensions + +import info.nightscout.androidaps.database.entities.TemporaryTarget +import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.T +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.utils.JsonHelper +import org.json.JSONObject + +fun temporaryTargetFromJson(jsonObject: JSONObject): TemporaryTarget? { + val units = GlucoseUnit.fromText(JsonHelper.safeGetString(jsonObject, "units", Constants.MGDL)) + val timestamp = JsonHelper.safeGetLongAllowNull(jsonObject, "mills", null) ?: return null + val duration = JsonHelper.safeGetLongAllowNull(jsonObject, "duration", null) ?: return null + val durationInMilliseconds = JsonHelper.safeGetLongAllowNull(jsonObject, "durationInMilliseconds") + var low = JsonHelper.safeGetDouble(jsonObject, "targetBottom") + low = Profile.toMgdl(low, units) + var high = JsonHelper.safeGetDouble(jsonObject, "targetTop") + high = Profile.toMgdl(high, units) + val reasonString = if (duration != 0L) JsonHelper.safeGetStringAllowNull(jsonObject, "reason", null) + ?: return null else "" + // this string can be localized from NS, it will not work in this case CUSTOM will be used + val reason = TemporaryTarget.Reason.fromString(reasonString) + val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null + val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) + + if (timestamp == 0L) return null + + if (duration > 0L) { + // not ending event + if (low < Constants.MIN_TT_MGDL) return null + if (low > Constants.MAX_TT_MGDL) return null + if (high < Constants.MIN_TT_MGDL) return null + if (high > Constants.MAX_TT_MGDL) return null + if (low > high) return null + } + val tt = TemporaryTarget( + timestamp = timestamp, + duration = durationInMilliseconds ?: T.mins(duration).msecs(), + reason = reason, + lowTarget = low, + highTarget = high, + isValid = isValid + ) + tt.interfaceIDs.nightscoutId = id + return tt +} + +fun TemporaryTarget.toJson(isAdd: Boolean, units: GlucoseUnit, dateUtil: DateUtil): JSONObject = + JSONObject() + .put("eventType", TherapyEvent.Type.TEMPORARY_TARGET.text) + .put("duration", T.msecs(duration).mins()) + .put("durationInMilliseconds", duration) + .put("isValid", isValid) + .put("created_at", dateUtil.toISOString(timestamp)) + .put("timestamp", timestamp) + .put("enteredBy", "AndroidAPS").also { + if (lowTarget > 0) it + .put("reason", reason.text) + .put("targetBottom", Profile.fromMgdlToUnits(lowTarget, units)) + .put("targetTop", Profile.fromMgdlToUnits(highTarget, units)) + .put("units", units.asText) + if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) + } 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 new file mode 100644 index 0000000000..1210bdd96c --- /dev/null +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TherapyEventExtension.kt @@ -0,0 +1,87 @@ +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.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.T +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.utils.JsonHelper +import org.json.JSONObject +import java.util.concurrent.TimeUnit + +fun TherapyEvent.age(useShortText: Boolean, rh: ResourceHelper, dateUtil: DateUtil): String { + val diff = dateUtil.computeDiff(timestamp, System.currentTimeMillis()) + var days = " " + rh.gs(R.string.days) + " " + var hours = " " + rh.gs(R.string.hours) + " " + if (useShortText) { + days = rh.gs(R.string.shortday) + hours = rh.gs(R.string.shorthour) + } + return diff[TimeUnit.DAYS].toString() + days + diff[TimeUnit.HOURS] + hours +} + +fun TherapyEvent.GlucoseUnit.toMainUnit(): GlucoseUnit = + if (this == TherapyEvent.GlucoseUnit.MGDL) GlucoseUnit.MGDL + else GlucoseUnit.MMOL + +/* + create fake object with nsID and isValid == false + */ + +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 + val type = TherapyEvent.Type.fromString(JsonHelper.safeGetString(jsonObject, "eventType", TherapyEvent.Type.NONE.text)) + val duration = JsonHelper.safeGetLong(jsonObject, "duration") + val durationInMilliseconds = JsonHelper.safeGetLongAllowNull(jsonObject, "durationInMilliseconds") + val glucose = JsonHelper.safeGetDoubleAllowNull(jsonObject, "glucose") + val glucoseType = TherapyEvent.MeterType.fromString(JsonHelper.safeGetString(jsonObject, "glucoseType")) + val enteredBy = JsonHelper.safeGetStringAllowNull(jsonObject, "enteredBy", null) + val note = JsonHelper.safeGetStringAllowNull(jsonObject, "notes", null) + val id = JsonHelper.safeGetStringAllowNull(jsonObject, "_id", null) ?: return null + val isValid = JsonHelper.safeGetBoolean(jsonObject, "isValid", true) + + if (timestamp == 0L) return null + + val te = TherapyEvent( + timestamp = timestamp, + duration = durationInMilliseconds ?: T.mins(duration).msecs(), + glucoseUnit = glucoseUnit, + type = type, + glucose = glucose, + glucoseType = glucoseType, + enteredBy = enteredBy, + note = note, + isValid = isValid + ) + te.interfaceIDs.nightscoutId = id + return te +} + +fun TherapyEvent.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = + JSONObject() + .put("eventType", type.text) + .put("isValid", isValid) + .put("created_at", dateUtil.toISOString(timestamp)) + .put("enteredBy", enteredBy) + .put("units", if (glucoseUnit == TherapyEvent.GlucoseUnit.MGDL) Constants.MGDL else Constants.MMOL) + .also { + if (duration != 0L) it.put("duration", T.msecs(duration).mins()) + if (duration != 0L) it.put("durationInMilliseconds", duration) + if (note != null) it.put("notes", note) + if (glucose != null) it.put("glucose", glucose) + if (glucoseType != null) it.put("glucoseType", glucoseType!!.text) + if (isAdd && interfaceIDs.nightscoutId != null) it.put("_id", interfaceIDs.nightscoutId) + if (type == TherapyEvent.Type.ANNOUNCEMENT) it.put("isAnnouncement", true) + } + +fun List.isTherapyEventEvent5minBack(time: Long): Boolean { + for (event in this) { + if (event.timestamp <= time && event.timestamp > time - T.mins(5).msecs()) { + return true + } + } + return false +} diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 78bd435dc5..c8c0e6e0e3 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -6,15 +6,15 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InsulinConfiguration import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import org.json.JSONObject import org.junit.Before diff --git a/pump/combo/build.gradle b/pump/combo/build.gradle index d1fd47f9bc..b89823c385 100644 --- a/pump/combo/build.gradle +++ b/pump/combo/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/pump/dana/build.gradle b/pump/dana/build.gradle index b0e76a4a93..2b95c5c310 100644 --- a/pump/dana/build.gradle +++ b/pump/dana/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" diff --git a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index d6ee4f06e1..dfcd01ae5c 100644 --- a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile diff --git a/pump/danar/build.gradle b/pump/danar/build.gradle index ff7ca88e4e..a42d20830f 100644 --- a/pump/danar/build.gradle +++ b/pump/danar/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index 01aa0e3bd4..982a276f1c 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -11,7 +11,6 @@ import info.nightscout.androidaps.danaRKorean.services.DanaRKoreanExecutionServi import info.nightscout.androidaps.danar.AbstractDanaRPlugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin @@ -22,15 +21,15 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.utils.Round -import info.nightscout.interfaces.PluginType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP @@ -70,14 +69,14 @@ class DanaRKoreanPlugin @Inject constructor( .toObservable(EventPreferenceChange::class.java) .observeOn(aapsSchedulers.io) .subscribe({ - if (isEnabled(PluginType.PUMP)) { - val previousValue = useExtendedBoluses - useExtendedBoluses = sp.getBoolean(R.string.key_danar_useextended, false) - if (useExtendedBoluses != previousValue && pumpSync.expectedPumpState().extendedBolus != null) { - sExecutionService.extendedBolusStop() - } - } - }, fabricPrivacy::logException) + if (isEnabled()) { + val previousValue = useExtendedBoluses + useExtendedBoluses = sp.getBoolean(R.string.key_danar_useextended, false) + if (useExtendedBoluses != previousValue && pumpSync.expectedPumpState().extendedBolus != null) { + sExecutionService.extendedBolusStop() + } + } + }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventAppExit::class.java) .observeOn(aapsSchedulers.io) diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index 7348f45bca..bc44f3af7c 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -85,7 +85,7 @@ public class DanaRPlugin extends AbstractDanaRPlugin { .toObservable(EventPreferenceChange.class) .observeOn(aapsSchedulers.getIo()) .subscribe(event -> { - if (isEnabled(PluginType.PUMP)) { + if (isEnabled()) { boolean previousValue = useExtendedBoluses; useExtendedBoluses = sp.getBoolean(R.string.key_danar_useextended, false); diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c6422c2fa3..c2ae58502b 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,7 +4,7 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator diff --git a/pump/danars/build.gradle b/pump/danars/build.gradle index 4b0c9c7502..746fc08c41 100644 --- a/pump/danars/build.gradle +++ b/pump/danars/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index ba7d59b17f..b1a3540546 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile diff --git a/pump/diaconn/build.gradle b/pump/diaconn/build.gradle index c036072701..4aa1f76d4b 100644 --- a/pump/diaconn/build.gradle +++ b/pump/diaconn/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" diff --git a/pump/eopatch/build.gradle b/pump/eopatch/build.gradle index ae89e54fdd..b117f5d123 100644 --- a/pump/eopatch/build.gradle +++ b/pump/eopatch/build.gradle @@ -1,8 +1,10 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" diff --git a/pump/medtronic/build.gradle b/pump/medtronic/build.gradle index a2f71383c8..337bb98cbf 100644 --- a/pump/medtronic/build.gradle +++ b/pump/medtronic/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/pump/omnipod-common/build.gradle b/pump/omnipod-common/build.gradle index ba9c9049be..4c92c7eace 100644 --- a/pump/omnipod-common/build.gradle +++ b/pump/omnipod-common/build.gradle @@ -1,12 +1,14 @@ - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/pump/omnipod-dash/build.gradle b/pump/omnipod-dash/build.gradle index ca810fd435..c9f3cc718a 100644 --- a/pump/omnipod-dash/build.gradle +++ b/pump/omnipod-dash/build.gradle @@ -1,13 +1,16 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' -apply plugin: "io.gitlab.arturbosch.detekt" // TODO move to `subprojects` section in global build.gradle -apply plugin: "org.jlleitschuh.gradle.ktlint" // TODO move to `subprojects` section in global build.gradle +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' + id "io.gitlab.arturbosch.detekt" // TODO move to `subprojects` section in global build.gradle + id "org.jlleitschuh.gradle.ktlint" // TODO move to `subprojects` section in global build.gradle +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" diff --git a/pump/omnipod-eros/build.gradle b/pump/omnipod-eros/build.gradle index 86bc40cf90..7b36bb3f18 100644 --- a/pump/omnipod-eros/build.gradle +++ b/pump/omnipod-eros/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" diff --git a/pump/pump-common/build.gradle b/pump/pump-common/build.gradle index 2ffd366f4a..2c974a7c88 100644 --- a/pump/pump-common/build.gradle +++ b/pump/pump-common/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/pump/rileylink/build.gradle b/pump/rileylink/build.gradle index d0c2e070ea..eb5621dc5a 100644 --- a/pump/rileylink/build.gradle +++ b/pump/rileylink/build.gradle @@ -1,11 +1,14 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/settings.gradle b/settings.gradle index b7634b6113..df262404ac 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,6 +7,7 @@ include ':app-wear-shared:shared' include ':app-wear-shared:shared-impl' include ':graphview' include ':libraries' +include ':ns-sdk' include ':ui' include ':implementation' include ':plugins' diff --git a/ui/build.gradle b/ui/build.gradle index 6abc4cbb62..f7ca3d31e6 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -1,13 +1,16 @@ -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" + android { namespace 'info.nightscout.ui' } diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index 194de5288f..2108831e51 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -31,7 +31,6 @@ import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger @@ -41,6 +40,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventNSClientRestart diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt index cb770001a5..bad94659fd 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -2,14 +2,18 @@ package info.nightscout.ui.activities.fragments import android.os.Bundle import android.util.SparseArray -import android.view.* +import android.view.LayoutInflater +import android.view.Menu +import android.view.MenuInflater +import android.view.MenuItem +import android.view.View +import android.view.ViewGroup import androidx.core.util.forEach import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.ui.activities.fragments.TreatmentsCareportalFragment.RecyclerViewAdapter.TherapyEventsViewHolder import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.database.entities.UserEntry.Action @@ -17,21 +21,26 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InvalidateAAPSStartedTherapyEventTransaction import info.nightscout.androidaps.database.transactions.InvalidateTherapyEventTransaction -import info.nightscout.rx.events.EventNSClientRestart -import info.nightscout.rx.events.EventTherapyEventChange import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.rx.bus.RxBus -import info.nightscout.androidaps.utils.* +import info.nightscout.androidaps.utils.ActionModeHelper +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventNSClientRestart +import info.nightscout.rx.events.EventTherapyEventChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - import info.nightscout.shared.sharedPreferences.SP import info.nightscout.ui.R +import info.nightscout.ui.activities.fragments.TreatmentsCareportalFragment.RecyclerViewAdapter.TherapyEventsViewHolder import info.nightscout.ui.databinding.TreatmentsCareportalFragmentBinding import info.nightscout.ui.databinding.TreatmentsCareportalItemBinding import io.reactivex.rxjava3.core.Completable diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 05bccb89f8..8e42550b37 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -25,26 +25,25 @@ import info.nightscout.androidaps.database.transactions.InvalidateProfileSwitchT import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewHistoryData -import info.nightscout.rx.events.EventLocalProfileChanged -import info.nightscout.rx.events.EventNSClientRestart -import info.nightscout.rx.events.EventProfileSwitchChanged -import info.nightscout.androidaps.extensions.getCustomizedName import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.rx.bus.RxBus import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.androidaps.utils.extensions.getCustomizedName +import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventLocalProfileChanged +import info.nightscout.rx.events.EventNSClientRestart +import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - import info.nightscout.shared.sharedPreferences.SP import info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsProfileSwitchFragment.RecyclerProfileViewAdapter.ProfileSwitchViewHolder diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt index 3b01bc3e3a..c6a8686caf 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -29,7 +29,6 @@ import info.nightscout.androidaps.extensions.friendlyDescription import info.nightscout.androidaps.extensions.highValueToUnitsToString import info.nightscout.androidaps.extensions.lowValueToUnitsToString import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger @@ -40,6 +39,7 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventNSClientRestart diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt index 227b65753e..e9d7e5ffd6 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt @@ -1,7 +1,7 @@ package info.nightscout.ui.defaultProfile import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.utils.DateUtil diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt index 72b50cb342..d98f68addd 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt @@ -2,7 +2,7 @@ package info.nightscout.ui.defaultProfile import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.utils.DateUtil diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt index 8ce8319783..eb0a64bb8a 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt @@ -62,6 +62,7 @@ class CareDialog : DialogFragmentWithDate() { } private var options: EventType = EventType.BGCHECK + //private var valuesWithUnit = mutableListOf() private var valuesWithUnit = mutableListOf() @@ -88,8 +89,10 @@ class CareDialog : DialogFragmentWithDate() { savedInstanceState.putInt("options", options.ordinal) } - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { onCreateViewGeneral() _binding = DialogCareBinding.inflate(inflater, container, false) return binding.root @@ -103,24 +106,28 @@ class CareDialog : DialogFragmentWithDate() { options = EventType.values()[savedInstanceState.getInt("options", 0)] } - binding.icon.setImageResource(when (options) { - EventType.BGCHECK -> R.drawable.ic_cp_bgcheck - EventType.SENSOR_INSERT -> R.drawable.ic_cp_cgm_insert - EventType.BATTERY_CHANGE -> R.drawable.ic_cp_pump_battery - EventType.NOTE -> R.drawable.ic_cp_note - EventType.EXERCISE -> R.drawable.ic_cp_exercise - EventType.QUESTION -> R.drawable.ic_cp_question - EventType.ANNOUNCEMENT -> R.drawable.ic_cp_announcement - }) - binding.title.text = rh.gs(when (options) { - EventType.BGCHECK -> R.string.careportal_bgcheck - EventType.SENSOR_INSERT -> R.string.careportal_cgmsensorinsert - EventType.BATTERY_CHANGE -> R.string.careportal_pumpbatterychange - EventType.NOTE -> R.string.careportal_note - EventType.EXERCISE -> R.string.careportal_exercise - EventType.QUESTION -> R.string.careportal_question - EventType.ANNOUNCEMENT -> R.string.careportal_announcement - }) + binding.icon.setImageResource( + when (options) { + EventType.BGCHECK -> R.drawable.ic_cp_bgcheck + EventType.SENSOR_INSERT -> R.drawable.ic_cp_cgm_insert + EventType.BATTERY_CHANGE -> R.drawable.ic_cp_pump_battery + EventType.NOTE -> R.drawable.ic_cp_note + EventType.EXERCISE -> R.drawable.ic_cp_exercise + EventType.QUESTION -> R.drawable.ic_cp_question + EventType.ANNOUNCEMENT -> R.drawable.ic_cp_announcement + } + ) + binding.title.text = rh.gs( + when (options) { + EventType.BGCHECK -> R.string.careportal_bgcheck + EventType.SENSOR_INSERT -> R.string.careportal_cgmsensorinsert + EventType.BATTERY_CHANGE -> R.string.careportal_pumpbatterychange + EventType.NOTE -> R.string.careportal_note + EventType.EXERCISE -> R.string.careportal_exercise + EventType.QUESTION -> R.string.careportal_question + EventType.ANNOUNCEMENT -> R.string.careportal_announcement + } + ) when (options) { EventType.QUESTION, @@ -157,15 +164,21 @@ class CareDialog : DialogFragmentWithDate() { if (profileFunction.getUnits() == GlucoseUnit.MMOL) { binding.bgUnits.text = rh.gs(R.string.mmol) - binding.bg.setParams(savedInstanceState?.getDouble("bg") - ?: bg, 2.0, 30.0, 0.1, DecimalFormat("0.0"), false, binding.okcancel.ok, bgTextWatcher) + binding.bg.setParams( + savedInstanceState?.getDouble("bg") + ?: bg, 2.0, 30.0, 0.1, DecimalFormat("0.0"), false, binding.okcancel.ok, bgTextWatcher + ) } else { binding.bgUnits.text = rh.gs(R.string.mgdl) - binding.bg.setParams(savedInstanceState?.getDouble("bg") - ?: bg, 36.0, 500.0, 1.0, DecimalFormat("0"), false, binding.okcancel.ok, bgTextWatcher) + binding.bg.setParams( + savedInstanceState?.getDouble("bg") + ?: bg, 36.0, 500.0, 1.0, DecimalFormat("0"), false, binding.okcancel.ok, bgTextWatcher + ) } - binding.duration.setParams(savedInstanceState?.getDouble("duration") - ?: 0.0, 0.0, Constants.MAX_PROFILE_SWITCH_DURATION, 10.0, DecimalFormat("0"), false, binding.okcancel.ok) + binding.duration.setParams( + savedInstanceState?.getDouble("duration") + ?: 0.0, 0.0, Constants.MAX_PROFILE_SWITCH_DURATION, 10.0, DecimalFormat("0"), false, binding.okcancel.ok + ) if (options == EventType.NOTE || options == EventType.QUESTION || options == EventType.ANNOUNCEMENT || options == EventType.EXERCISE) binding.notesLayout.root.visibility = View.VISIBLE // independent to preferences binding.bgLabel.labelFor = binding.bg.editTextId @@ -215,7 +228,7 @@ class CareDialog : DialogFragmentWithDate() { if (options == EventType.NOTE || options == EventType.EXERCISE) { actions.add(rh.gs(R.string.duration_label) + ": " + rh.gs(R.string.format_mins, binding.duration.value.toInt())) therapyEvent.duration = T.mins(binding.duration.value.toLong()).msecs() - valuesWithUnit.add(ValueWithUnit.Minute(binding.duration.value.toInt()).takeIf { !binding.duration.value.equals(0.0) } ) + valuesWithUnit.add(ValueWithUnit.Minute(binding.duration.value.toInt()).takeIf { !binding.duration.value.equals(0.0) }) } val notes = binding.notesLayout.notes.text.toString() if (notes.isNotEmpty()) { @@ -227,7 +240,7 @@ class CareDialog : DialogFragmentWithDate() { therapyEvent.enteredBy = enteredBy - val source = when (options) { + val source = when (options) { EventType.BGCHECK -> UserEntry.Sources.BgCheck EventType.SENSOR_INSERT -> UserEntry.Sources.SensorInsert EventType.BATTERY_CHANGE -> UserEntry.Sources.BatteryChange diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt index c7cac95f15..4d93276d30 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt @@ -7,7 +7,6 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.database.entities.BolusCalculatorResult import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson import info.nightscout.androidaps.extensions.toJson @@ -15,6 +14,7 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.interfaces.Constants import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogWizardinfoBinding import org.json.JSONObject diff --git a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 76169aff12..c8c0e6e0e3 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -6,16 +6,16 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InsulinConfiguration import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.rx.bus.RxBus +import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.Config +import info.nightscout.rx.bus.RxBus import org.json.JSONObject import org.junit.Before import org.mockito.ArgumentMatchers.anyDouble diff --git a/wear/build.gradle b/wear/build.gradle index 3fede2268c..4a0f6de6fa 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -10,11 +10,14 @@ buildscript { classpath 'com.hiya:jacoco-android:0.2' } } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-allopen' -apply plugin: 'com.hiya.jacoco-android' + +plugins { + id 'com.android.application' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/android_dependencies.gradle" From 821c77cdecf0644de516ca079fad148fe50cfdf9 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Nov 2022 09:29:04 +0100 Subject: [PATCH 10/42] New Crowdin updates (#2166) * New translations strings.xml (Spanish) * New translations strings.xml (Spanish) * New translations strings.xml (Spanish) * Update source file strings.xml * Update source file strings.xml * Update source file strings.xml * Update source file strings.xml * New translations strings.xml (Romanian) * New translations strings.xml (French) * New translations strings.xml (Greek) * New translations strings.xml (Spanish) * New translations strings.xml (Afrikaans) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Hebrew) * New translations strings.xml (Italian) * New translations strings.xml (Korean) * New translations strings.xml (Lithuanian) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Turkish) * New translations strings.xml (Swedish) * New translations strings.xml (Slovak) * New translations strings.xml (Russian) * New translations strings.xml (Portuguese) * New translations strings.xml (Polish) * New translations strings.xml (Greek) * New translations strings.xml (Spanish) * New translations strings.xml (Afrikaans) * New translations strings.xml (Bulgarian) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Irish) * New translations strings.xml (Romanian) * New translations strings.xml (Hebrew) * New translations strings.xml (Hungarian) * New translations strings.xml (Italian) * New translations strings.xml (Korean) * New translations strings.xml (Lithuanian) * New translations strings.xml (Dutch) * New translations strings.xml (Romanian) * New translations strings.xml (French) * New translations strings.xml (Catalan) * New translations strings.xml (French) * New translations strings.xml (Russian) * New translations strings.xml (Serbian (Latin)) * New translations strings.xml (Croatian) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Turkish) * New translations strings.xml (Swedish) * New translations strings.xml (Slovak) * New translations strings.xml (Portuguese) * New translations strings.xml (Polish) * New translations strings.xml (Norwegian) * New translations strings.xml (Spanish) * New translations strings.xml (German) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Czech) * New translations strings.xml (Dutch) * New translations strings.xml (Lithuanian) * New translations strings.xml (Korean) * New translations strings.xml (Italian) * New translations strings.xml (Danish) * New translations strings.xml (Hebrew) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Turkish) * New translations strings.xml (Swedish) * New translations strings.xml (Slovak) * New translations strings.xml (Russian) * New translations strings.xml (Portuguese) * New translations strings.xml (Polish) * New translations strings.xml (Norwegian) * New translations strings.xml (Slovak) * New translations strings.xml (Spanish) * New translations strings.xml (Spanish) * Update source file strings.xml * New translations strings.xml (French) * New translations strings.xml (Czech) * New translations strings.xml (Catalan) * New translations strings.xml (Bulgarian) * New translations strings.xml (Spanish) * New translations strings.xml (Romanian) * New translations strings.xml (Danish) * New translations strings.xml (Russian) * New translations strings.xml (Polish) * New translations strings.xml (Portuguese) * New translations strings.xml (Norwegian) * New translations strings.xml (Slovak) * New translations strings.xml (Lithuanian) * New translations strings.xml (Swedish) * New translations strings.xml (Dutch) * New translations strings.xml (Italian) * New translations strings.xml (Korean) * New translations strings.xml (German) * New translations strings.xml (Hebrew) * New translations strings.xml (Turkish) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Spanish) * New translations strings.xml (Russian) * New translations strings.xml (Dutch) * New translations exam.xml (Dutch) * New translations objectives.xml (Dutch) * New translations strings.xml (Dutch) * New translations strings.xml (Dutch) * New translations strings.xml (Dutch) * New translations strings.xml (Dutch) * New translations strings.xml (Dutch) * New translations strings.xml (Dutch) * New translations strings.xml (Dutch) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) * New translations strings.xml (French) --- app/src/main/res/values-af-rZA/strings.xml | 26 ---- app/src/main/res/values-bg-rBG/strings.xml | 33 ----- app/src/main/res/values-ca-rES/strings.xml | 20 --- app/src/main/res/values-cs-rCZ/strings.xml | 47 ------ app/src/main/res/values-da-rDK/strings.xml | 46 ------ app/src/main/res/values-de-rDE/strings.xml | 46 ------ app/src/main/res/values-el-rGR/strings.xml | 25 ---- app/src/main/res/values-es-rES/strings.xml | 49 +------ app/src/main/res/values-fr-rFR/strings.xml | 47 ------ app/src/main/res/values-it-rIT/strings.xml | 47 ------ app/src/main/res/values-iw-rIL/strings.xml | 46 ------ app/src/main/res/values-ko-rKR/strings.xml | 28 ---- app/src/main/res/values-lt-rLT/strings.xml | 31 ---- app/src/main/res/values-nl-rNL/exam.xml | 46 ++++++ app/src/main/res/values-nl-rNL/objectives.xml | 2 + app/src/main/res/values-nl-rNL/strings.xml | 64 +++------ app/src/main/res/values-no-rNO/strings.xml | 47 ------ app/src/main/res/values-pl-rPL/strings.xml | 33 ----- app/src/main/res/values-pt-rBR/strings.xml | 36 ----- app/src/main/res/values-pt-rPT/strings.xml | 31 ---- app/src/main/res/values-ro-rRO/strings.xml | 32 ----- app/src/main/res/values-ru-rRU/strings.xml | 47 ------ app/src/main/res/values-sk-rSK/strings.xml | 47 ------ app/src/main/res/values-sv-rSE/strings.xml | 31 ---- app/src/main/res/values-tr-rTR/strings.xml | 47 ------ app/src/main/res/values-zh-rCN/strings.xml | 46 ------ .../src/main/res/values-nl-rNL/strings.xml | 1 + core/src/main/res/values-bg-rBG/strings.xml | 10 -- core/src/main/res/values-ca-rES/strings.xml | 9 -- core/src/main/res/values-cs-rCZ/strings.xml | 10 -- core/src/main/res/values-da-rDK/strings.xml | 10 -- core/src/main/res/values-de-rDE/strings.xml | 10 -- core/src/main/res/values-es-rES/strings.xml | 38 +++-- core/src/main/res/values-fr-rFR/strings.xml | 19 ++- core/src/main/res/values-it-rIT/strings.xml | 10 -- core/src/main/res/values-iw-rIL/strings.xml | 10 -- core/src/main/res/values-ko-rKR/strings.xml | 10 -- core/src/main/res/values-lt-rLT/strings.xml | 10 -- core/src/main/res/values-nl-rNL/strings.xml | 42 ++++-- core/src/main/res/values-no-rNO/strings.xml | 10 -- core/src/main/res/values-pl-rPL/strings.xml | 10 -- core/src/main/res/values-pt-rBR/strings.xml | 9 -- core/src/main/res/values-pt-rPT/strings.xml | 10 -- core/src/main/res/values-ro-rRO/strings.xml | 10 -- core/src/main/res/values-ru-rRU/strings.xml | 10 -- core/src/main/res/values-sk-rSK/strings.xml | 19 ++- core/src/main/res/values-sv-rSE/strings.xml | 10 -- core/src/main/res/values-tr-rTR/strings.xml | 10 -- core/src/main/res/values-zh-rCN/strings.xml | 10 -- .../src/main/res/values-es-rES/strings.xml | 19 +++ .../src/main/res/values-nl-rNL/strings.xml | 26 ++++ .../src/main/res/values-nl-rNL/strings.xml | 1 + .../src/main/res/values-bg-rBG/strings.xml | 1 - .../src/main/res/values-ca-rES/strings.xml | 1 - .../src/main/res/values-cs-rCZ/strings.xml | 1 - .../src/main/res/values-da-rDK/strings.xml | 1 - .../src/main/res/values-de-rDE/strings.xml | 1 - .../src/main/res/values-es-rES/strings.xml | 1 - .../src/main/res/values-fr-rFR/strings.xml | 3 +- .../src/main/res/values-it-rIT/strings.xml | 1 - .../src/main/res/values-iw-rIL/strings.xml | 1 - .../src/main/res/values-ko-rKR/strings.xml | 1 - .../src/main/res/values-lt-rLT/strings.xml | 1 - .../src/main/res/values-nl-rNL/strings.xml | 49 ++++++- .../src/main/res/values-no-rNO/strings.xml | 1 - .../src/main/res/values-pl-rPL/strings.xml | 1 - .../src/main/res/values-pt-rBR/strings.xml | 1 - .../src/main/res/values-pt-rPT/strings.xml | 1 - .../src/main/res/values-ro-rRO/strings.xml | 1 - .../src/main/res/values-ru-rRU/strings.xml | 2 +- .../src/main/res/values-sk-rSK/strings.xml | 1 - .../src/main/res/values-sv-rSE/strings.xml | 1 - .../src/main/res/values-tr-rTR/strings.xml | 1 - .../src/main/res/values-zh-rCN/strings.xml | 1 - .../src/main/res/values-fr-rFR/strings.xml | 20 ++- .../src/main/res/values-nl-rNL/strings.xml | 134 +++++++++++++++++- ui/src/main/res/values-af-rZA/strings.xml | 2 + ui/src/main/res/values-bg-rBG/strings.xml | 2 + ui/src/main/res/values-ca-rES/strings.xml | 2 + ui/src/main/res/values-cs-rCZ/strings.xml | 2 + ui/src/main/res/values-da-rDK/strings.xml | 2 + ui/src/main/res/values-de-rDE/strings.xml | 2 + ui/src/main/res/values-el-rGR/strings.xml | 2 + ui/src/main/res/values-es-rES/strings.xml | 35 +++++ ui/src/main/res/values-fr-rFR/strings.xml | 41 ++++++ ui/src/main/res/values-ga-rIE/strings.xml | 2 + ui/src/main/res/values-hr-rHR/strings.xml | 2 + ui/src/main/res/values-hu-rHU/strings.xml | 2 + ui/src/main/res/values-it-rIT/strings.xml | 2 + ui/src/main/res/values-iw-rIL/strings.xml | 2 + ui/src/main/res/values-ko-rKR/strings.xml | 2 + ui/src/main/res/values-lt-rLT/strings.xml | 2 + ui/src/main/res/values-nl-rNL/strings.xml | 63 ++++++++ ui/src/main/res/values-no-rNO/strings.xml | 2 + ui/src/main/res/values-pl-rPL/strings.xml | 2 + ui/src/main/res/values-pt-rBR/strings.xml | 2 + ui/src/main/res/values-pt-rPT/strings.xml | 2 + ui/src/main/res/values-ro-rRO/strings.xml | 2 + ui/src/main/res/values-ru-rRU/strings.xml | 2 + ui/src/main/res/values-sk-rSK/strings.xml | 2 + ui/src/main/res/values-sr-rCS/strings.xml | 2 + ui/src/main/res/values-sv-rSE/strings.xml | 2 + ui/src/main/res/values-tr-rTR/strings.xml | 2 + ui/src/main/res/values-zh-rCN/strings.xml | 2 + 104 files changed, 582 insertions(+), 1177 deletions(-) diff --git a/app/src/main/res/values-af-rZA/strings.xml b/app/src/main/res/values-af-rZA/strings.xml index 2b49762687..3403fa87d3 100644 --- a/app/src/main/res/values-af-rZA/strings.xml +++ b/app/src/main/res/values-af-rZA/strings.xml @@ -28,18 +28,6 @@ Onvang BG waardes vanaf die 600SeriesAndroidUploader. Laai BG data af vanaf Nightscout Stoor alle behandelings wat gedoen was - Insulien: - Karbs: - IAB: - Totale IAB: - Totale IAB aktiwiteit: - Dur: - Verhouding: - Ins: - IAB: - Totale IOB: - TT - Corr Begin nou VIRTUELE POMP Vorige lopie @@ -74,7 +62,6 @@ Plugin is gedeaktiveer Beperkings skending Aanvaar nuwe tydelike basale: - Behandeling Verander jou insette! BG bron APS modus @@ -82,7 +69,6 @@ Oop lus Nuwe voorstel beskikbaar Weergawe van Nightscout nie ondersteun - Basale IAB TydelikeBasaal Verlengde Bolus Nightscout-weergawe: @@ -108,7 +94,6 @@ Geldig: Voeg by Wysig - Maaltyd Corr Aksies Pomp nie geïnisialiseer nie! @@ -132,7 +117,6 @@ Autosens data Skrip foutopspoor Gebruik autosens kenmerk - Skrap behandelings in die toekoms ACT CONF LUS @@ -191,8 +175,6 @@ Ontkoppel pomp vir 3 h Hervat Herverbind Pomp - KOB - Superbolus Log app begin na NS Begin toepassing weer om instellings toe te pas. Watter tipe insulien gebruik jy? @@ -361,7 +343,6 @@ Virtuele Pomp Pomp definisie Bolus: Stap =%1$s\nVerlengde Bolus: [stap%2$s, duur = =%3$smin -%4$sh]\nBasal: stap =%5$s\nTBR: %6$s (deur %7$s), duur =%8$smin -%9$sh\n%10$s - Ghoeroe-instellings Berekeninge is ingesluit in die ghoeroe verslag: Vertooninstellings Algemene instellings @@ -400,8 +381,6 @@ Herstel na verstek NSClient onklaar. Oorweeg om NS en NSClient te herlaai. Verkose APS modus - Totaal - Bereken Stuur vandag se loglêers aan ontwikkelaars saam met hierdie tyd. Onverwagte situasie. Minimale versoek verandering [%] Oop lus sal nuwe verandering versoek as die %. Verstek waarde is 20% @@ -425,12 +404,7 @@ Laai profiel veranderings, tydelike teikens op Laai BG toetse op 2h - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Projeksies - Prima diff --git a/app/src/main/res/values-bg-rBG/strings.xml b/app/src/main/res/values-bg-rBG/strings.xml index 6d45ac761c..576b3b89e8 100644 --- a/app/src/main/res/values-bg-rBG/strings.xml +++ b/app/src/main/res/values-bg-rBG/strings.xml @@ -32,19 +32,6 @@ Изтегля стойности на КЗ от Nightscout Получаване на данни за КЗ от xDrip+. Записва всички процедури, които са били направени - Инсулин: - Вълехидрати: - IOB: - Общо IOB: - Общо активен IOB: - Прод.: - Съотношение: - Инс: - IOB: - Общо IOB: - Вр.цел - Корекция - IOB от болуси Старт сега ВИРТУАЛНА ПОМПА Последно изпълнение @@ -80,7 +67,6 @@ Модула е изключен Нарушено ограничение Приложи нов временен базал: - Болус Променете данните! Източник на данни за КЗ xDrip+ @@ -91,7 +77,6 @@ Има ново предложение Предложение Несъвместима версия на Nightscout - Базален IOB ВХ след Профил Временен базал @@ -138,7 +123,6 @@ Валиден от: Добави Редакция - Хранене Корекция Действия (ОПАСНО ЗА ДЕАКТИВИРАНЕ) Само качвай данни в NS @@ -167,8 +151,6 @@ Autosens данни От скрипта Използвайте функцията за Autosens - Презареди от NS - Изтрий записите в бъдещето ДЕЙСТВ КОНФ ЦИК @@ -242,9 +224,6 @@ 10 часа Възстанови Свържи помпа - Δ за 15мин - СОВ - Суперболус Записвай всяко стартиране на AndroidAPS в NS Рестартиране за да се приложат новите настройки. Кой тип на инсулин използвате? @@ -461,7 +440,6 @@ Виртуална помпа тип Описание на помпата Болус: Стъпка =%1$s\Удължен болус: [стъпка =%2$s, продължителност =%3$smin -%4$sh] \nБазал: стъпка =%5$s\ nTBR: %6$s (от %7$s), продължителност =%8$sмин -%9$sh\n%10$s - Настройки на съветник Изчисления, включени в резултата на съветника: Настройки за визуализация Основни настройки @@ -494,8 +472,6 @@ Когато се установи резистентност, намалява целевата глюкоза. Чувствителността увеличава целта Когато се установи чувствителност, повишаване на целевата глюкоза - Покажи невалидните - Скрий невалидните Премахни артикули Подреди артикули Открити са предишни настройки @@ -515,8 +491,6 @@ Възстанови настройките по подразбиране Грешка в NSClient. Рестартирайте Nightscout и NSClient Предпочитаният режим на APS - Общо - Калк Изпрати последните лог файлове на разработчиците. Непредвидена ситуация. Минимална стойност за промяна [%] AndroidAPS ще покаже запитването за промяна на базала само ако е по-голямо от тази стойност.(Стандартно 20%) @@ -548,17 +522,12 @@ Стартирай част от резултата в калкулатора [%] Калкулатора изчислява нужния инсулин, но само тази част ще бъде доставена. Полезно със SMB алгоритъма. Повишавам максималната стойност на базал, защото тя е по-ниска от най-високата в базалния профил - %1$s ISF: %2$.1f - %1$.0fгр Чувств: %2$.1f - %1$.1fгр Чувств: %2$.1f - %1$d %% Избрано: Единици Изчисти приключение Изчисти стартираните Искате ли да нулирате прогреса си? Изберете единиците, в които искате да работите - Създай нов профил копирайки този? Ниската граница на диапазона (графика) Високата граница на диапазона (графика) Невалидна стойност в % @@ -614,14 +583,12 @@ Меню на графиката Премахни филтъра Канюла - Потербителска настройка Използвай стойностите от вашето най-голямо хранен, с което обикновено се храните Електронна поща Настройки за поверителност Можете да посочите електронна поща, ако искате да бъдете уведомени за системни проблеми. Това не е автоматичен процес. Разработчиците ще се свържат с вас в случай на опасна ситуация. Пълна синхронизация Пълна синхронизация? Може да отнеме много часове и докато не приключи вие няма да виждате нови данни в NS. - Пълнене Синхронизация Профили, болуси, въглехидрати, и временни базали се изпращат към NS Изпратете данните към NS diff --git a/app/src/main/res/values-ca-rES/strings.xml b/app/src/main/res/values-ca-rES/strings.xml index d886968231..a9f864c87c 100644 --- a/app/src/main/res/values-ca-rES/strings.xml +++ b/app/src/main/res/values-ca-rES/strings.xml @@ -31,19 +31,6 @@ Descarrega dades de glucèmia des de Nightscout Rebre valors de glucèmia de xDrip+. Desa tots els tractaments realitzats - Insulina: - Carbs: - IOB: - IOB total: - Activitat total IOB: - Durada: - Ràtio: - Ins: - IOB: - IOB total: - OT - Corr - IOB Bolus Executar ara BOMBA VIRTUAL Última execució @@ -78,7 +65,6 @@ Plugin desactivat Violació de restriccions Acceptar nova basal temporal: - Tractament Modifiqueu les dades! Origen glucèmia xDrip+ @@ -89,7 +75,6 @@ Nova proposta disponible Proposta de carbs Versió no compatible de Nightscout - IOB Basal BasalTemp Bolus estès Versió de Nightscout: @@ -133,7 +118,6 @@ Vàlid: Afegir Editar - Àpat Corr Accions (PERILLÓS DESACTIVAR) Només enviar a NS @@ -145,8 +129,6 @@ Dades autosens Depurar script Utilitzar funció Autosens - Actualitzar des de NS - Eliminar tractaments en el futur ACC CONF LLAÇ @@ -176,8 +158,6 @@ 10 hores Reprendre Reconnectar bomba - COB - Superbolus Enregistrar l\'inici de l\'app a NS Sortint de l\'app per aplicar configuració. Quin tipus d\'insulina feu servir? diff --git a/app/src/main/res/values-cs-rCZ/strings.xml b/app/src/main/res/values-cs-rCZ/strings.xml index d4972dbf21..b842806566 100644 --- a/app/src/main/res/values-cs-rCZ/strings.xml +++ b/app/src/main/res/values-cs-rCZ/strings.xml @@ -34,19 +34,6 @@ Příjem glykémií z xDripu+. Ukládá všechny ošetření do databáze Zobrazování stavu a řízení AAPS z hodinek s WearOS. - Inzulín: - Sacharidy: - IOB: - Celkové IOB: - Celková aktivita IOB: - Trv: - Hodn: - Inz: - IOB: - Celkové IOB: - DC - Korekce - Bolusové IOB Spustit teď VIRTUÁLNÍ PUMPA Poslední spuštění @@ -85,7 +72,6 @@ Modul zakázán Mimo povolený rozsah Spustit nový dočasný bazál: - Bolus Změňte zadání! Zdroj glykémie Odkud má AAPS získávat glykémie? @@ -97,7 +83,6 @@ Dostupné nové doporučení Návrh sacharidů Nepodporovaná verze Nightscoutu - Bazální IOB Čas jídla Profil Dočasný bazál @@ -144,7 +129,6 @@ Platné: Přidat Upravit - Bolus Korekce Akce (NEBEZPEČNÉ ZAKÁZAT) Pouze odesílání do NS @@ -173,8 +157,6 @@ Data detekce senzitivity Ladící informace Používat autodetekci senzitivity - Aktualizovat z NS - Smazat události v budoucnosti AKCE KONF SMYČ @@ -248,9 +230,6 @@ 10 hodin Uvolnit Znovu připojit pumpu - 15min trend - COB - Superbolus Zaznamenávat spuštění aplikace do NS Ukončuji aplikaci, aby se nastavení projevilo. Jaký druh inzulínu používáte? @@ -475,7 +454,6 @@ Typ virtuální pumpy Definice pumpy Bolus: Krok =%1$s\nProdl. bolus: [Krok=%2$s, Délka=%3$smin-%4$sh]\nBazál: Krok=%5$s\nDoč. bazál: %6$s (%7$s), Délka=%8$smin-%9$sh\n%10$s - Nastavení wizardu Kalkulace použité ve výsledku wizardu: Nastavení zobrazení Obecné nastavení @@ -511,9 +489,6 @@ Je-li zjištěna rezistence, sníží nastavenou cílovou glykémii Citlivost zvyšuje cíl Je-li zjištěna vyšší citlivost, zvýší nastavenou cílovou glykémii - Odebrat záznamy spuštěné AAPS - Zobrazit neplatné - Skrýt zneplatněné Odstranit položky Seřadit položky Nalezeno uložené nastavení @@ -536,8 +511,6 @@ Obnovit výchozí Chyba NSClienta. Zvažte restart NS a NSClienta. Preferovaný režim APS - Výsledek - Kalk Odešlete dnešní soubory protokolů vývojářům spolu s tímto časem. Neočekávaná situace. Minimální změna pro výzvu [%] Otevřená smyčka vytvoří novou žádost o změnu pouze v případě, že změna je větší než tato hodnota. Výchozí hodnota je 20 % @@ -571,17 +544,12 @@ Podat tuto část z výsledku kalkulace [%] Kalkulátor provede výpočet, ale dodána je pouze tato část inzulínu. Výhodné při používání SMB algoritmu. Zvýšena hodnota maximálního bazálu, protože nastavení je nižší než Vaše maximální hodnota bazální profilu - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Vybráno: Jednotky Vymazat dokončeno Vymazat start Chcete resetovat začátek cíle? Můžete přijít o svůj pokrok. Vyberte jednotky, ve kterých chcete zobrazit hodnoty - Vytvořit z tohoto profilu nový profil? Spodní hodnota oblasti v rozsahu (pouze zobrazování) Horní hodnota oblasti v rozsahu (pouze zobrazování) Neplatný vstup % @@ -637,7 +605,6 @@ Možnosti grafu Vymazat filtr Kanyla - Vstup uživatele Použijte hodnoty pro největší jídlo, jaké obvykle jíte\n Tato e-identifikace bude připojena ke zprávám o pádech aplikace, abychom vás mohli kontaktovat v naléhavých případech. Je to dobrovolné. E-mailová adresa @@ -645,7 +612,6 @@ Pokud chcete být upozorněni na selhání aplikace, můžete zadat volitelně e-mailovou adresu. Toto není automatizovaná služba. Vývojáři vás budou kontaktovat v nebezpečných situacích. Plná synchronizace Úplná synchronizace? Může to trvat mnoho hodin a dokud neskončíte, nová data v NS neuvidíte. - Doplňování Synchronizace Profily, bolusy, sacharidy, dočasné bazály jsou nahrány do NS Nahrávat data do NS @@ -719,22 +685,9 @@ Neznámý příkaz k akci: Procentní podíl Výchozí nastavení aplikace - Zobrazit zneplatněné / odstraněné záznamy - Skrýt zneplatněné / odstraněné záznamy - Obnovit z Nightscoutu Odstranit zvolené položky - Vyberte pro odstranění - Změny profilu - Dočasné cíle - Sacharidy a bolusy - Opravdu chcete odstranit %1$d položku(y) - Žádné záznamy nejsou k dispozici - Skrýt smyčku - Zobrazit smyčku Vybráno: %1$d Seřadit - Zobrazit záznamy smyčky - Skrýt záznamy smyčky Stav smyčky Měřítko grafu Profil 1 diff --git a/app/src/main/res/values-da-rDK/strings.xml b/app/src/main/res/values-da-rDK/strings.xml index 48f6be3fbd..a39169d9cf 100644 --- a/app/src/main/res/values-da-rDK/strings.xml +++ b/app/src/main/res/values-da-rDK/strings.xml @@ -33,19 +33,6 @@ Downloader BG data fra Nightscout Modtag BG-værdier fra xDrip+. Gemmer alle behandlinger, der er foretaget - Insulin: - Kulhydrater: - IOB: - Total IOB: - Total IOB aktivitet: - Tid: - Ratio: - Ins: - IOB: - Total IOB: - Midlertidig Mål - Korrektion - Bolus IOB Kør nu VIRTUEL PUMPE Sidst kørt @@ -81,7 +68,6 @@ Plugin deaktiveret Begrænsninger overtrådt Acceptér ny midlertidig basal: - Behandling Skift dit input! BG kilde xDrip+ @@ -92,7 +78,6 @@ Nyt forslag tilgængeligt Kulhydrat Forslag Ikke understøttet version af Nightscout - Basal IOB Kulhydrat tid Profil Midlertidig basal @@ -139,7 +124,6 @@ Gyldig: Tilføj Rediger - Måltid Korrektion Handlinger (FARLIG AT DEAKTIVERE) Kun NS upload @@ -168,8 +152,6 @@ Autosens data Script fejlfinding Brug Autosens funktion - Opdater fra NS - Fjern behandlinger i fremtiden AKT KONF LOOP @@ -243,9 +225,6 @@ 10 timer Genoptag Genforbind Pumpe - 15 min tendens - COB - Superbolus Log app-start til NS Afslutter applikationen for at anvende indstillinger. Hvilken type insulin bruger du? @@ -469,7 +448,6 @@ Virtuel pumpe type Pumpe Definition Bolus: Trin=%1$s\nForlænget Bolus: [Trin=%2$s, Varighed=%3$smin-%4$sh]\nBasal: Trin=%5$s\nTBR: %6$s (by %7$s), Varighed=%8$smin-%9$sh\n%10$s - Guide indstillinger Beregninger inkluderet i guide resultatet: Visningsindstillinger Generelle indstillinger @@ -502,8 +480,6 @@ Når der påvises resistens, sænkes målglukosen Følsomhed hæver midlertidige mål Når der påvises følsomhed, skal målglukosen hæves - Vis ugyldige - Skjul ugyldige Fjern elementer Sortér elementer Gemte indstillinger fundet @@ -525,8 +501,6 @@ Nulstil til standardindstillinger NSClient funktionsfejl. Overvej NS og NSClient genstart. Foretrukket APS-tilstand - I alt - Beregn Send dagens logfiler til udviklere sammen med denne tid. Uventet situation. Minimal anmodningsændring [%] Åben Loop vil kun foreslå ny ændringsanmodning, hvis ændringen er større end denne værdi i %. Standardværdien er 20% @@ -559,17 +533,12 @@ Afgiv denne del af bolusguidens resultat [%] Bolus guiden udfører beregning, men kun denne del af beregnet insulin leveres. Nyttig med SMB algoritme. Stigende max basal værdi, fordi indstillingen er lavere end din max basal i profil - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Valgt: Enheder Ryd færdigt Ryd startet Vil du nulstille objektiv start? Du kan miste dine fremskridt. Vælg enheder du vil vise værdier i - Opret ny profil fra denne profil? Nedre værdi for målområde (kun visning) Øvre værdi for målområde (kun visning) Ugyldig angivelse af % @@ -624,7 +593,6 @@ Diagrammenu Nulstil filter Kanyle - Bruger indtastning Brug værdien af den største mængde mad du plejer at indtage\n Denne identifikation vil blive vedhæftet til nedbrudsrapporter, så vi kan kontakte dig i hastende tilfælde. Det er valgfrit. E-mail adresse @@ -632,7 +600,6 @@ Du kan angive valgfri e-mail-adresse, hvis du ønsker at blive underrettet om app nedbrud. Dette er ikke en automatiseret tjeneste. Du vil blive kontaktet af udviklere i farlige situationer. Fuld synkronisering Fuld synkronisering? Det kan tage mange timer, og indtil du er færdig, vil du ikke se nye data i NS. - Klargør Synkronisering Profiler, bolusser, kulhydrater, midlertidige basaler uploades til NS Upload data til NS @@ -706,22 +673,9 @@ Ukendt kommando: Procentdel Program standard - Vis ugyldige / fjernede poster - Skjul ugyldige / fjernede poster - Opdater fra Nightscout Fjern valgte elementer - Vælg for at fjerne - Profil ændringer - Midlertidig mål - Kulhydrater og bolus - Er du sikker på, at du vil fjerne %1$d elementer? - Ingen poster tilgængelige - Skjul loop - Vis loop %1$d valgt Sortér - Vis loop poster - Skjul loop poster Loop status Graf skala Profil 1 diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index 1457e6bbf1..3ff399ae3a 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -33,19 +33,6 @@ Lade Blutzuckerdaten von Nightscout Empfange Blutzuckerwerte von xDrip+. Speichert alle eingegebenen Behandlungen - Insulin: - Kohlenhydrate: - IOB: - Gesamt IOB: - Ges. IOB Aktivität: - Dauer: - Verhältnis: - Ins: - IOB: - Gesamt IOB: - TT - Korr - Bolus-IOB Ausführen VIRTUELLE PUMPE Letzte Ausführung @@ -81,7 +68,6 @@ Plugin ist deaktiviert Beschränkungen wurden verletzt oder Limit erreicht. Akzeptiere neue TBR: - Bolus Ändere deine Eingabe! BZ-Quelle xDrip+ @@ -92,7 +78,6 @@ Neue Empfehlung verfügbar Kohlenhydrate Vorschlag Nicht unterstützte Nightscout-Version - Basal-IOB KH-Zeit Profil TBR @@ -139,7 +124,6 @@ Gültigkeit: Hinzufügen Bearbeiten - Essensbolus Korr Aktionen (DEAKTIVIEREN GEFÄHRLICH) Zu NS nur hochladen @@ -168,8 +152,6 @@ Autosens-Daten Skript Debug Nutze Autosens - Mit NIghtscout-Daten aktualisieren - Lösche Behandlungen in der Zukunft AKT KONF LOOP @@ -243,9 +225,6 @@ 10 Std. Fortsetzen Pumpe erneut verbinden - 15 min Trend - COB - Superbolus Logge App-Start in Nightscout App wird beendet, um neue Einstellungen zu laden. Welchen Insulin-Typ verwendest Du? @@ -469,7 +448,6 @@ Typ der virtuellen Pumpe Pumpen-Definition Bolus: Schritt=%1$s\nVerzögerter Bolus: [Schritt=%2$s, Dauer=%3$smin-%4$sh]\nBasal: Schritt=%5$s\nTBR: %6$s (bei %7$s), Dauer=%8$smin-%9$sh\n%10$s - Wizard-Einstellungen Berechnungen, die im Assistenten berücksichtigt werden: Anzeigeeinstellungen Allgemeine Einstellungen @@ -502,8 +480,6 @@ Wenn Resistenz festgestellt wird, senke den Glukose-Zielwert Empfindlichkeit erhöht den Zielwert Wenn eine höhere Empfindlichkeit festgestellt wird, wird der Glukose-Zielwert erhöht. - Zeige Ungültige - Verstecke Ungültige Objekte entfernen Einträge sortieren Gespeicherte Einstellungen gefunden @@ -525,8 +501,6 @@ Auf Standardwerte zurücksetzen NSClient Störung. Ziehe einen Neustart von NS und NSClient in Betracht. Bevorzugter APS-Modus - Gesamt - Berech. Sende die heutigen Logdateien unter Angabe dieser Uhrzeit an die Entwickler. Unerwartetes Verhalten. Minimaler Wert zur Anfrage einer Änderung [%] @@ -560,17 +534,12 @@ Unerwartetes Verhalten. Abgabe von [%] des Ergebnisses des Bolus-Rechners Der Bolus-Rechner führt Berechnungen durch, aber nur dieser Teil der berechneten Insulin wird abgegeben. Nützlich mit SMB-Algorithmus. Der Wert max basal wird erhöht, weil Du ihn niedriger eingestellt hast als die höchste Basalrate in Deinem Profil. - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Ausgewählt: Einheiten Ziel erneut öffnen Ziel neu starten Möchtest Du den Start der Ziele zurücksetzen? Du verlierst Deine Fortschritte. Wähle die Einheit, in der die Werte angezeigt werden sollen. - Neues Profil auf Basis dieses Profils erstellen? Unterer Wert des Zielbereichs (nur Anzeige) Oberer Wert des Zielbereichs (nur Anzeige) Ungültige % Eingabe @@ -625,7 +594,6 @@ Unerwartetes Verhalten. Diagrammmenü Filter löschen Kanüle - Benutzereingabe Verwende die Werte der größten Mahlzeit, die Du normalerweise zu Dir nimmst\n Diese Identifikation wird an Absturzberichte angehängt, so dass wir Dich in dringenden Fällen kontaktieren können. Angabe ist optional. E‐Mail‐Adresse @@ -633,7 +601,6 @@ Unerwartetes Verhalten. Du kannst optional eine E-Mail-Adresse angeben, wenn Du bei Absturzberichten kontaktiert werden möchtest. Dies ist keine Automatik, Du wirst von den Entwicklern in gefährlichen Situationen kontaktiert. Vollständige Synchronisierung Vollständige Synchronisierung? Es kann viele Stunden dauern und bis zur Fertigstellung wirst du keine neuen Daten in NS sehen. - Füllen Synchronisierung Profile, Boli, Kohlenhydrate und temporäre Basalraten werden zu NS hochgeladen Daten zu NS hochladen @@ -707,22 +674,9 @@ Unerwartetes Verhalten. Unbekannter Actionbefehl: Prozentsatz Standardwert der Anwendung - Zeige ungültige / gelöschte Einträge - Verberge ungültige / gelöschte Einträge - Aktualisiere von Nightscout Ausgewähltes Objekt löschen - Zum Entfernen auswählen - Profilwechsel - Temporäre Ziele - Kohlenhydrate & Bolus - Sind Sie sicher, dass Sie diese(s) %1$d Element(e) löschen möchten? - Keine Datensätze verfügbar - Verberge Loop - Zeige Loop an %1$d ausgewählt Sortieren - Zeige Loop Datensätze - Verberge Loop Datensätze Loop Status Diagrammskala Profil 1 diff --git a/app/src/main/res/values-el-rGR/strings.xml b/app/src/main/res/values-el-rGR/strings.xml index 323d462e62..a9e2f72f26 100644 --- a/app/src/main/res/values-el-rGR/strings.xml +++ b/app/src/main/res/values-el-rGR/strings.xml @@ -28,18 +28,6 @@ Λάβετε τις τιμές BG από το 600SeriesAndroidUploader. Λήψη δεδομένων BG από Nightscout Σώζει όλες τις θεραπείες που έγιναν - Ινσουλίνη: - Υδατάνθρακες: - IOB: - Συνολική IOB: - Συνολική δραστηριότητα IOB: - Διάρκεια: - Αναλογία: - Ins: - IOB: - Συνολική IOB: - TT - Διόρθωση Έναρξη τώρα ΕΙΚΟΝΙΚΗ ΑΝΤΛΙΑ Τελευταίος Υπολογισμός @@ -75,7 +63,6 @@ Προσθήκη απενεργοποιημένη Παραβίαση Περιορισμών Αποδοχή νέου Προσ Ρυθμού: - Θεραπεία Αλλάξτε αυτό που εισάγατε! Πηγή BG Λειτουργία APS @@ -83,7 +70,6 @@ Ανοιχτό Κύκλωμα Νέα πρόταση διαθέσιμη Μη υποστηριζόμενη έκδοση Nightscout - Βασική ΙΟΒ Προσ Ρυθμός Εκτεταμμένο Bolus Έκδοση Nightscout: @@ -108,7 +94,6 @@ Ισχύς: Προσθήκη Διαμόρφωση - Γεύμα Διορθ Ενέργειες Η αντλία δεν έχει ρυθμιστεί! @@ -132,7 +117,6 @@ Δεδομένα Autosens Εντοπισμός σφαλμάτων δέσμης ενεργειών Χρήση του Autosens - Διαγραφή συμβάντων στο μέλλον ΔΡΑΣΗ Διαμόρφωση ΚΥΚΛΩΜΑ @@ -191,8 +175,6 @@ Αποσύνδεση αντλίας για 3h Επαναφορά Επανασύνδεση αντλίας - COB - Superbolus Η εφαρμογή καταγραφής ξεκινά από το NS Έξοδος από το application για την εφαρμογή των ρυθμίσεων Ποιο τύπο ινσουλίνης χρησιμοποιείτε; @@ -361,7 +343,6 @@ Τύπος εικονικής αντλίας Ορισμός Αντλίας Bolus: Άμεσο=%1$s\nΕκτεταμένο Bolus: [Άμεσο=%2$s, Διάρκεια=%3$smin-%4$sh]\nΒασικός: Άμεσο=%5$s\nTBR: %6$s (με %7$s), Διάρκεια=%8$smin-%9$sh\n%10$s - Ρυθμίσεις Γρήγορου Οδηγού Υπολογισμοί που περιλαμβάνονται στο αποτέλεσμα του γρήγορου οδηγού: Ρυθμίσεις Εμφάνισης Γενικές Ρυθμίσεις @@ -401,8 +382,6 @@ Επαναφορά προεπιλογών Δυσλειτουργία NSClient. Εξετάστε την επανεκκίνηση του NS και του NSClient. Προτιμώμενη λειτουργία APS - Σύνολο - Υπολογ Στείλτε τα αρχεία καταγραφής της ημέρας στους προγραμματιστές μαζί με αυτή τη φορά. Απροσδόκητη κατάσταση. Ελάχιστο αίτημα για αλλαγή [%] Το Ανοιχτό κύκλωμα θα εμφανίσει νέο μήνυμα αλλαγής μόνο αν η αλλαγή είναι μεγαλύτερη από αυτήν τη τιμή %. Προεπιλεγμένη τιμή 20% @@ -430,10 +409,6 @@ Χορήγηση του αποτελέσματος αυτού του μέρους του υπολογισμού bolus [%] Ο Υπολογισμός Bolus κάνει υπολογισμούς αλλά μόνο αυτό το μέρος της υπολογίσημης ινσουλίνης χορηγείται. Χρήσιμο με τον αλγόριθμο SMB. Αυξείστε την μέγιστη βασική τιμή, επειδή η ρύθμιση είναι χαμηλότερη από τη μέγιστη βασική στο προφίλ σας - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index 2fe4050c76..235c4fb5c1 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -34,19 +34,6 @@ Recibir los valores de glucosa de xDrip+ Guarda todos los tratamientos que se realizaron Supervisar y controlar AAPS usando un reloj WearOS - Insulina: - Carbohidratos: - IOB: - IOB total: - Actividad total IOB: - Dur: - Ratio: - Ins: - IOB: - IOB Total: - OT - Corrección - Bolo IOB Ejecutar ahora BOMBA VIRTUAL Última acción @@ -85,7 +72,6 @@ El complemento está deshabilitado Violación de restricciones Aceptar nueva basal temporal: - Tratamiento ¡Cambiar datos! Origen de Glucosa ¿Desde dónde debería obtener AAPS los datos? @@ -97,7 +83,6 @@ Nueva propuesta disponible Sugerencia de carbohidratos Versión de Nightscout no soportada - Basal IOB Tiempo de absorción Perfil Basal temporal @@ -144,7 +129,6 @@ Validar: Añadir Editar - BOLO COMIDA Corrección Acciones (PELIGROSO DESHABILITAR) Sólo subida a Nightscout @@ -173,8 +157,6 @@ Datos Autosens Depurar script Usar la función Autosens - Actualizar desde Nightscout - Borrar tratamientos en el futuro ACC CONF LAZO @@ -248,9 +230,6 @@ 10 horas Reanudar Vuelva a conectar la bomba - Tendencia 15min - COB - Superbolo Registrar el inicio de la aplicación en Nightscout Saliendo de la aplicación para aplicar los ajustes. ¿Qué tipo de insulina estás utilizando? @@ -475,7 +454,6 @@ Bomba virtual Definición de la bomba Bolo: Paso =%1$s\nBolo Extendido: [paso =%2$s, Duración =%3$smin -%4$sh] \nBasal: Paso =%5$s\nTBR: %6$s ( %7$s), Duración =%8$sMin -%9$sh\n%10$s - Configuración del Asistente Cálculos incluidos en el resultado del asistente: Ajustes de pantalla Configuración general @@ -511,9 +489,6 @@ Cuando se detecta resistencia a la insulina, disminuye el objetivo de glucosa Sensibilidad aumenta el objetivo Cuando se detecta sensibilidad a la insulina, aumenta el objetivo de glucosa - Eliminar registros de inicio de AAPS - Mostrar invalidados - Ocultar invalidados Eliminar elementos Ordenar elementos Encontrados ajustes de configuración @@ -536,8 +511,6 @@ Restablecer valores predeterminados NSClient fallando. Considera reiniciar NS y NSClient. Modo preferido de APS - Total - Cálculo Enviar los archivos de registro de hoy a los desarrolladores. Situación inesperada. Valor mínimo de cambio [%] Valor predeterminado 20%. El lazo abierto realizará una petición de cambio, sólo cuando se supere este valor @@ -571,17 +544,12 @@ Administrar esta parte del resultado del asistente de bolos [%] El asistente de bolos realiza el cálculo, pero solo se entrega esta parte de la insulina calculada. Útil con el algoritmo SMB. Aumentar el valor basal máximo porque el ajuste es inferior a tu base máxima en el perfil - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Seleccionado: Unidades Limpieza finalizada Limpieza iniciada ¿Desea reiniciar el objetivo? Puedes perder tu progreso. Seleccione las unidades en las que desea visualizar los valores - ¿Deseas crear nuevo perfil a partir de éste? Valor de glucosa baja (sólo visualización) Valor de glucosa alta (sólo visualización) Entrada % inválida @@ -631,12 +599,13 @@ Ejecutar alarma cuando es hora de comer ¡Hora de comer!\nEjecutar el asistente de bolo y calcular de nuevo. Habilitar recordatorio de bolo + Usa recordatorio de bolo más tarde con el asistente + (\"post-bolus\") ¡Carga de registros de errores desactivada! Gráfico Menú gráfico Borrar filtro Cánula - Entrada de usuario Usa los valores de la comida más grande que sueles comer\n Esta identificación se adjuntará a los informes de errores, para que podamos contactarte en casos urgentes. Es opcional. Dirección de Correo Electrónico @@ -644,7 +613,6 @@ Puedes proporcionar una dirección de correo electrónico opcional si quieres ser notificado sobre fallos de la aplicación. Este no es un servicio automatizado. Los desarrolladores se comunicarán contigo en situaciones peligrosas. Sincronización completa ¿Sincronización completa? Puede tardar muchas horas y hasta que termine no verás nuevos datos en Nightscout - CEBAR Sincronización Perfiles, bolos, carbohidratos y basales temporales se suben a Nightscout Subir datos a Nightscout @@ -718,22 +686,9 @@ Comando de acción desconocido: Porcentaje Aplicación por defecto - Mostrar registros eliminados o invalidados - Ocultar registros eliminados o invalidados - Actualizar de Nightscout Eliminar los elementos seleccionados - Selecciona para eliminar - Cambios de perfil - Objetivos temporales - Carbohidratos y bolos - ¿Estás seguro de que quieres eliminar %1$d elementos? - No hay registros disponibles - Ocultar lazo - Mostrar lazo %1$d selecionado Ordenar - Mostrar registros del lazo - Ocultar registros del lazo Estado del lazo Escala gráfica Perfil 1 diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml index 305d703f80..5924151562 100644 --- a/app/src/main/res/values-fr-rFR/strings.xml +++ b/app/src/main/res/values-fr-rFR/strings.xml @@ -34,19 +34,6 @@ Recevoir les glycémies depuis xDrip+. Enregistre tous les traitements qui ont été effectués Surveillez et contrôlez AAPS en utilisant votre montre WearOS. - Insuline: - Glucides : - IA: - IA Totale: - Activité IA Totale: - Dur: - Ratio: - Ins: - IA: - IA Totale : - TT - Corr. - IA Bolus Exécuter maintenant POMPE VIRTUELLE Dernière exécution @@ -85,7 +72,6 @@ Plugin désactivé Violation des restrictions Accepter nouveau basal temporaire : - Traitement Changez vos entrées ! Source des glycémies Quelle source de données doit être utilisée par AAPS ? @@ -97,7 +83,6 @@ Nouvelle recommendation disponible Suggestion de glucides Version incompatible de Nightscout - IA Basal Décalage horaire Profil Basal Temporaire @@ -145,7 +130,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Valide: Ajouter Éditer - Repas Corr. Actions (DÉSACTIVATION DANGEREUSE) Envoi NS uniquement @@ -174,8 +158,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Données Autosens Débogage du Script Utiliser la fonction Autosens - Actualiser depuis NS - Supprimer les futurs traitements ACT CONF BOUCLE @@ -249,9 +231,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S 10 heures Reprendre Rebrancher la pompe - Delta 15 min - GA - Superbolus Démarrage AAPS entré dans NS Sortir de l’application pour appliquer les nouveaux paramètres. Quel type d\'insuline utilisez-vous ? @@ -476,7 +455,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Type de pompe virtuelle Définition de pompe Bolus : Étape =%1$s\nExtended Bolus : [Étape =%2$s, Durée =%3$smin -%4$sh]\nBasal : Étape =%5$s\nTBR : %6$s (par %7$s), Durée =%8$smin -%9$sh\n%10$s - Paramètres assistant Calculs inclus dans le résultat de l’Assistant : Parametres d\'affichage Paramètres généraux @@ -512,9 +490,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Quand une résistance est détectée, baisse de la glycémie cible Sensibilité augmente la cible Quand une sensibilité est détectée, augmentation de la glycémie cible - Suppr. entrées \"Démarrage AAPS\" - Montrer les entrées invalides - Masquer les entrées invalides Supprimer des entrées Trier les objets Paramètres sauvegardés trouvés @@ -537,8 +512,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Réinitialiser les valeurs par défaut Dysfonctionnement NSClient. Redémarrez NS et NSClient. Mode APS préféré - Total - Calc Envoi des fichiers logs d\'aujourd\'hui aux développeurs avec l\'heure. Cas imprévu. Changement minimum [%] Le fonctionnement de la Boucle demandera une confirmation uniquement si le changement est supérieur à cette valeur en %. Par défaut, la valeur est 20% @@ -572,17 +545,12 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Injecter ce pourcentage du bolus calculé par l’assistant [%] L\'assistant bolus effectue le calcul mais seulement ce pourcentage de l\'insuline calculée est délivré. Utile avec l\'algorithme SMB. Augmentation de la valeur du débit Basal max parce que ce paramètre est inférieur au débit Basal max de votre profil - %1$s SI: %2$.1f - %1$.0fg G/I: %2$.1f - %1$.1fg G/I: %2$.1f - %1$d%% Sélectionné : Unités Refaire l\'objectif Suppression démarrée Voulez-vous réinitialiser le début de l\'objectif ? Vous risquez de perdre vos progrès. Sélectionnez les unités dans lesquelles vous souhaitez afficher les valeurs - Créer un nouveau profil à partir de ce profil ? Valeur inférieure dans la plage (affichage uniquement) Valeur supérieure dans la plage (affichage uniquement) % saisi invalide @@ -638,7 +606,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Menu graphique Effacer le filtre Canule - Entrées utilisateur Utilisez les valeurs qui correspondent à vos plus gros repas\n Cette identification sera jointe aux rapports de plantage afin que nous puissions vous contacter en cas d\'urgence. Elle est facultative. Adresse e-mail @@ -646,7 +613,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Vous pouvez fournir une adresse e-mail facultative si vous voulez être informé des plantages de l\'application. Ce n\'est pas un service automatisé. Vous serez contacté par les développeurs dans des situations dangereuses. Synchronisation complète Synchronisation complète ? Cela peut prendre plusieurs heures et jusqu\'à la fin, vous ne verrez pas de nouvelles données sur NS. - Amorcer Synchronisation Profils, boluses, glucides, basals temporaires sont téléchargés vers NS Télécharger des données vers NS @@ -720,22 +686,9 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S Commande inconnue : Pourcentage Application par défaut - Afficher les enregistrements invalidés / supprimés - Masquer les enregistrements invalidés / supprimés - Rafraîchir à partir de Nightscout Supprimer les entrées sélectionnées - Sélectionner pour suppression - Changements de profil - Cibles Temp - Glucides et bolus - Êtes-vous sûr de vouloir supprimer %1$d entrée(s) - Aucun enregistrement disponible - Masquer la boucle - Afficher les entrées boucle %1$d sélectionnée(s) Trier - Afficher les entrées de la boucle - Masquer les entrées de la boucle État de la boucle Échelle du graph. Profil 1 diff --git a/app/src/main/res/values-it-rIT/strings.xml b/app/src/main/res/values-it-rIT/strings.xml index ecc7ea8c1a..fe5cf491c1 100644 --- a/app/src/main/res/values-it-rIT/strings.xml +++ b/app/src/main/res/values-it-rIT/strings.xml @@ -34,19 +34,6 @@ Ricevi valori glicemia da xDrip+. Salva tutti i trattamenti che sono stati fatti Monitora e controlla AAPS usando il tuo smartwatch WearOS. - Insulina: - CHO: - IOB: - IOB totale: - Attività IOB totale: - Dur: - Rapporto: - Ins: - IOB: - IOB totale: - TT - Corr - IOB da bolo Esegui ora MICRO VIRTUALE Ultima esecuzione @@ -85,7 +72,6 @@ Il plugin è disabilitato Violazione dei vincoli Accetta nuova basale temporanea: - Trattamento Cambia il tuo input! Origine BG Da dove AAPS dovrebbe ottenere i suoi dati? @@ -97,7 +83,6 @@ Nuovo suggerimento disponibile Suggerimento CHO Versione non supportata di Nightscout - IOB da basale Offset CHO Profilo Basale temporanea @@ -144,7 +129,6 @@ Valido: Aggiungi Modifica - Pasto Corr Azioni Solo upload su NS (PERICOLOSO DISABILITARE) @@ -173,8 +157,6 @@ Dati autosens Script debug Usa la funzione Autosens - Aggiornamento da NS - Elimina trattamenti nel futuro AZN CONF LOOP @@ -248,9 +230,6 @@ 10 ore Riprendi Riconnetti micro - Trend di 15min - COB - Superbolo Registra l\'avvio dell\'app in NS Uscita dall\'applicazione per applicare le impostazioni. Quale tipo di insulina stai usando? @@ -475,7 +454,6 @@ Tipo micro virtuale Definizione micro Bolo: Step=%1$s\nBolo Esteso: [Step=%2$s, Durata=%3$smin-%4$sh]\nBasale: Step=%5$s\nTBR: %6$s (di %7$s), Durata=%8$smin-%9$sh\n%10$s - Impostazioni Calcolatore Calcoli inclusi nel risultato del Calcolatore: Impostazioni di visualizzazione Impostazioni generali @@ -511,9 +489,6 @@ Quando viene rilevata resistenza, ridurre la glicemia target La sensibilità aumenta il target Quando viene rilevata sensibilità, aumentare la glicemia target - Rimuovi le voci \"AAPS avviato\" - Mostra invalidato - Nascondi invalidato Rimuovi elementi Ordina elementi Trovate impostazioni memorizzate @@ -536,8 +511,6 @@ Ripristina valori predefiniti Malfunzionamento NSClient. Considera il riavvio di NS e NSClient. Modalità APS preferita - Totale - Calc Invia agli sviluppatori i file log di oggi e di questo momento. Situazione inaspettata. Richiesta minima di modifica [%] Il loop aperto mostrerà una nuova richiesta di modifica solo se la modifica è maggiore di questo valore in %. Il valore predefinito è 20% @@ -571,17 +544,12 @@ Eroga parte del risultato del calcolatore [%] Il calcolatore esegue il calcolo, ma solo questa parte dell\'insulina calcolata è erogata. Utile con algoritmo SMB. Aumento del valore max basale perché l\'impostazione è inferiore alla tua basale massima nel profilo - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Selezionato: Unità Cancella completamento Cancella avvio Vuoi resettare l\'avvio dell\'obiettivo? Potresti perdere i tuoi progressi. Seleziona le unità in cui vuoi visualizzare i valori - Creare un nuovo profilo da questo profilo? Valore più basso per l\'intervallo di visualizzazione dell\'area \"in range\" Valore più alto per l\'intervallo di visualizzazione dell\'area \"in range\" Inserimento % non valido @@ -636,7 +604,6 @@ Menu grafico Cancella filtro Cannula - Inserimento utente Usa i valori del cibo più abbondante che mangi di solito\n Questa identificazione verrà allegata ai rapporti sugli arresti anomali in modo che possiamo contattarti in casi urgenti. È facoltativo. Indirizzo email @@ -644,7 +611,6 @@ Puoi fornire un indirizzo e-mail opzionale se desideri essere avvisato in caso di arresti anomali dell\'app. Questo non è un servizio automatizzato. Sarai contattato dagli sviluppatori in situazioni pericolose. Sincronizzazione completa Sincronizzazione completa? Potrebbe richiedere molte ore e fino alla fine del processo non vedrai nuovi dati in NS. - Caricamento Sincronizzazione Profili, boli, CHO, basali temporanee vengono caricati su NS Carica dati su NS @@ -718,22 +684,9 @@ Comando sconosciuto: Percentuale Predefinito applicazione - Mostra record non validi/rimossi - Nascondi record non validi/rimossi - Aggiorna da Nightscout Rimuovi elementi selezionati - Seleziona per la rimozione - Modifiche al profilo - Target Temporanei - CHO e boli - Sicuro di voler rimuovere %1$d elementi - Nessun record disponibile - Nascondi loop - Mostra loop %1$d selezionati Ordina - Mostra record di loop - Nascondi record di loop Stato loop Scala del grafico Profilo 1 diff --git a/app/src/main/res/values-iw-rIL/strings.xml b/app/src/main/res/values-iw-rIL/strings.xml index d0d5d1c13f..25684b2747 100644 --- a/app/src/main/res/values-iw-rIL/strings.xml +++ b/app/src/main/res/values-iw-rIL/strings.xml @@ -33,19 +33,6 @@ הורדת ערכי סוכר בדם מ-Nightscout קבלת ערכי סוכר מ-xDrip. שמירת כלל הטיפולים שנעשו - אינסולין: - פחמימות: - אינסולין פעיל: - אינסולין פעיל כולל: - פעילות אינסולין פעיל כוללת: - משך: - יחס: - אינסולין: - IOB: - IBO כולל: - TT - תיקון - בולוס פעיל בצע משאבה וירטואלית ההפעלה האחרונה @@ -81,7 +68,6 @@ התוסף אינו זמין הפרת מגבלות אשר בזאלי זמני חדש: - טיפול שנה קלט! מקור ערכי הסוכר xDrip+ @@ -92,7 +78,6 @@ הצעה חדשה זמינה המלצת פחמימות גרסה לא נתמכת של Nightscout - בזאלי פעיל זמן פחמימות פרופיל בזאלי זמני @@ -139,7 +124,6 @@ תקף: הוספה עריכה - ארוחה תיקון פעולות (מסוכן להשבית) העלאה בלבד לנייטסקאוט @@ -168,8 +152,6 @@ נתוני חישוב רגישות אוטו\' תיקון באגים בסקריפט אפשר חישוב רגישות אוטומטי (Autosens) - רענון אירועים מנייטסקאוט - מחיקת טיפולים עתידיים ACT CONF לולאה @@ -243,9 +225,6 @@ 10 שעות חידוש חיבור משאבה מחדש - מגמת 15 דקות - פחמ\' פעילות - סופר בולוס רשום הפעלת AAPS ב-Nightscout יוצא מ-AAPS כדי להחיל הגדרות. באיזה סוג של אינסולין אתה משתמש? @@ -469,7 +448,6 @@ סוג משאבה וירטואלית הגדרת משאבה בולוס: צעד=%1$s\nבולוס ממושך: [צעד=%2$s, משך=%3$s מינ\'-%4$sש\']\nבזאלי: צעד=%5$s\nבזאלי זמני: %6$s (עם %7$s), משך=%8$s מינ\'-%9$sש\'\n%10$s - הגדרות אשף חישובים הכלולים בתוצאת האשף: הגדרות תצוגה הגדרות כלליות @@ -504,8 +482,6 @@ כשמזוהה תנגודת, הורד את ערך המטרה של הגלוקוז רגישות מעלה את ערך המטרה כשמזוהה רגישות, הגדל את ערך המטרה של הגלוקוז - הצג פסולים - הסתר פסולים הסר פריטים מיין פריטים נמצאו הגדרות שמורות @@ -527,8 +503,6 @@ אפס לברירת המחדל תקלה ב-NSClient. שקלו להפעיל את Nightscout ו-NSClient מחדש. מצב APS מועדף - סה\"כ - חישוב שלח קובצי יומן של היום למפתחים יחד עם זמן זה. מצב לא צפוי. מינימום לבקשה לשינוי [%] \'לולאה פתוחה\' תציג בקשת שינוי חדשה רק אם השינוי גדול מערך זה ב-%. ערך ברירת המחדל הוא 20% @@ -561,17 +535,12 @@ ספק את חלק זה מתוצאת אשף הבולוס [%] אשף הבולוס מבצע חישוב אך רק חלק זה של האינסולין המחושב מוזרק. שימושי בשימוש עם אלגוריתם SMB. מגדיל את ערך מקסימום הבזאלי מפני שהוא נמוך מערכו המרבי בפרופיל - %1$s פקטור הרגישות: %2$.1f - %1$.0f גר\' יחס פחמ\': %2$.1f - %1$.1f גר\' יחס פחמ\':%2$.1f - %1$d%% נבחר: יחידות ביטול השלמה ביטול התחלה האם ברצונכם לאפס את התחלת המשימה? אתם עלולים לאבד את התקדמותכם במשימה. בחרו את היחידות שבהן ברצונכם להציג ערכים - ליצור פרופיל מקומי חדש מפרופיל זה? ערך נמוך יותר באזור הטווח (הצגה בלבד) ערך גבוה יותר באזור הטווח (הצגה בלבד) רשומת אחוזים לא חוקית @@ -626,7 +595,6 @@ תפריט הגרף נקה סינון צינורית - קלט המשתמש השתמשו בערכים הגבוהים ביותר של מזונות שאתם אוכלים בדרך כלל\n אמצעי הזיהוי יצורף לדיווחי קריסה על מנת שנוכל ליצור קשר במקרים דחופים. אין זו חובה. כתובת דוא\"ל @@ -634,7 +602,6 @@ אם תרצו, תוכלו לספק כתובת דוא\"ל כדי לקבל דיווח על קריסות יישום. שירות זה אינו אוטומטי. המפתחים יצרו איתכם קשר במצבים מסוכנים. סינכרון מלא סנכרון מלא? זה ייקח שעות מרובות ולא תוכלו לראות נתונים חדשים בנייטסקאוט. - תיחול סינכרון פרופילים, בולוסים, פחמימות ומינונים בזאליים זמניים נטענים לנייטסקאוט טוען נתוני סוכר לנייטסקאוט @@ -706,22 +673,9 @@ פקודה לא ידועה: אחוזים ברירת המחדל של היישום - הצג רשומות מבוטלות\\מחוקות - הסתר רשומות מבוטלות\\מחוקות - רענן מנייטסקאוט הסר פריטים נבחרים - בחרו להסרה - שינויים בפרופיל - ערכי מטרה זמניים - פחמ\' ובולוס - האם אתם בטוחים שברצונכם להסיר %1$d פריטים? - אין רישומים זמינים - החבא לולאה - הצג לולאה %1$d נבחרו מיין - הצג רשומות לולאה - החבא רשומות לולאה סטטוס הלולאה קנה מידה של הגרף פרופיל 1 diff --git a/app/src/main/res/values-ko-rKR/strings.xml b/app/src/main/res/values-ko-rKR/strings.xml index ee2a04dc69..6e417deafc 100644 --- a/app/src/main/res/values-ko-rKR/strings.xml +++ b/app/src/main/res/values-ko-rKR/strings.xml @@ -31,18 +31,6 @@ Nightscout에서 다운로드하여 혈당값 받기 xDrip+에서 혈당값 받기 모든 관리를 저장합니다. - 인슐린: - 탄수화물: - IOB: - IOB 총량: - 활동 IOB 총량: - 기간: - 비율: - 인슐린: - IOB: - IOB 총량: - 임시목표 - 교정 지금 실행 가상 펌프 최근 실행 @@ -78,7 +66,6 @@ 플러그인이 사용불가능 합니다 제한 위반 새 임시Basal 적용: - 관리 입력값을 변경하세요! 혈당 출처 xDrip+ @@ -89,7 +76,6 @@ 새로운 제안이 있습니다 탄수화물 제안 지원하지 않는 Nightscout 버전입니다 - Basal IOB 임시Basal 확장 Bolus Nightscout 버전: @@ -134,7 +120,6 @@ 유효기간: 추가 수정 - Meal 교정주입 실행 (비활성화 시 위험함) NS에 업로드만 하기 @@ -162,8 +147,6 @@ Autosens 정보 스크립트 디버그 Autosens 기능 사용 - NS로부터 최신 정보로 업데이트 함. - 미래시점의 관리 삭제 ACT CONF LOOP @@ -236,8 +219,6 @@ 10시간 재실행 펌프 재연결 - COB - Superbolus 앱시작을 NS에 기록하기 설정을 적용하기위해 앱을 종료합니다. 어떤 종류의 인슐린을 사용합니까? @@ -449,7 +430,6 @@ 가성펌프 종류 펌프 정의 Bolus: 스텝=%1$s\n확장Bolus: [Step=%2$s, 기간=%3$s분-%4$s시]\nBasal: 스텝=%5$s\n임시Basal: %6$s (by %7$s), 기간=%8$s분-%9$s시\n%10$s - 마법사 설정 마법사 결과에 사용 된 계산: 화면 설정 일반 설정 @@ -496,8 +476,6 @@ 기본값으로 초기화 NSClient가 정상적으로 작동하지 않습니다. Nightscout와 NSClient를 재시작 해보세요. 선호하는 APS 모드 - 합계 - Calc 예상치 못한 상황 보고를 위해 오늘의 로그 파일을 개발자에게 전송합니다. 최소 요청 변화 [%] Open Loop가 %단위로 이 값보다 변화가 더 클 경우에만 새 변경 요청을 팝업합니다. 기본값은 20 %입니다 @@ -527,10 +505,6 @@ Bolus 마법사 결과의 이 부분 주입[%] Bolus 마법사는 계산을 수행하지만 계산된 인슐린의 이 부분만 주입됩니다. SMB 알고리즘에 유용합니다. 설정이 프로파일에서의 최대 Basal보다 낮은 이유로 최대 Basal을 올립니다 - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% 선택: 단위 완료 초기화 @@ -588,12 +562,10 @@ 차트 메뉴 필터 지우기 캐뉼라 - 사용자 항목 평소 섭취하는 가장 많은 양의 탄수화물 값을 사용하세요.\n 이메일 주소 개인정보 설정 어플의 충돌에 대해 통지를 받기 원하는 경우 선택적으로 이메일 주소를 제공할 수 있습니다. 이는 자동 지원 서비스는 아닙니다. 위험 상황에서 개발자들에게 연락이 올 것입니다. - 교체 동기화 프로파일, bolus, 탄수화물, 임시 basal이 NS에 업로드 됨 NS에 데이터 업로드하기 diff --git a/app/src/main/res/values-lt-rLT/strings.xml b/app/src/main/res/values-lt-rLT/strings.xml index 8ba911acd7..248371d406 100644 --- a/app/src/main/res/values-lt-rLT/strings.xml +++ b/app/src/main/res/values-lt-rLT/strings.xml @@ -31,19 +31,6 @@ Gauti kraujo gliukozės vertes iš Nightscout Gauti kraujo gliukozės reikšmes iš xDrip+. Išsaugoti visus terapijos pakeitimus - Insulinas: - AV: - AIO: - Visas AIO: - Bendro AIO aktyvumas: - Trukmė: - Santykis: - Ins: - AIO: - Visas AIO: - LT - Korekcija - Bolusų AIO Paleisti dabar Virtuali pompa Paskutinis veiksmas @@ -79,7 +66,6 @@ Įskiepis išjungtas Apribojimų pažeidimas Patvirtinti naują laikiną bazę: - Terapija Pakeiskite įvestus duomenis! Glikemijos šaltinis xDrip+ @@ -90,7 +76,6 @@ Gautas naujas pasiūlymas Angliavandenių pasiūlymas Nepalaikoma Nightscout versija - Bazės AIO AV laikas Profilis Laikina bazė @@ -137,7 +122,6 @@ Galioja: Pridėti Redaguoti - Maistas Korekcija Veiksmai (PAVOJINGA IŠJUNGTI) Tik įkeliama į NS @@ -165,8 +149,6 @@ Autosens duomenys Scenarijų derinimas Naudoti Autosens funkciją - Atnaujinti iš NS - Ištrinti ateities įrašus VEIKS KONF CIKLAS @@ -239,9 +221,6 @@ 10 val. Atnaujinti Prijungti pompą - 15 min tendencija - AAO - Superbolus Siųsti programos paleidimo žymę į NS Uždarant aplikaciją, taikyti nustatymus. Kokio tipo insuliną naudojate? @@ -456,7 +435,6 @@ Virtualios pompos tipas Pompos nustatymas Bolusas: Žingsnis=%1$s\nIštęstinis bolusas: [Žingsnis=%2$s, Trukmė=%3$smin-%4$sh]\nBazė: Žingsnis=%5$s\nLDB: %6$s (iš %7$s), Trukmė=%8$smin -%9$sh\n%10$s - Išmaniojo laikrodžio nustatymai Skaičiavimai, įtraukti į Patarėjo rezultatą: Ekrano nustatymai Bendrieji nustatymai @@ -506,8 +484,6 @@ Atkurti numatytuosius NSClient sutrikimas. Reikėtų paleisti iš naujo NS ir NSClient. Pageidaujamas DKS režimas - Viso - Skaič. Siųsti šios dienos žurnalo įrašus kūrėjams dabar. Netikėta situacija. Minimalaus pokyčio užklausa [%] Atviras Ciklas parodys naujų pakeitimų užklausą tik tada, kai pokytis bus didesnis nei ši vertė %. Numatytoji vertė yra 20% @@ -540,17 +516,12 @@ Suleisti šią boluso skaičiuoklės rezultato dalį [%] Boluso skaičiuoklė atlieka skaičiavimus, tačiau tik dalis apskaičiuoto insulino yra suleidžiama. Naudinga kartu su SMB algoritmu. Didinama maksimali valandinės bazės reikšmė, nes nustatytoji reikšmė yra mažesnė nei profilio maksimali val. bazės reikšmė - %1$s JIF: %2$.1f - %1$.0fg IA: %2$.1f - %1$.1fg IA: %2$.1f - %1$d%% Parinkta: Vienetai Išvalyti užbaigtus Išvalyti pradėtus Ar norite iš naujo nustatyti tikslų pradžią? Jūs galite prarasti jau pasiektus. Pasirinkite vienetus, kurių vertes norite parodyti - Kurti naują profilį iš šito profilio? Mažiausia tikslinės srities vertė (tik rodymui) Didžiausia tikslinės srities vertė (tik rodymui) Netinkamas % įrašas @@ -604,7 +575,6 @@ Grafiko meniu Valyti filtrą Kaniulė - Naudotojo įrašas Naudokite gausiausio patiekalo, kurį paprastai valgote, reikšmes\n Šis identifikatorius bus pridėtas prie gedimų ataskaitų, kad skubiais atvejais galėtume su jumis susisiekti. Jis neprivalomas. El. pašto adresas @@ -612,7 +582,6 @@ Nurodykite el. pašto adresą (neprivaloma), jei norite gauti informaciją apie programos strigimus. Tai nėra automatizuota paslauga. Kūrėjai susisieks esant pavojingoms situacijoms. Pilna sinchronizacija Vykdyti pilną sinchronizaciją? Tai gali užtrukti nemažai valandų ir kol ji nebus užbaigta, nematysite atnaujintų NS duomenų. - Užpildyti sistemą Sinchronizacija Profiliai, bolusai, angliavandeniai, laikinos bazės įkeltos į NS Įkelti duomenis į NS diff --git a/app/src/main/res/values-nl-rNL/exam.xml b/app/src/main/res/values-nl-rNL/exam.xml index 823f9a9ca4..b9bf4664ab 100644 --- a/app/src/main/res/values-nl-rNL/exam.xml +++ b/app/src/main/res/values-nl-rNL/exam.xml @@ -5,10 +5,12 @@ Je moet de waarde voor DIA in je profiel instellen. De minimumwaarde is 5 uur. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Configuration/Config-Builder.html#insuline + Als je er zeker van bent dat de waarde voor DIA die je in je pomp hebt gebruikt voor je AndroidAPS gebruikte, goed werkte, dan is het niet nodig om deze te wijzigen als je begint met loopen. Je moet voor jezelf de juiste waarde voor DIA bepalen. Hypo Tijdelijk streefdoel Wat is de belangrijkste reden om een tijdelijk hypo streefdoel in te stellen? Om te corrigeren voor hypo\'s veroorzaakt door onjuiste basaalstanden. + Om te voorkomen dat AndroidAPS overcorrigeert voor een bloedglucosestijging veroorzaakt door de snel werkende koolhydraten die gebruikt worden voor een hypo. Om te corrigeren voor een hypo veroorzaakt door inspanning. Om te voorkomen dat de bloedglucose te laag wordt als er al een tijdelijke basaalstand van 0% actief is. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Usage/temptarget.html @@ -16,10 +18,15 @@ Thema: offline profiel NS-Profiel kan worden gebruikt, maar niet worden aangepast. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Configuration/Config-Builder.html#profiel + Redenen voor het toepassen van \"Verbreek verbinding met pomp\" in AndroidAPS Wat moet er gebeuren wanneer pomp wordt losgekoppeld? Dit is onnodig omdat er geen isuline toegediend zal worden als de pomp fysiek losgekoppeld is. + Het zorgt ervoor dat AndroidAPS geen insuline meerekent die niet werd toegediend terwijl de pomp niet was aangesloten  Het zal de insulineafgifte niet stoppen als de pomp verbonden blijft. + Dit zet AndroidAPS in open-loopmodus. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Getting-Started/FAQ.html#overige-instellingen + AAPS-instellingen + AAPS-instellingen Welke dingen kun je het beste doen om een back-up van je instellingen te maken? Je hoeft je instellingen niet te exporteren, zolang je ze ergens noteert. Exporteer je instellingen nadat je een doel hebt bereikt. @@ -33,6 +40,7 @@ https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Getting-Started/FAQ.html#welke-spullen-moet-ik bij-me-hebben-voor-noodgevallen Ruis in CGM-metingen Wat moet er gebeuren als CGM-gegevens ruis vertonen? + Niets, AAPS lost het op. Schakel de closed loop uit om te voorkomen dat de closed loop over- of onderdoseert. Vervang sensoren die consequent ruis geven of inaccuraat zijn. Zorg dat je CGM-app de BG-gegevens vloeiend maakt. @@ -63,6 +71,7 @@ Eenmaal ingesteld en gevalideerd, hoeven deze waarden niet veranderd te worden in de loop der tijd. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Getting-Started/FAQ.html#androidaps-instellingen Vereisten + Wat is minimaal nodig om AAPS in te stellen en te gebruiken? Goed geteste profielgegevens (Basaal, KH-ratio, ISF, DIA). Een computer waarop Android Studio is geïnstalleerd en geconfigureerd. Een geschikte telefoon. @@ -77,17 +86,25 @@ Een Smartwatch. Een geschikte CGM. Vereisten + Wat is minimaal nodig om AAPS in te stellen en te gebruiken? Gevalideerde informatie om een profiel op te zetten (ISF, I:C ratio, basaalstanden, DIA etc.). Een ondersteund Android apparaat (bijvoorbeeld een mobiele telefoon, volledig Android-horloge of een tablet). + AndroidAPS heeft een internetverbinding nodig om in closed-loopmodus te kunnen werken. Een ondersteunde CGM en geschikte app om bloedglucosewaarden te ontvangen op je telefoon/apparaat. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Module/module.html + AAPS bijwerken Selecteer alle juiste antwoorden. Je moet Git geïnstalleerd en geconfigureerd hebben op je computer. + Wanneer nieuwe versies van AndroidAPS zijn uitgebracht, kunnen eerdere versies na een bepaalde tijd van afstand beperkt worden. Je moet de locatie van de keystore onthouden en dezelfde signing key gebruiken voor updates als bij je vorige installatie. Doe nooit een update als het systeem goed werkt. Als je moeite hebt met het bouwen van de apk, kun je een apk installeren die is gebouwd door een vriend. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Installing-AndroidAPS/Update-to-new-version.html#bijwerken-naar-een-nieuwe-versie Probleemoplossing + Waar kan je hulp zoeken voor AndroidAPS? + Je kunt om advies vragen in de AndroidAPS Users Facebookgroep. + Je moet de AndroidAPS documentatie lezen (en opnieuw lezen). + Je kunt om advies vragen en technische problemen inbrengen op het AndroidAP- kanaal op Discord. Je moet hulp vragen aan je behandelteam. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Installing-AndroidAPS/Update-to-new-version.html#problemen-oplossen https://www.facebook.com/groups/AndroidAPSUsers/ @@ -101,6 +118,7 @@ https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Configuration/Config-Builder.html#insuline Gevoeligheidsplugins Selecteer alle juiste antwoorden. + Gevoeligheidsplugins stellen AndroidAPS in staat om aan te passen aan tijdelijke of kortstondige veranderingen in insulinegevoeligheid (bijvoorbeeld hormonale veranderingen of problemen met insuline-opname bij de infuusplaats). Gevoeligheidsplugins bieden de gebruiker suggesties voor wijzigingen aan basaaalstanden, I:C ratio\'s en ISF die kunnen worden gebruikt om het profiel mee aan te passen. Het vastleggen van een canulewissel zet de Autosens-ratio terug naar 100%. Sommige van de plugins hebben configureerbare tijdbereiken die kunnen worden ingesteld door de gebruiker. @@ -110,11 +128,27 @@ Wat moet u doen als u een onjuiste hoeveelheid koolhydraten hebt ingevoerd? Verwijder het onjuiste record in Behandelingen en voer de juiste koolhydraten opnieuw in. Bolus met insuline met behulp van het infusieset uitvulmenu. + Doe niets – AndroidAPS zal de juiste aanpassingen maken. Bolus met insuline met behulp van de insuline (bolus) knop in het Overzicht. Insulinetoediening/-invoerfouten Wat moet je doen wanneer je minder insuline toegediend hebt gekregen dan de geschiedenis van de pomp suggereert, bijvoorbeeld vanwege een verstopping, een lekkende canule of door het vergeten de pomp opnieuw aan te koppelen na een douche?  Verwijder de insulinegegevens uit het Nightscout Careportal om deze uit de pompgeschiedenis te verwijderen. + Vergelijk de waarden in AndroidAPS en pompgeschiedenis (als de pomp dit ondersteunt). Bolus een deel van je berekende \'gemiste\' insuline door een injectiespuit/pen of door de uitvulfunctie te gebruiken. + Doe niets en laat AndroidAPS de ontstane hoge bloedglucosespiegel corrigeren. + Koolhydraten aan boord (COB) + Welke invloed heeft het wijzigen van de ISF waarde op COB berekeningen? + Verhoging van ISF zal de absorptie van koolhydraten vertragen + Verhoging van ISF zal de absorptie van koolhydraten versnellen + Verhoging van ISF heeft geen invloed op berekende koolhydraten absorptie + Welke invloed heeft het wijzigen van de IC waarde op COB berekeningen? + Verhoging van IC zal de absorptie van koolhydraten vertragen + Verhoging van IC zal de absorptie van koolhydraten versnellen + Verhoging van IC heeft geen invloed op berekende koolhydraten absorptie + Welke invloed heeft het wijzigen van het profiel percentage op COB berekeningen? + Instellen van een profiel op 150% zal de absorptie van koolhydraten vertragen + Instellen van een profiel op 150% zal de absorptie van koolhydraten versnellen + Instellen van profiel op 150% heeft geen invloed op berekende koolhydraten absorptie Insuline aan boord (IOB) De IOB-waarde wordt beïnvloed door eerdere tijdelijke basaalstanden. Een hoge tijdelijke basaal zal niet worden ingesteld wanneer je bloedsuiker onder het streefdoel ligt. @@ -123,20 +157,28 @@ Koolhydraatinvoer en bolussen Alleen grammen moeten worden gebruikt voor het schatten en opgeven van koolhydraten. Koolhydraten kunnen worden geregistreerd met behulp van een geschikt uitwisselingssysteem (bv. DAFNE \"CHO\" of Europese \"Bread Units\"). + AndroidAPS gebruikt een dynamisch model om koolhydraat \"verval\" te schatten en COB te berekenen. Als de bloedglucosespiegels buiten aanvaardbare waarden liggen (te laag of te hoog), kan de boluscalculator worden gebruikt om suggesties te doen voor koolhydraat-of insuline-correcties. https://androidaps.readthedocs.io/en/latest/EN/Getting-Started/FAQ.html#insulin-to-carb-ratio-ic-g-u e-carbs Waarvoor kun je e-carbs (uigestelde koolhydraten) gebruiken? Om koolhydraten in de toekomst te plannen, mogelijk verdeeld over een interval (vergelijkbaar met een verlengde bolus die insuline over een interval verspreidt). + Voor het loggen van vrij ingenomen koolhydraten tbv. inspanning die je wilt verbergen voor AndroidAPS. + e-carbs (verdeeld in de toekomst) kunnen AndroidAPS helpen bij het omgaan met maaltijden met een hoog vet-/eiwitgehalte. Voor het vastleggen van reddingskoolhydraten die je gebruikt voor de behandeling van een lage bloedglucose.  https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Usage/Extended-Carbs.html Bewaking op afstand + Hoe kun je AndroidAPS (bijvoorbeeld voor je kind) op afstand monitoren? + AAPSClient app, Nightscout app en de Nightscout webpagina kunnen AAPS op afstand volgen. Met andere apps (bijv. Dexcom follow, xDrip in follow mode) kun je enkele gegevens (bijv. bloedglucose/sensorwaarden) op afstand volgen, maar deze gebruiken andere algoritmen en kunnen daardoor onjuiste IOB-of COB-waarden tonen. + Om AndroidAPS op afstand te kunnen volgen, is voor beide apparaten internettoegang noodzakelijk (bijvoorbeeld via Wi-Fi of mobiel netwerk). + AAPSClient gebruikt als een externe volger zal AAPS monitoren en geeft volledige controle. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Children/Children.html Insulinegevoeligheidsfactor (ISF) Het verhogen van de ISF-waarde zal leiden tot meer insulinetoediening om een dezelfde hoeveelheid koolhydraten te dekken. Het verlagen van de ISF-waarde leidt tot meer insulinetoediening om een verhoogde bloedglucose te corrigeren. Verhoging of verlaging van de ISF heeft geen effect op de insulinetoediening wanneer de bloedglucosespiegel lager is dan de streefwaarde. + ISF moet worden ingevoerd in je AndroidAPS-voorkeuren. Het wijzigen van de ISF-waarde in uw profiel is voldoende om de wijziging toe te passen. https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Getting-Started/FAQ.html#insuline-gevoeligheids-factor-insulin-sensitivity-factor-ISF-mmol-l-E-of-mg-dl-E https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Usage/Profiles.html @@ -163,6 +205,7 @@ Het BG streefdoel blijft ongewijzigd. De ISF-waarde wordt 20% hoger. Profielwissels + Als je 2 uur eerder opstaat dan normaal, hoe moet je AndroidAPS dan laten weten dat jouw dagschema is veranderd? Voer een profiel wissel uit met een tijdverschuiving van 2 Voer een profiel wissel uit met een tijdverschuiving van -2 Stel een Eet binnenkort Tijdelijk streefdoel in. @@ -170,6 +213,7 @@ https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Usage/Profiles.html?highlight=profilewitch#tijd-verschuiving Aanpassen van profielen Basaalstanden, ISF, KH-ratio\'s, etc, moeten in profielen worden ingesteld. + Om veranderingen in je Nightscout Profiel te activeren, heeft je AAPS telefoon een actieve internetverbinding nodig. Een profiel bewerken is voldoende om eventuele wijzigingen door te voeren. Er kunnen meerdere profielen worden ingesteld en geselecteerd om tegemoet te komen aan veranderende omstandigheden (bijvoorbeeld hormonale veranderingen, shift werk-, weekdagen/weekendlevensstijl). https://androidaps.readthedocs.io/en/latest/CROWDIN/nl/Module/module.html#goed-individueel-doserings-algoritme-voor-jouw-diabetesbehandeling @@ -179,4 +223,6 @@ Google Facebook Andere medicijnen. Lees de verklaring hieronder en vink het vakje aan om de verklaring te accepteren. + AndroidAPS vermindert de basaalstanden of stopt de insulinetoediening om de bloedsuiker te verhogen. Medicijnen in de klasse SGLT2-remmers (gliflozines) kunnen een stijging van bloedglucose voorkomen en kunnen daardoor een gevaarlijk insulinetekort veroorzaken dat leidt tot diabetische ketoacidose. +\nBekende merknamen zijn: Invokana®, Forxiga®, Jardiance®, Steglatro®, Suglat®, Apleway®, Deberza®, Synjardy®, Vokanamet®, Xigduo®.\n\nIk verklaar dat ik dergelijke medicijnen niet zal gebruiken wanneer ik AndroidAPS gebruik, of dat ik de loop zal deactiveren voordat ik met deze medicijnen start. diff --git a/app/src/main/res/values-nl-rNL/objectives.xml b/app/src/main/res/values-nl-rNL/objectives.xml index f183c683c5..a54f6c68c6 100644 --- a/app/src/main/res/values-nl-rNL/objectives.xml +++ b/app/src/main/res/values-nl-rNL/objectives.xml @@ -25,6 +25,8 @@ Pomp status beschikbaar in NS Handmatige aanpassingen Voltooid: %1$s + Leer hoe AndroidAPS te gebruiken + Voer verschillende acties uit in AndroidAPS Stel profiel in op 90% voor 10 min (houd profielnaam lang ingedrukt op Overzicht scherm) Simuleer douchen. Ontkoppel de pomp voor 1u (houd Open Loop lang ingedrukt) ... en op dezelfde manier weer aankoppelen diff --git a/app/src/main/res/values-nl-rNL/strings.xml b/app/src/main/res/values-nl-rNL/strings.xml index b32e249ec4..fd44ce195e 100644 --- a/app/src/main/res/values-nl-rNL/strings.xml +++ b/app/src/main/res/values-nl-rNL/strings.xml @@ -33,19 +33,7 @@ Download BG waardes van Nightscout Ontvang BG waardes van xDrip+. Sla alle behandelingen op - Insuline: - Koolhydraten: - IOB: - Totale IOB: - Totale IOB activiteit: - Tijdsduur: - Ratio: - Ins: - IOB: - Totale IOB: - TT - Correctie - Bolus IOB + Monitor en bedien AAPS met uw WearOS horloge. Nu uitvoeren VIRTUELE POMP Laatste berekening @@ -65,7 +53,9 @@ Behandelingen Virtuele Pomp Pomp + Welke pomp wilt u gebruiken met AAPS? Profiel + Welk profiel moet AAPS gebruiken? APS Welk APS algoritme moet therapie aanpassingen maken? Algemeen @@ -73,6 +63,7 @@ Welke beperkingen worden toegepast? Beperkingen Loop + Gebruik dit om AAPS loop integratie te activeren. APS Berekening met toepassing van limieten Tijdelijk basaal gezet door pomp @@ -81,9 +72,9 @@ Plugin is gedeactiveerd In strijd met beperkingen Accepteer nieuw tijdelijk basaal: - Bolus Wijzig het ingegevene! BG bron + Waar moet de AAPS zijn gegevens vandaan halen? xDrip+ APS Mode Closed loop @@ -92,7 +83,6 @@ Nieuw voorstel beschikbaar Koolhydraten Voorstel Niet ondersteunde versie van Nightscout - Basaal IOB KH tijdsduur Profiel Tijdelijk basaal @@ -139,7 +129,6 @@ Beschikbaarheid: Voeg toe Wijzig - Maaltijd bolus Correctie Acties (GEVAARLIJK OM UIT TE SCHAKELEN) alleen NS upload @@ -168,8 +157,6 @@ Autosens gegevens Script debug Gebruik Autosens functie - Vernieuwen vanaf NS - Verwijder behandelingen in de toekomst ACT CONF LOOP @@ -243,9 +230,6 @@ 10 uur Hervatten Opnieuw verbinden met pomp - 15min trend - COB - Superbolus Log app start naar NS Sluiten van applicatie om instellingen bij te werken. Welk soort insuline gebruik je? @@ -307,6 +291,7 @@ Gemiddelde gevoeligheid Niet alle profielen zijn geladen! Waarden niet opgeslagen! + Schakel lokaal data delen met andere apps (zoals xDrip+) in. Schakel dit niet in als er meer dan één installatie van AAPS of NSClient zijn geinstalleerd! Activeer locaal delen. OpenAPS SMB Dynamische ISF @@ -469,7 +454,6 @@ Virtuele pomp Type Pomp definitie Bolus: Stap=%1$s\nExtended Bolus: [Stap=%2$s, Duur=%3$smin-%4$sh]\nBasaal: Stap=%5$s\nTBR: %6$s (by %7$s), Duur=%8$smin-%9$sh\n%10$s - Wizard instellingen Berekeningen inclusief in het resultaat van de wizard Scherm instellingen Algemene instellingen @@ -477,6 +461,7 @@ Welkom bij de wizard setup. Het zal je begeleiden door het setup-process\n Lees status De installatiewizard overslaan + Druk op de knop hieronder om AAPS basaalwijzigingen te laten voorstellen/uitvoeren Gevoeligheid plugin wordt gebruikt voor de detectie van de gevoeligheid en COB berekening. Voor meer info bezoek: https://androidaps.readthedocs.io/en/latest/Configuration/Sensitivity-detection-and-COB.html NSClient zorgt voor verbinding met Nightscout. Je kunt dit deel nu overslaan, maar pas de Doelen afronden als je het hebt ingesteld. @@ -493,6 +478,8 @@ Ontvang BG waardes van Poctech app Glunovo Ontvang waardes van Glunovo app + Intelligo + Ontvang waarden van de Intelligo app Ontvang BG waardes van Tomato app (MiaoMiao apparaatje) Hoog tijdelijk streefdoel verhoogt gevoeligheid = 100]]> @@ -502,11 +489,10 @@ Wanneer insulineresistentie wordt gedetecteerd, wordt het BG streefdoel verlaagd Gevoeligheid verhoogt het doel Wanneer insulinegevoeligheid wordt gedetecteerd, wordt het BG streefdoel verhoogd - Toon ongeldig - Verberg ongeldig Items verwijderen Sorteer items Opgeslagen instellingen gevonden + Let op: als u activeert en verbinding maakt met een hardwarepomp, kopieert AndroidAPS de basale instellingen van het profiel naar de pomp en overschrijft de bestaande basaal snelheid die in de pomp is opgeslagen. Zorg ervoor dat u de juiste basaal instelling hebt in AndroidAPS. Als u niet zeker weet of niet wilt dat de basaal instellingen op uw pomp worden overschreven, drukt u op Annuleren en herhaalt u het overschakelen naar de pomp op een later tijdstip. Behandelingen data incompleet Onderhoudsinstellingen E-mail @@ -525,13 +511,12 @@ Terug naar standaardinstellingen NSClient werkt niet goed. Overweg een herstart van NS en NSClient. Voorkeur APS-modus - Totaal - Calc Logboekbestanden van vandaag verzenden aan ontwikkelaars samen met de onverwachte situatie. Minimale verzoek voor aanpassing [%] Open Loop zal alleen een wijzigingsverzoek tonen als de verandering groter is dan deze waarde in %. De standaard waarde is 20% == ∑ %1$s E Noteer sensor wissel in NS + Noteer automatisch \"Sensor Wissel\" in NS bij starten van sensor Tomato (MiaoMiao) Tomato Uw Tidepool login gebruikersnaam, normaliter uw e-mailadres @@ -559,17 +544,12 @@ Voer dit deel van het bolus wizard resultaat uit [%] Bolus wizard voert de berekening uit maar alleen dit deel van berekende insuline wordt geleverd. Handig in combinatie met het SMB algoritme. Verhogen van de maximale basaal waarde omdat de instelling lager is dan het maximum in het profiel - %1$s ISF: %2$.1f - %1$.0fg KH-ratio: %2$.1f - %1$.1fg KH-ratio: %2$.1f - %1$d%% Geselecteerd: Eenheden Voltooiing wissen Start wissen Wil je dit leerdoel opnieuw starten? Je kunt je voortgang verliezen. Selecteer eenheden waarin je waarden wilt weergeven - Nieuw profiel van dit profiel maken? Laagste waarde in bereik (alleen weergave) Hoogste waarde in bereik (alleen weergave) Ongeldig % invoer @@ -619,12 +599,12 @@ Start alarm wanneer het tijd is om te eten Tijd om te eten!\nVoer de boluswizard opnieuw uit. Bolus herinnering inschakelen + Gebruik herinnering om later te bolussen met de wizard (\"post-bolus\") Upload van crashrapporten is uitgeschakeld! Grafiek Grafiek menu Verwijder filter Canule - Gebruikersinvoer Gebruik de waarden van je grootste maaltijd die je gewoonlijk eet\n Deze identificatie wordt gekoppeld aan crashrapporten, zodat we contact met je kunnen opnemen in urgente gevallen. Het is optioneel. E-mailadres @@ -632,7 +612,6 @@ U kunt optioneel een e-mailadres opgeven als u op de hoogte wilt worden gebracht van applicatie crashes. Dit is geen geautomatiseerde service. De ontwikkelaars zullen contact met u opnemen bij gevaarlijke situaties. Volledige synchronisatie Volledige synchronisatie? Dit kan een aantal uren duren. Je ziet dan geen nieuwe gegevens in Nightscout. - Vullen Synchronisatie Profielen, bolussen, koolhydraten, tijdelijke basaal standen worden geupload naar NS Upload data naar NS @@ -706,22 +685,9 @@ Onbekend actie commando: Percentage Applicatie standaardwaarden - Toon ongeldig gemarkeerde / verwijderde records - Verberg ongeldig gemarkeerde / verwijderde records - Vernieuw vanaf Nightscout Geselecteerde items verwijderen - Selecteer om te verwijderen - Profiel wijzigingen - Tijdelijke streefdoelen - Koolhydraten en bolus - Weet je zeker dat je %1$d items wilt verwijderen - Geen records beschikbaar - Verberg loop - Toon loop %1$d geselecteerd Sorteren - Toon loop records - Verberg loop records Loop status Grafiek schaal Profiel 1 @@ -737,10 +703,16 @@ alleen op smartwatch alleen op telefoon sleepmodus + Zoeken GlucoRx Aidex Aidex Ontvang BG waarden van GlucoRx Aidex CGMS. Geblokkeerd door oplaad instellingen Geblokkeerd door verbindings instellingen + (Geen horloge verbonden) + Wijzig gevoeligheid en BG + Database opschonen + Wilt u de database opschonen?\nHet zal bijgehouden wijzigingen en historische gegevens ouder dan 3 maanden verwijderen. + Invoergegevens gewist diff --git a/app/src/main/res/values-no-rNO/strings.xml b/app/src/main/res/values-no-rNO/strings.xml index 9d2da5a79d..5593901f91 100644 --- a/app/src/main/res/values-no-rNO/strings.xml +++ b/app/src/main/res/values-no-rNO/strings.xml @@ -34,19 +34,6 @@ Motta BS-verdier fra xDrip+. Lagre data om alle behandlinger som er utført Overvåke og kontrollere AAPS ved hjelp av WearOS-klokken. - Insulin: - Karbo: - IOB: - Total IOB: - Total IOB aktivitet: - Varighet: - Ratio: - Ins: - IOB: - Total IOB: - TT - Korr - Bolus IOB Utfør nå VIRTUELL PUMPE Siste beregning @@ -85,7 +72,6 @@ Plugin er deaktivert Brudd på begrensninger Aksepter ny temp basal: - Behandling Endre dine inndata! BS-kilde Hvor skal AAPS få sine data fra? @@ -97,7 +83,6 @@ Ny anbefaling tilgjengelig Karbo forslag Versjonen av Nightscout støttes ikke - Basal IOB Karbo-tid Profil Temp basal @@ -144,7 +129,6 @@ Gyldig: Legg til Rediger - Måltid Korreksjon Handlinger (FARLIG Å DEAKTIVERE) Kun NS opplasting @@ -173,8 +157,6 @@ Autosens-data Script feilsøking Bruk Autosens funksjon - Gjenoppfrisk fra NS - Slett fremtidige behandlinger ACT KONF LOOP @@ -248,9 +230,6 @@ 10 timer Gjenoppta Koble til pumpen - 15 min trend - COB - Superbolus Logg app-start til NS Avslutter appen for å aktivere innstillinger. Hvilken type insulin bruker du? @@ -475,7 +454,6 @@ Virtuell pumpetype Pumpedefinisjon Bolus: Step=%1$s\nForlenget bolus: [Step=%2$s, Varighet=%3$smin-%4$sh]\nBasal: Step=%5$s\nTBR: %6$s (av %7$s), Varighet=%8$smin-%9$sh\n%10$s - Veiviser innstillinger Beregninger inkludert i resultatet fra veiviseren: Visningsinnstillinger Generelle innstillinger @@ -511,9 +489,6 @@ Hvis resistens oppdages vil det redusere BS målverdi Sensitivitet øker BS målverdi Når systemet oppdager økt insulinsensitivitet, vil BS målverdi økes - Fjern oppføringer startet av AAPS - Vis ugyldige oppføringer - Skjul ugyldige oppføringer Fjern oppføringer Sorter elementer Lagrede innstillinger funnet @@ -536,8 +511,6 @@ Gjenopprett standardinnstillinger NSClient feil. Vurder omstart av NS og NSClient. Foretrukket APS modus - Total - Kalkyle Send dagens loggfiler til utviklere og med dette tidspunktet. Uventet situasjon. Minste endrings forespørsel [%] I åpen Loop modus vil AAPS be om en endring hvis forandringen er større enn denne verdien i %. Standard verdi er 20% @@ -571,17 +544,12 @@ Doser denne delen av bolus wizard resultat [%] Bolus veiviser utfører beregninger, men bare denne del av beregnet insulin leveres. Nyttig ved bruk av SMB algoritmen. Øker maks basaldose fordi innstillingen er lavere enn din maks basal i profilen - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Valgt: Enheter Sletting ferdig Sletting startet Ønsker du å omstarte læringsmålet? Du vil miste fullførte trinn. Velg enheter som du vil vise verdier i - Opprett ny profil fra denne profilen? Nedre verdi for målområdet (kun visning) Øvre verdi for målområdet (kun visning) Ugyldig % oppføring @@ -638,7 +606,6 @@ Diagram meny Nullstill filtre Kanyle - Bruker registrering Bruk verdiene for det største måltidet du normalt spiser\n Denne e-postadressen vedlegges krasjrapporter slik at vi kan kontakte deg i akutte tilfeller. Det er valgfritt. E-postadresse @@ -646,7 +613,6 @@ Du kan oppgi valgfri e-postadresse hvis du ønsker å bli varslet om krasj. Dette er ikke en automatisert tjeneste. Du vil bli kontaktet av utviklere ved farlige hendelser. Full synkronisering Full synkronisering? Dette kan ta mange timer og du ser ikke nye data i NS før dette er ferdig. - Prime Synkronisering Profiler, boluser, karbohydrater, midlertidige basaler lastes opp til NS Last opp data til NS @@ -720,22 +686,9 @@ Ukjent kommando: Prosent Standardverdi - Vis ugyldige / slettede registreringer - Skjul ugyldige / slettede registreringer - Oppdater fra Nightscout Fjern valgte elementer - Velg hva som skal fjernes - Profilendringer - Temp Target - Karbohydrater og bolus - Er du sikker på at du vil fjerne %1$d elementer - Ingen registreringer tilgjengelig - Skjul loop - Vis loop %1$d valgt Sorter - Vis loop registreringer - Skjul loop registreringer Loop status Diagram skala Profil 1 diff --git a/app/src/main/res/values-pl-rPL/strings.xml b/app/src/main/res/values-pl-rPL/strings.xml index 293471aa5a..b33bbd0667 100644 --- a/app/src/main/res/values-pl-rPL/strings.xml +++ b/app/src/main/res/values-pl-rPL/strings.xml @@ -31,19 +31,6 @@ Pobieraj wartości BG z Nightscout Pobieraj wartości BG z xDrip+. Zapisuje wszystkie wykonane czynności leczenia - Insulina: - Węglow.: - IOB: - Całkowita IOB: - Aktywna IOB: - Czas: - Iloczyn: - Ins: - IOB: - Całkowita IOB: - TT - Poprawka - IOB z bolusów Uruchom teraz POMPA WIRTUALNA Ostatnie działanie @@ -79,7 +66,6 @@ Wtyczka jest wyłączona Naruszenie ograniczeń Akceptuj nową bazę tymczasową: - Terapia Zmień wprowadzone dane! Źródło BG xDrip+ @@ -90,7 +76,6 @@ Dostępna nowa sugestia Sugestia węglowodanów Niewspierana wersja Nightscout - IOB z bazy Czas węglow. Profil BazaTymczasowa @@ -137,7 +122,6 @@ Ważny: Dodaj Edytuj - Posiłek Korekta Akcje (NIEBEZPIECZNIE TO WYŁĄCZYĆ) tylko przesyłanie NS @@ -166,8 +150,6 @@ Dane Autosens Debugowanie skryptów Użyj funkcji Autosens - Odśwież z NS - Usuń zabiegi w przyszłości ACT CONF LOOP @@ -240,9 +222,6 @@ 10 godzin Wznów Połącz ponownie pompę - Trend 15 minutowy - COB - Superbolus Wyślij start app do NS Zamykanie aplikacji w celu wprowadzenia ustawień. Jakiego typu insuliny używasz? @@ -457,7 +436,6 @@ Pompa wirtualna Definicja Pompy Bolus: Krok =%1$s\nBolus Przedłużony: [krok =%2$s, czas trwania =%3$smin -%4$sh] \nBasal: krok =%5$s\nTBR: %6$s (przez %7$s), czas trwania =%8$smin -%9$sh\n%10$s - Ustawienia kreatora Obliczenia uwzględnione w wynikach kreatora: Ustawienia wyświetlania Ustawienia ogólne @@ -508,8 +486,6 @@ Przywróć ustawienia domyślne Usterka NSClient. Spróbuj zrestartować NS i NSClient. Preferowany tryb APS - Razem - Kalk Wyślij dzisiejsze pliki logów razem z datą i czasem do programistów. Nieoczekiwana sytuacja. Minimalna żądana zmiana [%] Otwarta pętla wprowadzi żądanie zmiany tylko w przypadku, gdy będzie ona większa niż ta wartość w %. Wartość domyślna to 20% @@ -542,17 +518,12 @@ Dostarcz tą część dawki insuliny z wyniku kalkulatora bolusa [%] Kreator bolusa wykonuje obliczenia, ale tylko ta część obliczonej dawki insuliny jest dostarczana. Pomocne z algorytmem SMB. Zwiększanie maksymalnej wartości bazowej ponieważ ustawienia są poniżej maxymalnej wartości bazy w profilu - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Wybrany: Jednostki Wyczyść skończone Wyczyść rozpoczęte Czy chcesz zresetować czas rozpoczęcia zadania? Możesz utracić postępy. Wybierz jednostki, w których chcesz wyświetlać wartości - Utworzyć nowy profil na bazie wybranego profilu? Dolna wartość zakresu docelowego (tylko do wyświetlania) Górna wartość zakresu docelowego (tylko do wyświetlania) Nieprawidłowa wartość procentowa @@ -607,7 +578,6 @@ Menu wykresu Wyczyść filtr Kaniula - Wpis użytkownika Użyj wartości największego jedzenia, które zazwyczaj zjadasz\n Ten identyfikator zostanie dołączony do raportu o błędzie aby umożliwić kontakt z tobą, w przypadku gdyby zaszła pilna konieczność. Jego podanie jest opcjonalne. Adres e-mail @@ -615,7 +585,6 @@ Możesz opcjonalnie podać adres e-mail, jeśli chcesz otrzymywać powiadomienia o awariach aplikacji. To nie jest usługa zautomatyzowana. W niebezpiecznych sytuacjach deweloperzy skontaktują się z Tobą. Pełna synchronizacja Wykonać pełną synchronizację? Może ona potrwać wiele godzin i aż do jej zakończenia nie zobaczysz nowych danych w NS. - Wypełnianie Synchronizacja Profile, bolusy, węglowodany, tymczasowe bazy są przesyłane do NS Prześlij dane do NS @@ -643,8 +612,6 @@ Niedostępne Usuń wybrane pozycje - Czy na pewno chcesz usunąć %1$d pozycji - Brak wpisów Wybrany %1$d Sortuj Zaloguj się diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 16a8ecc646..b9b056060c 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -32,19 +32,6 @@ Downloads de dados de Glicose do Nightscout Receber valores de glicose do xDrip+. Salva todos os tratamentos que foram feitos - Insulina: - Carboidratos: - IOB: - IOB Total: - Atividade Total IOB: - Dur: - Rácio: - Ins: - IOB: - IOB Total: - TT - Corr - I.A de Bolus Executar agora BOMBA VIRTUAL Última execução @@ -80,7 +67,6 @@ Plugin está desativado Violação das restrições Aceitar nova basal temporária: - Tratamento Altere sua entrada! Fonte de BG xDrip+ @@ -91,7 +77,6 @@ Nova sugestão disponível Sugestão de Carbs Versão não suportada do Nightscout - IOB Basal Hora do carboidrato Perfil Basal Temporária @@ -138,7 +123,6 @@ Válido: Adicionar Editar - Refeição Correção Ações (PERIGOSO PARA DESATIVAR) somente upload para NS @@ -166,8 +150,6 @@ Dados Autosens Script debug Usar função Autosens - Atualizar de NS - Apagar tratamentos do futuro ACT CONF LOOP @@ -241,9 +223,6 @@ 10 horas Continuar Reconectar Bomba - Tendência 15 min - CA - Superbolus Registrar início do app no NS Saindo do app para aplicar as configurações. Que tipo de insulina está usando? @@ -432,7 +411,6 @@ Tipo da Bomba Virtual Definição da Bomba Bólus: Passo=%1$s\nBólus Estendido: [Passo=%2$s, Duração=%3$smin -%4$sh] \nBasal: Passo=%5$s\ nTBR: %6$s (por %7$s), Duração=%8$smin-%9$sh\n%10$s - Definições do Assistente Rápido Resultado cálculos incluídos no Assistente: Mostrar Configurações Configurações gerais @@ -478,8 +456,6 @@ Repor definições por defeito Erro de funcionamento do NSCliente. Pondere reiniciar o NS e NSCliente. Modo APS preferido - Total - Calc Enviar os ficheiros de registo do dia de hoje para os programadores. Situação inesperada. Pedido de mudança mínima [%] A app mostrará um pedido de alteração apenas se a mudança for superior a este valor em %. O valor padrão é 20% @@ -512,16 +488,12 @@ Entregue esta parte do resultado do assistente de bólus [%] Assistente de bólus executa o cálculo, mas apenas esta parte da insulina calculada é entregue. Útil com o algoritmo SMB. Aumentar o valor máximo de basal porque a configuração é inferior à sua basal máxima no perfil - %1$s FSI: %2$.1f - %1$.0fg IC: %2$.1f - %1$d%% Seleccionado: Unidades Limpeza terminado Limpeza iniciado Deseja reiniciar o objetivo? Pode perder seu progresso. Seleccione as unidades em que deseja exibir os valores - Criar novo perfil local a partir deste perfil? Valor mais baixo da área de intervalo (apenas exibição) Valor mais alto da área de intervalo (apenas exibição) Entrada % inválida @@ -571,7 +543,6 @@ Disparar alarme quando for a hora de comer Hora de comer!\nAbra o assistente de bolus e faça o cálculo novamente. Ativar lembrete de bolus - Purgar/Preencher Perfis, bolus, carboidratos, basais temporários são enviados para NS Receber taxa basal temporária (TBT) e bolus estendido (e-bolus ou BE) Aceitar taxa basal temporária (TBT) e bolus estendido (BE) informados por outra instância @@ -610,14 +581,7 @@ CA desconhecido! Leitura de Glicemia faltando ou reinício recente do app? CA: %1$.0fg %2$.2fU Tendência 15min: %1$.2fU - Exibir registros invalidados / removidos - Ocultar registros invalidados / removidos - Atualizar do NS (Nightscout) - Nenhum registro disponível - Exibir loop Ordenar - Exibir registros do loop - Ocultar registros do loop Status do loop abrir configurações definir alarme temporizador de carboidrato diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 112ec38a4e..85bee3aab5 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -31,19 +31,6 @@ Descarrega dados Glicose do Nightscout Receber valores Glicose do xDrip+. Guarda todos os tratamentos que foram feitos - Insulina: - Hidratos: - IA: - IA Total: - Atividade Total da IA: - Dur: - Rácio: - Ins: - IA: - Total da IA: - AT - Corr - Bólus - IA Executar agora BOMBA VIRTUAL Última execução @@ -79,7 +66,6 @@ Plugin está desativado Violação das restrições Aceitar nova basal temporária: - Tratamento Altere o seu input! Fonte da Glicose xDrip+ @@ -90,7 +76,6 @@ Disponível nova sugestão Sugestão de Hidratos Versão sem suporte do Nightscout - Basal IA Hora dos Hidratos Perfil Basal Temporária @@ -137,7 +122,6 @@ Válido: Adicionar Editar - Refeição Corr Acções (PERIGOSO DESACTIVAR) Envio NS apenas @@ -165,8 +149,6 @@ Dados Autosens Script debug Utilizar função Autosens - Atualizar a partir do NS - Apagar tratamentos do futuro ACÇ CONF LOOP @@ -239,9 +221,6 @@ 10 horas Retomar Re-ligar a Bomba - Tendência 15 min - HCA - Superbólus Registar inicio da app no NS A sair da aplicação para aplicar as definições. Qual o tipo de insulina que está a utilizar? @@ -456,7 +435,6 @@ Tipo da Bomba Virtual Definição da Bomba Bólus: Passo=%1$s\nBólus Prolongado: [Passo=%2$s, Duração=%3$smin -%4$sh] \nBasal: Passo=%5$s\ nDBT: %6$s (por %7$s), Duração=%8$smin-%9$sh\n%10$s - Definições do Assistente Rápido Resultado cálculos incluídos no Assistente: Definições Ecrã Definições Gerais @@ -506,8 +484,6 @@ Repor definições por defeito Erro de funcionamento do ClienteNS. Pondere reiniciar o NS e ClienteNS. Modo APS preferido - Total - Calc Enviar os ficheiros de registo do dia de hoje para os programadores. Situação inesperada. Pedido de mudança mínima [%] A app mostrará um pedido de alteração apenas se a mudança para uma nova basal temporária for superior a este valor em %. O valor padrão é 20% @@ -540,17 +516,12 @@ Administrar esta parte do resultado do assistente de bólus [%] Assistente de bólus executa o cálculo, mas apenas esta parte da insulina calculada é administada. Útil com o algoritmo SMB. Aumentar o valor máximo de basal porque a configuração é inferior à sua basal máxima no perfil - %1$s FSI: %2$.1f - %1$.0fg IHC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Seleccionado: Unidades Limpar terminado Limpar iniciado Deseja reiniciar o objectivo? Pode perder seu progresso. Seleccione as unidades em que deseja exibir os valores - Criar novo perfil local a partir deste perfil? Valor mais baixo da área de intervalo (apenas exibição) Valor mais alto da área de intervalo (apenas exibição) Entrada % inválida @@ -604,7 +575,6 @@ Menu do Gráfico Limpar filtros Cânula - Entrada de Utilizador Utilize valores da sua maior refeição que normalmente come\n Esta identificação será anexada aos relatórios de erro para que possamos contatá-lo em casos urgentes. É opcional. Endereço de email @@ -612,7 +582,6 @@ Opcionalmente pode fornecer um endereço de e-mail se quiser ser notificado sobre os erros da app. Este não é um serviço automatizado. Será contactado por desenvolvedores em situações perigosas. Sincronização completa Sincronização completa? Pode levar muitas horas até terminar e não irá ver dados novos no NS. - Purgar Sincronização Perfil, bolus, hidratos de carbono e basais temporárias são enviados para o NS Enviar dados para o NS diff --git a/app/src/main/res/values-ro-rRO/strings.xml b/app/src/main/res/values-ro-rRO/strings.xml index 2e8d505fd0..e7f9e50cf2 100644 --- a/app/src/main/res/values-ro-rRO/strings.xml +++ b/app/src/main/res/values-ro-rRO/strings.xml @@ -31,19 +31,6 @@ Descarcă datele despre glicemii din Nightscout Primește valorile glicemiei din xDrip+. Salvează toate tratamentele făcute - Insulină: - Carbohidrați: - IOB: - IOB total: - Activitate total IOB: - Durată: - Raport: - Ins: - IOB: - IOB totală: - TT - Corecție - IOB bolus Execută POMPĂ VIRTUALĂ Ultima execuție @@ -79,7 +66,6 @@ Modul inactiv Încălcare a unei limite Acceptă noua bazală temporară: - Tratament Schimbați ceea ce ați introdus! Sursă glicemie xDrip+ @@ -90,7 +76,6 @@ O nouă sugestie este disponibilă Sugestie carbohidrați Versiune incompatibilă de Nightscout - IOB bazală Ora carbohidrați Profil Bazală temporară @@ -137,7 +122,6 @@ Valabil: Adaugă Editează - Masă Corecție Acțiuni (E PERICULOS SĂ DEZACTIVEZI) Doar încărcare în NS @@ -165,8 +149,6 @@ Date Autosens Depanare script Folosește opțiunea de autosensibilitate - Actualizează din NS - Ștergerea tratamentelor înregistrate în viitor ACT CONF BUCL @@ -239,9 +221,6 @@ 10 ore Restabilește Reconectaţi pompa - Tendință 15min - COB - Superbolus Înregistrează pornirea aplicației în NS Se iese din aplicație în vederea aplicării setărilor. Ce tip de insulină folosiți? @@ -456,7 +435,6 @@ Tipul pompei virtuale Definirea pompei Bolus: Pas=%1$s\nBolus Extins: [Pas=%2$s, Durată=%3$smin-%4$sh]\nBazală: Pas=%5$s\nRBT: %6$s (cu %7$s), Durată=%8$smin-%9$sh\n%10$s - Asistent setări Calcule incluse în rezultatul asistentului: Setări afișare Setări generale @@ -506,8 +484,6 @@ Resetare la setările implicite Funcționare incorectă a NSClient. Aveți în vedere un restart al NS și al NSClient. Modul APS preferat - Total - Calc Trimite înregistrările zilei de astăzi către dezvoltatori, împreună cu timpul curent. Situație neașteptată. Cerere de schimbare minimală [%] Bucla deschisă va afișa o nouă cerere de schimbare doar dacă nou valoare este mai mare cu %. Valoarea implicită este 20% @@ -540,17 +516,12 @@ Livrați doar partea aceasta din rezultatul sugerat de wizard [%] Wizard bolus face un calcul, dar numai o parte din insulina calculată este și livrată. Este mai eficient când se folosește cu algoritmul SMB. Se mărește valoarea bazalei maxime deoarece setarea este mai joasă decât bazala maximă din profil - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Selectat: Unități Șterge starea \"Terminat\" Șterge starea \"Început\" Doriți să reîncepeți obiectivul? Vă puteți pierde progresul. Selectați unitățile în care doriți să afișați valorile - Creați un profil nou din acest profil? Valoarea inferioară a intervalului țintă (doar afișare) Valoarea superioară a intervalului țintă (doar afișare) Intrare % invalidă @@ -604,7 +575,6 @@ Meniu diagramă Șterge filtru Canula - Înregistrare utilizator Folosește valorile corespunzătoarea celor mai mari mese pe care le ai de obicei\n Această identificare va fi atașată rapoartelor de eroare pentru a vă putea contacta în cazuri urgente. Este opționala. Adresă de e-mail @@ -612,7 +582,6 @@ Puteți furniza o adresă de e-mail opțională dacă doriți să fiți notificat despre erorile aplicației. Acesta nu este un serviciu automat. Veți fi contactat de dezvoltatori în situații periculoase. Sincronizare completă Sincronizare completă? Poate dura multe ore şi până la final nu veţi vedea date noi în NS. - Amorsare Sincronizare Profilurile, bolusurile, carbohidrații, bazalele temporare sunt încărcate în NS Încarcă date în NS @@ -639,7 +608,6 @@ Identificarea nu este setată în modul dezvoltator Nu este disponibil - Sigur vrei să elimini %1$d element(e) Sortează Autentificare diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml index 41348627fe..81c89d669b 100644 --- a/app/src/main/res/values-ru-rRU/strings.xml +++ b/app/src/main/res/values-ru-rRU/strings.xml @@ -34,19 +34,6 @@ Получать данные гликемии от xDrip+. Сохраняет все выполненные назначения Мониторить и контролировать AAPS при помощи часов WearOS. - инсулин: - углеводы: - IOB: активн инс - Общий IOB: - Общая активность IOB: - длит: - соотношение: - инсулин: - IOB: активный инсулин - общий IOB - TT - коррекция - болюс IOB выполнить сейчас ВИРТУАЛЬНАЯ ПОМПА последнее выполненное @@ -85,7 +72,6 @@ модуль не активен ограничение нарушено принять новый врем базал: - болюс измените введенные данные источник СК Откуда должен получать данные AAPS? @@ -97,7 +83,6 @@ есть новое предложение Предложены углеводы Неподдерживаемая версия Nightscout - базал IOB Подождать до еды профиль ВремБазал @@ -144,7 +129,6 @@ использовать до: добавить редактировать - болюс на еду коррекция действия (ОТКЛЮЧЕНИЕ ОПАСНО) Только загрузка в NS @@ -173,8 +157,6 @@ данные autosens отладка скрипта Пользоваться функцией Autosens - Обновить из NS - Удалить назначения из будущего ДЕЙСТВ КОНФ ЗЦ @@ -248,9 +230,6 @@ 10 часов возобновить Возобновить соединение с помпой - 15 мин тренд - активн углеводы - суперболюс Передать в NS запись о начале работы приложения выход из приложения для применения настроек Какой тип инсулина вы используете? @@ -475,7 +454,6 @@ Тип виртуальной помпы Определение помпы Болюс: Шаг =%1$s\n Пролонгированный Болюс: [Шаг =%2$s, Продолжительность =%3$sмин -%4$sh] \nБазал: Шаг =%5$s\n ВБС: %6$s (на %7$s), Продолжительность =%8$sмин -%9$sh\n%10$s - Параметры мастера настройки смарт-часов wear Расчеты, включены в результат мастера настройки смарт-часов wear: Параметры экрана Общие настройки wear @@ -511,9 +489,6 @@ При обнаружении сопротивляемости целевой уровень гликемии понижается Чувствительность поднимает цель При обнаружении чувствительности целевой уровень глюкозы повышается - Удалить начатые записи AAPS - Показать недействительные - Скрыть недействительные Удалить элементы Сортировать элементы Найдены сохраненные параметры @@ -536,8 +511,6 @@ Восстановить значения по умолчанию Некорректная работа NSClient. Возможно следует перезапустить NS и NSClient. Предпочитаемый режим APS - Итого - Кальк Отправьте файлы сегодняшнего лога разработчикам наряду с этим. Непредвиденная ситуация. Минимальный запрос на изменения [%] Алгоритм ИПЖ выдаст всплывающее окно с запросом на новые изменения, только если изменение больше, чем это значение в %. Значение по умолчанию — 20% @@ -571,17 +544,12 @@ Подать эту часть рекомендации мастера болюса [%] Мастер болюса выполняет расчет, но подана только эта часть рекомендуемого инсулина. Полезно с алгоритмом SMB. Повышаю максимальное значение базы т. к. оно меньше, чем максимальное значение в профиле - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Выбрано: Единицы Очистить завершенные Очистить начатые Хотите сбросить начатую цель? Можете потерять уже достигнутое. Выберите единицы, в которых вы хотите отображать значения - Создать новый локальный профиль из этого? Меньшее значение диапазона целевых значений (только для дисплея) Большее значение диапазона целевых значений (только для дисплея) Некорректный ввод % @@ -637,7 +605,6 @@ Меню графика Очистить фильтр Катетер помпы - Запись пользователя Введите максимальные значения вашего приема пищи \n Эта идентификация будет прикреплена к отчетам о сбоях, чтобы мы могли связаться с вами в экстренных случаях. Это опция. Адрес электронной почты @@ -645,7 +612,6 @@ Вы можете указать дополнительно адрес электронной почты, если хотите получать уведомления о сбоях приложения; что является не автоматизированной рассылкой, а способом связи с разработчиками в опасных ситуациях. Полная синхронизация Полная синхронизация? Это может занять много часов и до завершения вы не увидите новые данные в NS. - Заполнение инфузионной системы Синхронизация Профили, болюсы, углеводы, временные базалы закачиваются в NS Передать данные в NS @@ -719,22 +685,9 @@ Неизвестная команда: Процент По умолчанию приложения - Показать недействительные / удаленные записи - Скрыть недействительные / удаленные записи - Обновить из Nightscout Удалить выбранные элементы - Выберите для удаления - Изменение профиля - Временные цели - Углеводы и болюс - Вы уверены, что хотите удалить %1$d элементов - Нет доступных записей - Скрыть цикл - Показать цикл %1$d выбрано Сортировать - Показать записи цикла - Скрыть записи цикла Статус цикла Масштаб графика Профиль 1 diff --git a/app/src/main/res/values-sk-rSK/strings.xml b/app/src/main/res/values-sk-rSK/strings.xml index 014414419d..86f7f66751 100644 --- a/app/src/main/res/values-sk-rSK/strings.xml +++ b/app/src/main/res/values-sk-rSK/strings.xml @@ -34,19 +34,6 @@ Prijímať hodnoty glykémií z xDrip+. Ukladá všetky ošetrenia do databázy Zobrazovanie stavu a riadenie AndroidAPS z hodiniek s WearOS. - Inzulín: - Sacharidy: - IOB: - Celkový IOB: - Celková aktivita IOB: - Trv: - Pomer: - Inz: - IOB: - Celkový IOB: - TT - Korekcia - Bolusový IOB Spustiť teraz Virtuálna pumpa Posledné spustenie @@ -85,7 +72,6 @@ Modul je deaktivovaný Mimo povolený rozsah Povoliť nový dočasný bazál: - Bolus Zmeňte zadanie! Zdroj glykémie Odkiaľ má AndroidAPS získavať glykémie? @@ -97,7 +83,6 @@ Dostupné nové doporučenie Návrh sacharidov Nepodporovaná verzia Nighscoutu - Bazálny IOB Čas jedla Profil Dočasný bazál @@ -144,7 +129,6 @@ Platnosť: Pridať Upraviť - Bolus Korekcia Akcie (DEAKTIVOVANIE NEBEZPEČNÉ) Iba odosielanie do NS @@ -173,8 +157,6 @@ Dáta detekcie citlivosti Ladenie skriptu Použi automatickú detekciu citlivosti - Aktualizovať z NS - Zmazať ošetrenia v budúcnosti AKCIA KONF OKRUH @@ -248,9 +230,6 @@ 10 hodiny Pokračovať Znovu pripojiť pumpu - 15min trend - COB - Superbolus Zaznamenávať spustenie aplikácie do NS Zatváram aplikáciu, aby sa aplikovali nové nastavenia. Aký druh inzulínu používate? @@ -475,7 +454,6 @@ Typ virtuálnej pumpy Definícia pumpy Bolus: Krok =%1$s\nPredl. bolus: [Krok=%2$s, Dĺžka=%3$smin-%4$sh]\nBazál: Krok=%5$s\nDoč. bazál: %6$s (%7$s), Dĺžka=%8$smin-%9$sh\n%10$s - Nastavenie wizardu Kalkulácia použitá vo výsledku wizardu: Nastavenie zobrazenia Všeobecné nastavenia @@ -511,9 +489,6 @@ Ak je zistená rezistancia, znížiť cieľovú hladinu glykémie Citlivosť zvyšuje cieľ Ak je zistená vyššia citlivosť, zvýši cieľovú hladinu glykémie - Odstrániť všetky záznamy AAPS spustený - Zobraziť neplatné - Skryť zneplatnené Odstrániť položky Zoradiť položky Nájdené uložené nastavenia @@ -536,8 +511,6 @@ Obnoviť predvolené Chyba NSClienta. Zvážte reštart NS a NSClienta. Preferovaný režim APS - Spolu - Kalk Odošlite dnešné súbory protokolov vývojárom spolu s týmto časom. Neočakávaná situácia. Minimálna požiadavka na zmenu [%] Otvorený okruh vytvorí novú žiadosť o zmenu iba v prípade, že zmena je väčšia ako táto hodnota v %. Štandardná hodnota je 20% @@ -571,17 +544,12 @@ Podaj túto časť z výsledku kalkulácie [%] Bolusová kalkulačka urobí výpočet, ale iba táto časť vypočítaného inzulínu je podaná. Pomáha pri SMB algoritme. Zvýšenie maximálnej hodnoty bazálu, pretože nastavenie je nižšie, než je vaša maximálna hodnota bazálu v profile - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Vybrané: Jednotky Vymazanie dokončené Vymazanie začaté Chcete resetovať začiatok cieľa? Môžete prísť o svoj pokrok. Vyberte jednotky, v ktorých chcete zobraziť hodnoty - Vytvoriť z tohoto profilu nový lokálny profil? Spodná hodnota v oblasti cieľového rozsahu (iba zobrazovanie) Horná hodnota v oblasti cieľového rozsahu (iba zobrazovanie) Neplatný vstup % @@ -638,7 +606,6 @@ Grafové menu Vyčistiť filter Kanyla - Vstup používateľa Použite hodnoty pre najväčšie jedlo, aké obvykle jete\n Táto identifikácia bude priložená ku správam o zlyhaniach, aby sme Vás mohli v naliehavých prípadoch kontaktovať. Je to voliteľné. Emailová adresa @@ -646,7 +613,6 @@ Pokiaľ chcete byť upozornení na zlyhanie aplikácie, môžete zadať voliteľne e-mailovú adresu. Toto nie je automatizovaná služba. Vývojári vás budú kontaktovať v nebezpečných situáciách. Úplná synchronizácia Úplná synchronizácia? Môže to trvať niekoľko hodín a kým skončí, neuvidíte nové dáta v NS. - Plnenie Synchronizácia Profily, bolusy, sacharidy, dočasné bazály sú nahrávané do NS Nahrávať dáta do NS @@ -720,22 +686,9 @@ Neznámy príkaz k akcii: Percentuálny podiel Predvolené aplikáciou - Zobraziť zneplatnené / odstránené záznamy - Skryť zneplatnené / odstránené záznamy - Obnoviť z Nightscoutu Odstrániť vybrané položky - Vyberte pre odstránenie - Zmeny profilu - Dočasné ciele - Sacharidy a bolusy - Naozaj chcete odstrániť %1$d položku(y) - Nie sú k dispozícii žiadne záznamy - Skryť uzavretý okruh - Zobraziť uzavretý okruh Vybrané: %1$d Zoradiť - Zobraziť záznamy uzavretého okruhu - Skryť záznamy uzavretého okruhu Stav uzavretého okruhu Mierka grafu Profil 1 diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml index 345eb11401..bdc1c996a4 100644 --- a/app/src/main/res/values-sv-rSE/strings.xml +++ b/app/src/main/res/values-sv-rSE/strings.xml @@ -33,19 +33,6 @@ Eversense-appen. Ladda ner BG-data från Nightscout Ta emot BG-data från xDrip+. Spara alla behandlingar som gjorts - Insulin: - KH: - IOB: - IOB fr bolus: - Insulinaktivitet (5m): - Dur: - Tot: - Ins: - IOB: - IOB fr basal: - TT - Korrektion - Bolus IOB Utför nu Virtuell pump Senaste beräkning @@ -81,7 +68,6 @@ Eversense-appen. Insticksprogram inaktiverat Begränsning nådd Acceptera ny temp basal: - Behandling Ändra inmatning BG-källa xDrip+ @@ -92,7 +78,6 @@ Eversense-appen. Ny rekommendation tillgänglig KH-förslag Versionen av Nightscout stöds inte - IOB från basal KH-tid Profil Temp basal @@ -139,7 +124,6 @@ Eversense-appen. Giltig: Lägg till Ändra - Måltid Korrektion Åtgärder (INAKTIVERAD KAN MEDFÖRA FARA) NS-Endast uppladdning @@ -168,8 +152,6 @@ Eversense-appen. Autosensdata Debug Använd autosens - Uppdatera från NS - Ta bort behandlingar från framtiden Act Konf Loop @@ -243,9 +225,6 @@ Eversense-appen. 10 tim Återuppta Återanslut Pump - 15 min trend - COB - Superbolus Rapportera appstart till Nightscout Avslutar appen för att inställningarna ska läsas in. Vilken typ av insulin använder du? @@ -461,7 +440,6 @@ Eversense-appen. Typ av virtuell pump Pumpdefinition Bolus: Steg =%1$s\nFörlängd bolus: [Steg=%2$s, duration =%3$smin -%4$sh] \nBasal: Steg=%5$s\nTempbasal: %6$s (av %7$s), duration =%8$smin -%9$sh\n%10$s - Kalkylatorinställningar Kalkyler inkluderade i resultatet Visningsinställningar Generella inställningar @@ -511,8 +489,6 @@ Eversense-appen. Återställ standardinställningar Fel på NSClient. Överväg att starta om NSClient och Nightscout-webbplatsen. Föredraget APS-läge - Total - Kalkyl Skicka dagens loggfiler till utvecklarna tillsammans med denna datumstämpel. Oväntad situation. Minsta ändring som ger notifiering [%] I Open Loop-läge kommer AAPS bara att be om ändring ifall förändringen är större än detta värde. Standardvärdet är 20% @@ -545,17 +521,12 @@ Eversense-appen. Direkt bolus [%] Bolusguiden utför beräkningar, men endast denna del av beräknat insulin levereras. Användbar med SMB-algoritm. Ökar maximalt basaldos eftersom inställningen är lägre än din maximala basal i profilen - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% Valt: Enheter Rensa avslutade Rensa påbörjade Vill du starta om målet? Du kan förlora de steg du gjort hittills. Välj enheter du vill visa värden i - Skapa kopia av denna profil? Nedre värdet för målområde (endast visning) Övre värdet för målområde (endast visning) Ogiltig %-inmatning @@ -609,7 +580,6 @@ Eversense-appen. Diagrammeny Rensa filter Kanyl - Angivet av användare Använd värden för den största måltiden som du vanligen äter\n Den här mejladressen kommer att bifogas till kraschrapporter så att vi kan kontakta dig i brådskande fall. Det är frivilligt. E-postadress @@ -617,7 +587,6 @@ Eversense-appen. Du kan ange valfri e-postadress om du vill få meddelanden om appkrascher. Det här är ingen automatiserad tjänst. Du kommer att kontaktas av utvecklare i farliga situationer. Full synkronisering Full synkronisering? Det kan ta flera timmar du kommer inte att se nya data i NS förrän den är klar. - Förfyllning Synkronisering Profiler, bolus, kolhydrater och temp basaler laddas upp till NS Ladda upp data till NS diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index b939d84e1f..78c38f61d0 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -34,19 +34,6 @@ XDrip+\'ten KŞ değerlerini alır. Yapılan tüm tedavileri kaydeder WearOS saatinizi kullanarak AAPS\'yi izleyin ve kontrol edin. - İnsülin: - Karbonhidrat: - AİNS: - Toplam AİNS: - Toplam AİNS etkinliği: - Süre: - Oran: - İns: - AİNS: - Toplam AİNS: - GH - Düzeltme - Bolus AİNS Şimdi Çalıştır SANAL POMPA Son Çalıştırma @@ -85,7 +72,6 @@ Eklenti devre dışı Kısıtlamalar ihlali Yeni geçici bazal oranını kabul et: - Tedavi Girişinizi değiştirin! KŞ kaynağı AAPS verilerini nereden alsın? @@ -97,7 +83,6 @@ Yeni öneri mevcut Karbonhidrat Önerisi Nightscout\'un desteklenmeyen sürümü - Bazal AİNS Karb. zamanı Profil Geçici Bazal @@ -144,7 +129,6 @@ Geçerli: Ekle Düzenle - Ögün Düzeltme Eylemler (DEVRE DIŞI BIRAKILMASI TEHLİKELİ) Yalnızca NS yüklemelerinde @@ -173,8 +157,6 @@ Otoduyarlılık verileri Skriptte hata ayıkla Otoduyarlılık özelliğini kullan - NS\'tan yenile - İleri tarihli tedavileri sil EYLEM KONF DÖNGÜ @@ -249,9 +231,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d 10 Saat Devam et Pompayı tekrar bağla - 15 dk eğilim - AKRB - Süperbolus NS\'a uygulama başlangıcını kaydet Ayarları uygulamak için uygulamadan çıkılıyor. Hangi tür insülin kullanıyorsunuz? @@ -476,7 +455,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Sanal pompa tipi Pompa tanımı Bolus: Adım=%1$s\nYayma Bolus: [Adım=%2$s, Süre=%3$sdk-%4$ssa]\nBazal: Adım=%5$s\nTBR: %6$s (ile %7$s), Süre=%8$sdk-%9$ssa\n%10$s - Kurulum Sihirbazı Ayarları Sihirbaz sonucuna dahil edilen hesaplamalar: Görüntü Ayarları Genel Ayarlar @@ -512,9 +490,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Direnç tespit edildiğinde KŞ hedefini düşürün Duyarlılık hedefi yükseltir Hassasiyet tespit edildiğinde, KŞ hedefini yükseltin - AAPS tarafından başlatılmış girdileri kaldırın - Geçersiz olanları göster - Geçersiz olanları gizle Öğeleri kaldır Öğeleri sırala Saklanan ayarlar bulundu @@ -537,8 +512,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Varsayılanlara sıfırla NSClient arızası. NS ve NSClient yeniden başlatmayı düşünün. Tercih edilen APS modu - Toplam - Hesap Bu günün kayıt dosyalarını geliştiricilere gönderin. Beklenmedik bir durum. Minimum istek değişikliği [%] Açık Döngü, yalnızca değişiklik % cinsinden bu değerden büyükse yeni değişiklik isteğini açar. Varsayılan değer %20\'dir @@ -572,17 +545,12 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Bolus sihirbazı sonucunun bu kadarını ilet [%] Bolus sihirbazı hesaplamayı gerçekleştirir ancak hesaplanan insülinin yalnızca bu kısmı iletilir. SMB algoritması ile kullanışlıdır. Profilinizdeki maksimum bazal değeriniz düşük olduğu için maksimum bazal değeri artırma - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg Kİ: %2$.1f - %1$d%% Seçildi: Birim Komple tamamlandı Yeniden Başla Görevleri sıfırlamak istiyor musunuz? Tüm yaptıklarınızı kaybedeceksiniz. Değerleri görüntülemek istediğiniz birimleri seçin - Bu profilden yeni profil oluşturulsun mu? Aralıktan daha düşük değer (sadece görüntüle) Aralıktan daha yüksek değer (Sadece görüntüle) Geçersiz % giriş @@ -639,7 +607,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Grafik menüsü Filtreyi temizle Kanül - Kullanıcı girişi Genellikle yediğiniz en büyük yiyeceğin değerlerini kullanın\n Bu kimlik acil durumlarda sizinle iletişim kurabilmemiz için kilitlenme raporlarına eklenecektir. İsteğe bağlıdır. E-posta adresi @@ -647,7 +614,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Uygulama çökmeleri hakkında bilgilendirilmek istiyorsanız isteğe bağlı e-posta adresi sağlayabilirsiniz. Bu otomatik bir hizmet değildir. Tehlikeli durumlarda geliştiriciler sizinle iletişime geçecektir. Tam senkronizasyon Tam senkronizasyon? Birkaç saat sürebilir ve bitene kadar NS\'ta yeni veriler göremeyeceksiniz. - Doldur Senkronizasyon Profiller, boluslar, karbonhidratlar, geçici bazallar NS\'a yüklenir Verileri NS\'a yükleyin @@ -721,22 +687,9 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Bilinmeyen eylem komutu: Yüzde Uygulama varsayılanı - Geçersiz kılınan / kaldırılan kayıtları göster - Geçersiz kılınan / kaldırılan kayıtları gizle - Nightscout\'tan Yenile Seçili nesneleri kaldır - Silmek için seçin - Profil değişiklikleri - Geçici Hedefler - Karbonhidrat ve bolus - %1$d öğeyi kaldırmak istediğinizden emin misiniz - Kayıt mevcut değil - Döngüyü gizle - Döngüyü göster %1$d seçildi Sırala - Döngü kayıtlarını göster - Döngü kayıtlarını gizle Döngü durumu Grafik ölçeği Profil 1 diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 745f4f6812..5bba210bbd 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -32,19 +32,6 @@ 从 Nightscout 下载 血糖数据 从 xDrip+ 接收血糖值。 保存所做的所有治疗 - 胰岛素: - 碳水化合物: - IOB活性胰岛素: - 总 IOB: - 总IOB activity(活动): - Dur: - 比率: - Ins: - IOB活性胰岛素: - 总 IOB: - 临时目标 - 矫正值 - 大剂量活性胰岛素IOB 现在运行 虚拟泵 上一次运行 @@ -80,7 +67,6 @@ 插件已禁用 违反约束条件 接受新的临时基础率 - 治疗 更改您的输入! 血糖来源 xDrip+ @@ -91,7 +77,6 @@ 新的建议可用 碳水建议 不支持的 Nightscout 版本 - 基础 IOB 碳水时间 配置文件 临时基础 @@ -138,7 +123,6 @@ 有效: 添加 编辑 - 饮食 矫正 手动操作 (禁用很危险) NS仅上传 @@ -167,8 +151,6 @@ Autosens 数据 脚本调试 使用Autosens功能 - 从NS刷新 - 删除未来的治疗项 操作 配置 闭环 @@ -242,9 +224,6 @@ 10 小时 恢复 重新连接泵 - 15分钟 趋势 - 碳水 - 超级大剂量Superbolus 记录app启动事件到NS服务器 正在退出应用程序以应用设置。 你使用哪种类型的胰岛素? @@ -462,7 +441,6 @@ 虚拟泵类型 泵定义 大剂量: Step=%1$s\n扩展大剂量: [Step=%2$s, 持续时间=%3$smin-%4$sh]\n基础率: Step=%5$s\nTBR临时基础率: %6$s (by %7$s), 持续时间=%8$smin-%9$sh\n%10$s - 向导设置 包含在向导中的计算结果: 显示设置 常规设置 @@ -495,8 +473,6 @@ 当检测到胰岛素抵抗时,降低血糖的目标值。 敏感时提高目标 当检测到胰岛素敏感时,提高血糖的目标值。 - 显示无效项 - 隐藏失效项 删除项目 项目排序 发现曾经保存过的设置 @@ -516,8 +492,6 @@ 重置为默认值 NSClient故障。 考虑Nightscout和NSClient重启。 首选的APS模式 - 总计 - 计算 发送包括当前时间的今日的日志文件给开发者。描述一下意外情况 最小请求更改[%] 开环状态下,算法建议的基础率调整百分比大于此数值时,才会弹出更改建议。默认值为20% @@ -550,17 +524,12 @@ 输注大剂量向导结果的一部分[%] 大剂量向导执行计算,但只有这部分计算结果的胰岛素被输注。适用于SMB算法。 增加最大基础率,因为设置参数低于你配置文件中的最大基础率 - %1$s ISF: %2$.1f - %1$.0fg IC: %2$.1f - %1$.1fg IC: %2$.1f - %1$d%% 已选择: 单位 清除已完成 清除已启动 你想要重置已启动的目标? 你会失去已有的进度。 选择你想要的血糖显示单位。 - 是否复制这个配置文件的参数来创新一个新的配置文件? 血糖范围区域的下限值(仅显示,不影响算法) 血糖范围区域的上限值(仅显示,不影响算法) 输入的百分比无效 @@ -615,7 +584,6 @@ 图表菜单 清除筛选 输注导管 - 用户条目 \n选择您三餐的最大碳水值和最大胰岛素剂量\n 此项为选填信息,会附在反馈的崩溃报告中,以便我们在紧急情况下与您联系。 电子邮件地址 @@ -623,7 +591,6 @@ 如果你想得到应用程序重大缺陷的通知,你可以选择提供电子邮件地址、Facebook或Discord等信息。这不是一项自动化的服务。在可能存在危险时,开发人员才会联系您。 完全同步 完全同步数据? 这可能需要很长时间,在完成以前你将无法在NS中看到新数据。 - 充盈 同步 将用户配置,大剂量,碳水化合物,临时基础率的数据上传到NS网站 上传数据到NS网站 @@ -696,22 +663,9 @@ 未知操作命令: 百分比 应用程序预设 - 显示无效/已删除的记录 - 隐藏无效/已删除的记录 - 从 Nightscout 刷新 删除选中项? - 选择要删除的 - 配置文件更改 - 临时目标 - 碳水与大剂量 - 你确定要删除 %1$d 吗? - 当前暂无记录 - 隐藏闭环 - 显示闭环 已选中 %1$d 排序 - 显示闭环记录 - 隐藏闭环记录 闭环状态 图形缩放 配置文件 1 diff --git a/automation/src/main/res/values-nl-rNL/strings.xml b/automation/src/main/res/values-nl-rNL/strings.xml index 50803c38f9..a150d01cfa 100644 --- a/automation/src/main/res/values-nl-rNL/strings.xml +++ b/automation/src/main/res/values-nl-rNL/strings.xml @@ -121,4 +121,5 @@ Automatisering uitvoeren Regel toevoegen Verwijderen/sorteren + Stop met verwerken diff --git a/core/src/main/res/values-bg-rBG/strings.xml b/core/src/main/res/values-bg-rBG/strings.xml index 3a65f6b9a6..5aa99843f6 100644 --- a/core/src/main/res/values-bg-rBG/strings.xml +++ b/core/src/main/res/values-bg-rBG/strings.xml @@ -247,16 +247,6 @@ %1$dч:%2$dм Изключи за 5 минути - Формат на файла - Създаден на - Версия на AAPS - вариант - Име на пациента - Модел на телефона: - Криптиране - Нов формат - Нов формат (незащитен) - Непознат формат от преди %1$s от %1$s от преди по-малко от час diff --git a/core/src/main/res/values-ca-rES/strings.xml b/core/src/main/res/values-ca-rES/strings.xml index 33f85ff36b..1ef5270a5a 100644 --- a/core/src/main/res/values-ca-rES/strings.xml +++ b/core/src/main/res/values-ca-rES/strings.xml @@ -41,15 +41,6 @@ - Creat: - Versió d\'AAPS - Variant de compilació - Exportant nom del pacient del dispositiu - Exportant model del dispositiu - Encriptació d\'arxius - Format nou d\'encriptació - Nou format de debug (no encriptat) - Format d\'exportació desconegut Selecciona l\'arxiu a importar La configuració va ser creada amb una altra versió d\'AAPS (%1$s) i ara teniu la: %2$s.\n\nAlguns dels valors poden faltar o no ser vàlids - si us plau, comproveu la configuració després d\'importar. La configuració va ser creada en un altre dispositiu. No hi ha problema si esteu important des d\'un telèfon més antic/diferent però comproveu que la configuració importada és correcta! diff --git a/core/src/main/res/values-cs-rCZ/strings.xml b/core/src/main/res/values-cs-rCZ/strings.xml index 5da070c8d0..06388d2a06 100644 --- a/core/src/main/res/values-cs-rCZ/strings.xml +++ b/core/src/main/res/values-cs-rCZ/strings.xml @@ -276,16 +276,6 @@ %1$dh %2$dm Ztlumit na 5 minut - Formát souboru - Vytvořeno - Verze AAPS - Varianta sestavení - Jméno pacienta použité při exportu - Model zaříení použitý při exportu - Šifrování souboru - Nový zašifrovaný formát - Nový formát pro ladění (nešifrovaný) - Neznámý formát souboru exportováno před %1$s exportováno v %1$s exportováno před méně než hodinou diff --git a/core/src/main/res/values-da-rDK/strings.xml b/core/src/main/res/values-da-rDK/strings.xml index 5f20f52a94..f4c15c96cb 100644 --- a/core/src/main/res/values-da-rDK/strings.xml +++ b/core/src/main/res/values-da-rDK/strings.xml @@ -264,16 +264,6 @@ %1$dt %2$dm Lydløs i 5 minutter - Filformat - Oprettet den - AAPS Version - Build Variant - Eksporterer enhedens patientnavn - Eksporterer enhedsmodel - Filkryptering - Nyt krypteret format - Nyt debug format (ukrypteret) - Ukendt eksportformat eksporteret %1$s siden eksporteret ved %1$s eksporteret for mindre end time siden diff --git a/core/src/main/res/values-de-rDE/strings.xml b/core/src/main/res/values-de-rDE/strings.xml index cfa9dfc62b..e5c164936e 100644 --- a/core/src/main/res/values-de-rDE/strings.xml +++ b/core/src/main/res/values-de-rDE/strings.xml @@ -264,16 +264,6 @@ %1$dh %2$dm Stumm schalten für 5 Minuten - Dateiformat - Erstellt am - AAPS-Version - Build-Variante - Patientenname des exportierenden Geräts - Modell des exportierenden Geräts - Dateiverschlüsselung - Neues verschlüsseltes Format - Neues Debugformat (unverschlüsselt) - Unbekanntes Export-Format Vor %1$s Tagen exportiert am %1$s exportiert vor weniger als einer Stunde exportiert diff --git a/core/src/main/res/values-es-rES/strings.xml b/core/src/main/res/values-es-rES/strings.xml index 871cccd293..295a6d12b7 100644 --- a/core/src/main/res/values-es-rES/strings.xml +++ b/core/src/main/res/values-es-rES/strings.xml @@ -114,18 +114,41 @@ Añadir nuevo Añadir nuevo arriba Los datos proceden de una bomba diferente. Cambia el controlador de la bomba para resetear su estado. + BG + Calibración Ejecutar alarma en %1$d min El bolo reportó un error. Comprueba manualmente la cantidad real de insulina entregada + Recordatorio de bolo + Duración g Bomba parada Sin configurar Lazo suspendido + Flecha de tendencia + Auto sens + n/a + req + bajando rápido + bajando + bajando despacio + estable + subiendo lentamente + subiendo + subiendo rápido + ninguno + desconocido + alto + en rango + bajo + Promedio + TIR + Total TDD ]]> ELIMINAR ACTIVAR PERFIL reestablecer - Falta Cambio de Perfil. Haga un Cambio de Perfil o presione \"Activar perfil\" en PerfilLocal. - Perfil + Falta el Cambio de Perfil. Haga un Cambio de Perfil o presione \"Activar perfil\" en el PerfilLocal. + COB Limitando max basal rate a %1$.2f U/h debido a %2$s límite de la bomba @@ -253,16 +276,6 @@ %1$dhoras %2$dmin Silenciar por 5 minutos - Formato del archivo - Creado el - Versión de AAPS - Construir Variante - Exportar el nombre del paciente del dispositivo - Exportar modelo de dispositivo - Encriptación de archivos - Nuevo formato cifrado - Nuevo formato de depuración (sin cifrar) - Formato de exportación desconocido exportado hace %1$s exportado en %1$s exportado hace menos de una hora @@ -503,6 +516,7 @@ Se ha detectado otra ejecución de Autotune, ejecución cancelada La aplicación necesita permiso de bluetooth + Faltan permisos de SMS %1$d día %1$d días diff --git a/core/src/main/res/values-fr-rFR/strings.xml b/core/src/main/res/values-fr-rFR/strings.xml index a7b567525c..e7e5e98b64 100644 --- a/core/src/main/res/values-fr-rFR/strings.xml +++ b/core/src/main/res/values-fr-rFR/strings.xml @@ -149,6 +149,15 @@ réinitialiser ProfileSwitch manquant. S’il vous plaît faire un changement de profil ou appuyez sur « Activer le profil » dans le LocalProfile. Profil + Sélectionner pour suppression + Êtes-vous sûr de vouloir supprimer %1$d entrée(s) + Traitement + Créer un nouveau profil à partir de ce profil ? + Paramètres assistant + Delta 15 min + GA + IA Bolus + IA Basal Limiter le débit de basal max à %1$.2f U/h à cause de %2$s Limite de la pompe @@ -276,16 +285,6 @@ %1$dh%2$dm Muet pendant 5 minutes - Format de fichier - Créé le - Version d\'AAPS - Variante de Build - Export du nom du patient de l\'appareil - Export du modèle de l\'appareil - Cryptage du fichier - Nouveau format crypté - Nouveau format de débug (non crypté) - Format d\'export inconnu exporté il y a %1$s exporté à %1$s exporté il y a moins d\'une heure diff --git a/core/src/main/res/values-it-rIT/strings.xml b/core/src/main/res/values-it-rIT/strings.xml index 398c85c9d2..d19efcbefd 100644 --- a/core/src/main/res/values-it-rIT/strings.xml +++ b/core/src/main/res/values-it-rIT/strings.xml @@ -271,16 +271,6 @@ %1$dh %2$dm Muto per 5 minuti - Formato file - Creato: - Versione AAPS - Variante build - Esportazione nome dispositivo paziente - Esportazione modello dispositivo - Crittografia file - Nuovo formato crittografato - Nuovo formato di debug (non crittografato) - Formato esportazione sconosciuto esportato %1$s fa esportato: %1$s esportato meno di un\'ora fa diff --git a/core/src/main/res/values-iw-rIL/strings.xml b/core/src/main/res/values-iw-rIL/strings.xml index ab3a56cf1e..727cdd284f 100644 --- a/core/src/main/res/values-iw-rIL/strings.xml +++ b/core/src/main/res/values-iw-rIL/strings.xml @@ -244,16 +244,6 @@ %1$d ש\' %2$d דק\' השתקה ל-5 דקות - פורמט הקובץ - נוצר ב- - גרסת AAPS - גרסת בנייה - מייצא את שם מכשיר המטופל\\ת - מייצא את דגם המכשיר - הצפנת קבצים - פורמט הצפנה חדש - פורמט דיבאג חדש (בלתי מוצפן) - פורמט ייצוא לא ידוע יוצא לפני %1$s יוצא ב-%1$s יוצא לפני פחות משעה diff --git a/core/src/main/res/values-ko-rKR/strings.xml b/core/src/main/res/values-ko-rKR/strings.xml index 64f05cc43f..01c08ce12b 100644 --- a/core/src/main/res/values-ko-rKR/strings.xml +++ b/core/src/main/res/values-ko-rKR/strings.xml @@ -235,16 +235,6 @@ %1$d시 %2$d분 5분 동안 음소거 - 파일 형식 - 생성 일자 - AAPS 버전 - 다른 형식 빌드 - 장치의 환자 이름 내보내기 - 장치 모델 내보내기 - 파일 암호화 - 암호화된 새로운 형식 - 오류가 제거된 새로운 형식 (암호화되지 않음) - 알려지지 않은 내보내기 형식 %1$s 전에 내보내기 함 %1$s에 내보내기 함 내보내기 한지 1시간이 지나지 않았습니다. diff --git a/core/src/main/res/values-lt-rLT/strings.xml b/core/src/main/res/values-lt-rLT/strings.xml index 8a02fe8a0f..2317b22a6c 100644 --- a/core/src/main/res/values-lt-rLT/strings.xml +++ b/core/src/main/res/values-lt-rLT/strings.xml @@ -245,16 +245,6 @@ %1$dh %2$dm Nutildyti 5 minutėms - Failo formatas - Sukurta - AAPS versija - Versijos variantas - Eksportuojamas paciento vardas - Eksportuojamas prietaiso modelis - Failo šifravimas - Naujas šifruotas formatas - Naujas derinimo formatas (nešifruotas) - Nežinomas eksporto formatas eksportuota prieš %1$s eksportuota %1$s eksportuota mažiau nei prieš valandą diff --git a/core/src/main/res/values-nl-rNL/strings.xml b/core/src/main/res/values-nl-rNL/strings.xml index ac026009c6..23f325a72c 100644 --- a/core/src/main/res/values-nl-rNL/strings.xml +++ b/core/src/main/res/values-nl-rNL/strings.xml @@ -20,6 +20,7 @@ Verbinding verbroken Verbinding aan het verbreken Wachten op het loskoppelen + AAPS gestart %1$.1f E %1$.2f E %1$+.2f E @@ -30,6 +31,7 @@ %1$d minuten Pomp is bezig Pomp verbindingsstoring + Toegestane limiet bereikt Doelen Sluiten Even geduld a.u.b.… @@ -38,6 +40,7 @@ STOP INGEDRUKT Stop Koolhydraten + Ongeldig profiel! Geen profiel ingesteld ]]> Datum @@ -50,6 +53,7 @@ Duur van insuline activiteit Insuline - Koolhydraat ratio Insuline gevoeligheidsfactor + Basaalstand Bloedglucose doelwaarde Initialiseren... Serie nummer @@ -110,13 +114,18 @@ Voeg nieuw toe Voeg nieuw hierboven toe Data komt van een andere pomp. Wijzig de pomp driver om de pomp status te resetten. + BG + Kalibratie Start alarm over %1$d min Bolus fout geconstateerd. Controleer de daadwerkelijk toegediende hoeveelheid + Bolus herinnering + Tijdsduur g Pomp onderbreken Niet ingesteld Loop pauzeren Trendpijl + Autosens n/a nodig snel dalend @@ -131,12 +140,24 @@ hoog binnen bereik laag + Gemiddelde + TIR + TDD Totaal ]]> VERWIJDER Activeer profiel reset Profiel wissel ontbreekt. Doe aub een profiel wissel of duw op Activeer Profiel in het Lokale profiel. Profiel + Selecteer om te verwijderen + Weet je zeker dat je %1$d items wilt verwijderen + Behandeling + Nieuw profiel van dit profiel maken? + Wizard instellingen + 15min trend + COB + Bolus IOB + Basaal IOB Beperken van basaal tot max %1$.2f E/uur wegens de %2$s Pomp limiet @@ -163,6 +184,7 @@ PIN-codes komen niet overeen Basaalstanden niet ingesteld in hele uren: %1$s + Minimum basaalwaarde is vervangen door minimaal ondersteunde waarde: %1$s Basale waarde vervangen door maximale ondersteunde waarde: %1$s /E E/u @@ -243,6 +265,7 @@ Wachtend op resultaat SMB + %1$d g extra koolhydraten nodig binnen %2$d minuten Statistieken Cumulatieve TDD @@ -254,6 +277,7 @@ # Dagen Gewicht Mogelijks inaccuraat bij gebruik van bolussen om infusieset te vullen! + Data verouderd, druk op \"Vernieuwen\" Totaal basaal TBB * 2 @@ -261,16 +285,6 @@ %1$du %2$dm 5 minuten dempen - Bestandsformaat - Gemaakt op - AAPS versie - Build variant - Patiëntnaam van exporterend apparaat - Modelnaam/nr van exporterend apparaat - Bestandsversleuteling - Nieuwe versleutelde indeling - Nieuwe debug indeling (onversleuteld) - Onbekende export indeling %1$s geleden geëxporteerd geëxporteerd op %1$s minder dan een uur geleden geëxporteerd @@ -299,6 +313,7 @@ Versie %1$s is beschikbaar Versie %1$s verloopt op %2$s + Herstart je telefoon of herstart AndroidAPS vanuit de systeem instellingen a. u. b. \nanders zal AndroidAPS geen log mogelijkheid hebben (Dit is belangrijk om te controleren of de algoritmes correct werken)! M T @@ -379,6 +394,7 @@ EXPORTEER INSTELLINGEN IMPORT INSTELLINGEN RESET DATABASES + DATABASES OPSCHONEN EXPORTEER DATABASES IMPORT DATABASES OTP EXPORTEREN @@ -415,6 +431,7 @@ »%1$s« is buiten de harde limiet »%1$s« %2$.2f is buiten de harde limiet Basaal waarde + NSClient versie en AndroidAPS versie komen niet overeen. Update alsjeblieft. BOLUS %1$.2f E KOOLHYDRATEN %1$d gr @@ -502,8 +519,13 @@ Profiel %1$s bijwerken met Autotune Profiel? Profiel %1$s terugzetten met invoerprofiel? Profiel ongeldig + Autotune uitgevoerd zonder profiel wissel + Autotune uitgevoerd en profiel automatisch gewisseld Fout tijdens laatste Autotune uitvoeren + Een ander Autotune proces loopt nog, de uitvoering is geannuleerd + Applicatie heeft bluetooth toestemming nodig + Geen SMS bevoegdheid %1$d dag %1$d dagen diff --git a/core/src/main/res/values-no-rNO/strings.xml b/core/src/main/res/values-no-rNO/strings.xml index 342283ae1d..828da9a3c2 100644 --- a/core/src/main/res/values-no-rNO/strings.xml +++ b/core/src/main/res/values-no-rNO/strings.xml @@ -276,16 +276,6 @@ %1$dt %2$dm Demp i 5 minutter - Filformat - Opprettet den - AAPS versjon - Bygge variant - Eksporterer enhetens pasientnavn - Eksportere enhetsmodell - Fil kryptering - Nytt krypteringsformat - Nytt feilsøkingsformat (ukryptert) - Ukjent eksportformat eksportert for %1$s siden eksportert den %1$s eksportert for mindre enn time siden diff --git a/core/src/main/res/values-pl-rPL/strings.xml b/core/src/main/res/values-pl-rPL/strings.xml index 7756503eda..80f9eb6629 100644 --- a/core/src/main/res/values-pl-rPL/strings.xml +++ b/core/src/main/res/values-pl-rPL/strings.xml @@ -245,16 +245,6 @@ %1$dh %2$dm Wycisz na 5 minut - Format pliku - Data utworzenia - Wersja AAPS - Wariant kompilacji - Eksportowanie nazwy urządzenia pacjenta - Eksportowanie modelu urządzenia - Szyfrowanie pliku - Nowy zaszyfrowany format - Nowy format testowy (niezaszyfrowany) - Nieznany format eksportu wyeksportowano %1$s temu wyeksportowano w dniu %1$s wyeksportowano mniej niż godzinę temu diff --git a/core/src/main/res/values-pt-rBR/strings.xml b/core/src/main/res/values-pt-rBR/strings.xml index d5e22cbeae..cabc9b7715 100644 --- a/core/src/main/res/values-pt-rBR/strings.xml +++ b/core/src/main/res/values-pt-rBR/strings.xml @@ -196,15 +196,6 @@ Deteção de tempo - Criado em - Versão AAPS - Variante de Compilação - Exportando nome do paciente do dispositivo - Exportando modelo do dispositivo - Criptografia do arquivo - Novo formato de encriptação - Novo formato de depuração (não encriptado) - Formato de exportação desconhecido exportado %1$s atrás exportado há menos de uma hora Selecionar arquivo para importar diff --git a/core/src/main/res/values-pt-rPT/strings.xml b/core/src/main/res/values-pt-rPT/strings.xml index 323aa49380..178a69d7a0 100644 --- a/core/src/main/res/values-pt-rPT/strings.xml +++ b/core/src/main/res/values-pt-rPT/strings.xml @@ -231,16 +231,6 @@ %1$dh %2$dm Silenciar por 5 minutos - Formato do ficheiro - Criado em - Versão AAPS - Variante de Compilação - A exportar nome do paciente do dispositivo - A exportar modelo do dispositivo - Encriptação do Ficheiro - Novo formato de encriptação - Novo formato de depuração (não encriptado) - Formato de exportação desconhecido exportado há %1$s exportado às %1$s exportado há menos de uma hora diff --git a/core/src/main/res/values-ro-rRO/strings.xml b/core/src/main/res/values-ro-rRO/strings.xml index a7e65133eb..46acda25f6 100644 --- a/core/src/main/res/values-ro-rRO/strings.xml +++ b/core/src/main/res/values-ro-rRO/strings.xml @@ -246,16 +246,6 @@ %1$dh %2$dm Dezactivează pentru 5 minute - Format fișier - Creat la - Versiune AAPS - Versiune de build - Exporta numele dispozitivului pacientului - Exportarea modelului dispozitivului - Criptarea fișierului - Format nou criptat - Format nou pentru debug (necriptat) - Format de export necunoscut exportat cu %1$s în urmă exportat în data de %1$s exportat acum mai puțin de o ora diff --git a/core/src/main/res/values-ru-rRU/strings.xml b/core/src/main/res/values-ru-rRU/strings.xml index 459c82e51f..c489cbde41 100644 --- a/core/src/main/res/values-ru-rRU/strings.xml +++ b/core/src/main/res/values-ru-rRU/strings.xml @@ -275,16 +275,6 @@ %1$dч %2$dмин Отключить уведомления на 5 минут - Формат файла - Дата создания - Версия AAPS - Версия сборки - Имя пациента экспортируемого устройства - Модель экспортируемого устройства - Шифрование файла - Новый зашифрованный формат - Новый формат отладки (незашифрованный) - Неизвестный формат экспорта экспортировано %1$s назад экспортировано в %1$s экспортировано менее часа назад diff --git a/core/src/main/res/values-sk-rSK/strings.xml b/core/src/main/res/values-sk-rSK/strings.xml index 7f8eacf43c..51f35feda0 100644 --- a/core/src/main/res/values-sk-rSK/strings.xml +++ b/core/src/main/res/values-sk-rSK/strings.xml @@ -149,6 +149,15 @@ Resetovať Prepnutie profilu chýba. Vykonajte prepnutie profilu, alebo ho aktivujte na záložke lokálneho profilu. Profil + Vyberte pre odstránenie + Naozaj chcete odstrániť %1$d položiek + Ošetrenie + Vytvoriť z tohoto profilu nový profil? + Nastavenie sprievodcu + 15min trend + COB + Bolusový IOB + Bazálny IOB Max bazál obmedzený na %1$.2f JI/h: %2$s limit pumpy @@ -276,16 +285,6 @@ %1$dh %2$dm Stíšiť na 5 minút - Formát súboru - Vytvorené - Verzia AAPS - Verzia zostavy - Meno pacienta použité pri exporte - Model zariadenia použitý pri exporte - Šifrovanie súborov - Nový šifrovaný formát - Nový formát pre ladenie (nešifrovaný) - Neznámy formát exportu exportované pred %1$s exportované v %1$s exportované pred menej ako hodinou diff --git a/core/src/main/res/values-sv-rSE/strings.xml b/core/src/main/res/values-sv-rSE/strings.xml index 521ad3e814..25ebfe92d5 100644 --- a/core/src/main/res/values-sv-rSE/strings.xml +++ b/core/src/main/res/values-sv-rSE/strings.xml @@ -262,16 +262,6 @@ %1$dh %2$dm Tysta i 5 minuter - Filformat - Skapad - AAPS-version - Build-variant - Exporterar patientens namn - Exporterar enhetsmodell - · Filkryptering - Nytt krypterat format - Nytt debug-format (okrypterat) - Okänt exportformat exporterades för %1$s sedan exporterades %1$s exporterades för mindre än timme sedan diff --git a/core/src/main/res/values-tr-rTR/strings.xml b/core/src/main/res/values-tr-rTR/strings.xml index 12f5e9bcd2..3e0cd1ab48 100644 --- a/core/src/main/res/values-tr-rTR/strings.xml +++ b/core/src/main/res/values-tr-rTR/strings.xml @@ -275,16 +275,6 @@ %1$dsa %2$ddk 5 dakika sessize al - Dosya formatı - Oluşturuldu - AAPS Versiyonu - Yapı Varyantı - Cihaz hasta adını dışa aktarma - Cihaz modelini dışa aktarma - Dosya şifreleme - Yeni şifrelenmiş format - Yeni hata ayıklama formatı (şifrelenmemiş) - Bilinmeyen dışa aktarma formatı %1$s önce dışa aktarıldı %1$s\'de dışa aktarıldı bir süre önce dışa aktarıldı diff --git a/core/src/main/res/values-zh-rCN/strings.xml b/core/src/main/res/values-zh-rCN/strings.xml index d31f131164..3e706785bc 100644 --- a/core/src/main/res/values-zh-rCN/strings.xml +++ b/core/src/main/res/values-zh-rCN/strings.xml @@ -264,16 +264,6 @@ %1$dh %2$dm 静音 5 分钟 - 文件格式 - 创建于 - AAPS 版本 - 构建变体 - 导出设备的患者姓名 - 导出设备型号 - 文件加密密钥。 - 新的加密格式 - 新调试格式 (未加密) - 未知的导出格式 已导出 %1$s 导出 %1$s 不到 1 小时前更新过 diff --git a/implementation/src/main/res/values-es-rES/strings.xml b/implementation/src/main/res/values-es-rES/strings.xml index 7719ec803b..d804f74e57 100644 --- a/implementation/src/main/res/values-es-rES/strings.xml +++ b/implementation/src/main/res/values-es-rES/strings.xml @@ -1,7 +1,26 @@ + xDrip+ no se encuentra instalado + Calibración enviada a xDrip+ + BG + Faltan lecturas de glucosa + Hora de comer + Habilitar asistente de bolo + Asistente de bolo ¡Hora de comer!\nEjecutar el asistente de bolo y calcular de nuevo. Orden se esta efectuando en este momento Este dispositivo no parece soportar la optimización de la batería por medio de los ajustes - pueden ocurrir problemas de rendimiento. + Muy bajo + Bajo + Alto + Muy alto + Por debajo de + En rango + Por encima de + HbA1c: + Desviación estándar: %1$s + Datos detallados de 14 días + TIR Diurno + TIR Nocturno diff --git a/implementation/src/main/res/values-nl-rNL/strings.xml b/implementation/src/main/res/values-nl-rNL/strings.xml index 3bafc5ceb3..dcb09a9614 100644 --- a/implementation/src/main/res/values-nl-rNL/strings.xml +++ b/implementation/src/main/res/values-nl-rNL/strings.xml @@ -1,10 +1,36 @@ + xDrip+ niet geïnstalleerd + Kalibratie verzonden naar xDrip+ + BG Geen BG metingen + Tijd om te eten + Bolusadviseur inschakelen + Gebruik bij een hoge bloedglucose niet het resultaat van de wizard, maar een herinnering om later met eten te beginnen (\"pre-bolus\") + Bolusadviseur + Je hebt een hoge bloedglucose. In plaats van te eten, is het nu aan te raden om te wachten op een betere bloedglucose. Wil je nu een correctiebolus uitvoeren en je laten weten wanneer het tijd is om te eten? In dit geval worden er geen koolhydraten opgenomen en moet je de wizard opnieuw gebruiken wanneer we je er aan herinneren. Tijd om te bolussen!\nVoer de boluswizard uit en maak de berekening opnieuw. + Opdracht wordt nu uitgevoerd + Basaalwaarde onder minimum. Profiel niet ingesteld! Verzoek Toestemming + Voor een goede werking van %1$s moeten de accubesparingsopties zijn uitgeschakeld in de telefooninstellingen + Toepassing vereist systeemvenster machtiging voor meldingen + App heeft locatie toestemming nodig voor Bluetooth scan en WiFi identificatie + Applicatie heeft gegevens toestemming nodig om log bestanden op te slaan en instellingen te exporteren Fout bij het vragen van toestemming Dit apparaat lijkt geen ondersteuning te bieden voor whitelisten voor batterijoptimalisatie - u kunt prestatieproblemen ervaren. + Zeer laag + Laag + Hoog + Zeer hoog + Onder + Binnen bereik + Boven + HbA1c: + SD: %1$s + 14 dagen details + TIR overdag + TIR \'s nachts diff --git a/openhumans/src/main/res/values-nl-rNL/strings.xml b/openhumans/src/main/res/values-nl-rNL/strings.xml index 930035c759..9a35bba7e0 100644 --- a/openhumans/src/main/res/values-nl-rNL/strings.xml +++ b/openhumans/src/main/res/values-nl-rNL/strings.xml @@ -12,6 +12,7 @@ Alleen uploaden tijdens opladen Uploaden naar Open Humans… Open Humans notificaties + AndroidAPS is aan het uploaden naar Open Humans. Dit kan even duren. Je bent uitgelogd van Open Humans Klik hier om opnieuw in te loggen als dit niet opzettelijk was. Nu Uploaden diff --git a/plugins/src/main/res/values-bg-rBG/strings.xml b/plugins/src/main/res/values-bg-rBG/strings.xml index d276a8abf4..2e4e52d8d5 100644 --- a/plugins/src/main/res/values-bg-rBG/strings.xml +++ b/plugins/src/main/res/values-bg-rBG/strings.xml @@ -144,7 +144,6 @@ И / Въгл Чувств Цел - Клонирай БАЗА Рекалкулирани използвани данни diff --git a/plugins/src/main/res/values-ca-rES/strings.xml b/plugins/src/main/res/values-ca-rES/strings.xml index 603e077fda..31b82fbdca 100644 --- a/plugins/src/main/res/values-ca-rES/strings.xml +++ b/plugins/src/main/res/values-ca-rES/strings.xml @@ -129,7 +129,6 @@ IC ISF OBJ - Duplicar BAS Dades recalculades utilitzades diff --git a/plugins/src/main/res/values-cs-rCZ/strings.xml b/plugins/src/main/res/values-cs-rCZ/strings.xml index 9266a93bd0..d81c5f2647 100644 --- a/plugins/src/main/res/values-cs-rCZ/strings.xml +++ b/plugins/src/main/res/values-cs-rCZ/strings.xml @@ -175,7 +175,6 @@ I:C ISF CÍL - Klonovat BAZ Použita přepočítaná data diff --git a/plugins/src/main/res/values-da-rDK/strings.xml b/plugins/src/main/res/values-da-rDK/strings.xml index 41c4944b83..73f6cea44a 100644 --- a/plugins/src/main/res/values-da-rDK/strings.xml +++ b/plugins/src/main/res/values-da-rDK/strings.xml @@ -142,7 +142,6 @@ IC ISF MÅL - Klon BAS Genberegnede data anvendt diff --git a/plugins/src/main/res/values-de-rDE/strings.xml b/plugins/src/main/res/values-de-rDE/strings.xml index 5d04b7b769..3e7c523db3 100644 --- a/plugins/src/main/res/values-de-rDE/strings.xml +++ b/plugins/src/main/res/values-de-rDE/strings.xml @@ -140,7 +140,6 @@ IC ISF ZIEL - Klonen BAS Verwendete Daten neu berechnet diff --git a/plugins/src/main/res/values-es-rES/strings.xml b/plugins/src/main/res/values-es-rES/strings.xml index a476bdcd55..2726aebefb 100644 --- a/plugins/src/main/res/values-es-rES/strings.xml +++ b/plugins/src/main/res/values-es-rES/strings.xml @@ -130,7 +130,6 @@ IC ISF OBJ - Clonar BAS diff --git a/plugins/src/main/res/values-fr-rFR/strings.xml b/plugins/src/main/res/values-fr-rFR/strings.xml index 894ad77db2..751a5ed863 100644 --- a/plugins/src/main/res/values-fr-rFR/strings.xml +++ b/plugins/src/main/res/values-fr-rFR/strings.xml @@ -175,7 +175,6 @@ G/I SI CIBLE - Dupliquer BAS Données recalculées utilisées @@ -199,5 +198,5 @@ Pas encore terminé Temps écoulé - Mise en veille + Masquer diff --git a/plugins/src/main/res/values-it-rIT/strings.xml b/plugins/src/main/res/values-it-rIT/strings.xml index 73a23825f9..bbbf67018a 100644 --- a/plugins/src/main/res/values-it-rIT/strings.xml +++ b/plugins/src/main/res/values-it-rIT/strings.xml @@ -142,7 +142,6 @@ IC ISF TARG - Clona BAS Dati ricalcolati usati diff --git a/plugins/src/main/res/values-iw-rIL/strings.xml b/plugins/src/main/res/values-iw-rIL/strings.xml index be73bd89d0..40c3f0f521 100644 --- a/plugins/src/main/res/values-iw-rIL/strings.xml +++ b/plugins/src/main/res/values-iw-rIL/strings.xml @@ -140,7 +140,6 @@ IC ISF ע\' מטרה - שכפול בזאלי משתמש בנתונים מחושבים מחדש diff --git a/plugins/src/main/res/values-ko-rKR/strings.xml b/plugins/src/main/res/values-ko-rKR/strings.xml index 2fa839c8e3..3d4089e62d 100644 --- a/plugins/src/main/res/values-ko-rKR/strings.xml +++ b/plugins/src/main/res/values-ko-rKR/strings.xml @@ -121,7 +121,6 @@ IC ISF TARG - 복사 BAS diff --git a/plugins/src/main/res/values-lt-rLT/strings.xml b/plugins/src/main/res/values-lt-rLT/strings.xml index b4e397c32e..6f19eadd1b 100644 --- a/plugins/src/main/res/values-lt-rLT/strings.xml +++ b/plugins/src/main/res/values-lt-rLT/strings.xml @@ -133,7 +133,6 @@ IA JIF TIKSLAS - Klonuoti VB Naudojami perskaičiuoti duomenys diff --git a/plugins/src/main/res/values-nl-rNL/strings.xml b/plugins/src/main/res/values-nl-rNL/strings.xml index ac26eca325..979e1779f9 100644 --- a/plugins/src/main/res/values-nl-rNL/strings.xml +++ b/plugins/src/main/res/values-nl-rNL/strings.xml @@ -7,6 +7,7 @@ van de Authenticator-app voor: %1$s gevolgd door PIN Extra verplichte PIN aan einde van token Extra cijfers die je moet onthouden, en aan het eind van elk gegenereerd eenmalig wachtwoord moet toevoegen. + Authentificatie instellingen Te controleren code: OTP + PIN De verificatiecode bestaat uit 6 cijfers die worden afgebeeld door de Authenticator-app (bekend als OTP), gevolgd door 3 of meer cijfers van de verplichte PIN-code. @@ -18,12 +19,18 @@ Weet je zeker dat je het OTP-secret naar het klembord wilt kopiëren?\n\nJe hebt dit alleen nodig als je Authenticator-app problemen heeft met het scannen van QR-codes, als je het handmatig wilt invullen of als je een hardware OTP-token met een speciale app wilt configureren. OTP-secret (in Base32-formaat) is geëxporteerd en gekopieerd naar het klembord. Plak het in de Authenticator-app of de app van de hardware OTP-token! 1. Installeer Authenticator app + 2. Scan code om AndroidAPS OTP codes in te stellen 3. Test eenmalig wachtwoord (One Time Password) Reset Authentificatie Installeer de Authenticator-app op elke volger telefoon die RFC 6238 TOTP tokens ondersteunt. Populaire gratis apps zijn:\n • Authy\n • Google Authenticator\n • LastPass Authenticator\n • FreeOTP Authenticator + Door de authenticator opnieuw in te stellen maakt u alle reeds aangemaakte authenticatoren ongeldig. U moet ze opnieuw instellen! + Verkeerde code. Opdracht geannuleerd. + Time-out tijdens het wachten op het voltooien van de vorige pomp communicatie Gebruiker Geautoriseerde telefoon nummers +XXXXXXXXXX;+YYYYYYYYYY + Om een bolus van %1$.2fE te geven antwoord met de code %2$s + Om een maaltijd bolus van %1$.2fE te geven antwoord met de code %2$s Om tijdelijk streefdoel %1$s in te stellen antwoord met code %2$s Om tijdelijk streefdoel te annuleren antwoord met code %1$s Om de SMS Remote Service uit te zetten, antwoord met code %1$s. \n\nDenk er aan dat je deze alleen weer aan kunt zetten op de AAPS master smartphone. @@ -82,10 +89,18 @@ Ongeldige inhoud van het bericht Stuur SMS wanneer de pomp onbereikbaar is Melding pomp onbereikbaar + Verkeerde invoer + BG: + Laatste BG: Verschil: IOB: Bolus: Basaal: + %1$dmin geleden + Gepauzeerd (%1$d m) + Lezen van status mislukt + Profiel wissel aangemaakt + Tijdelijk basaal duur moet een veelvoud van %1$d minuten en groter dan 0 zijn. QR Code voor het instellen van een eenmalig wachtwoord DIA @@ -100,24 +115,54 @@ Piek Free-Peak Oref Snel-werkende Oref + Ultra-Rapid Oref DIA van %1$f te kort - %2$f wordt inplaats gebruikt! + Novorapid, Novolog, Humalog + Fiasp + xDrip+ Statuslijn (horloge) + xds Toon informatie over de Loop op jouw xDrip+ wijzerplaat. + Toon gedetailleerde IOB + Splits IOB in bolus en basaal op de watchface + Loop is uitgeschakeld + Toon BGI + Voeg BGI toe aan status lijn + xDrip+ Status (horloge) + Voeding + Toon de instellingen voor Voeding in Nightscout + Filter + Voeding + kJ + En + Prot + Vet Categorie Subcategorie + Bolus wizard + Kies donker, licht of volg het systeemthema + Kleurenschema + Donker thema + Licht thema + Gebruik systeem thema + Profiel LP Gebruik profiel(en) die je in AAPS aanmaakt en offline kunt gebruiken. nieuwe toevoegen aan lijst + Wilt u van profiel wisselen en gemaakte wijzigingen aan het huidige profiel negeren? + Huidige wijzigingen eerst opslaan of resetten + Huidige profiel verwijderen? Eenheden: Profielnaam ontbreekt Fout in IC waarden Fout in basaal waarden Fout in streefdoel Fout in ISF waarden + Profielnaam bevat punten.\nDit wordt niet ondersteund door NS.\nProfiel is niet geüpload naar NS. Ongeldig profiel %1$s niet geaccepteerd door NS Weergeven Foutmeldingen @@ -130,7 +175,6 @@ KH-ratio ISF DOEL - Dupliceren BAS Herberekende data gebruikt @@ -141,6 +185,7 @@ Omschakeling van zomer- of wintertijd in 24 uur of minder Omschakeling zomer/wintertijd minder dan 3 uur geleden - Gesloten Lus modus gedeactiveerd + Maak minstens %1$d MB vrij in interne opslag! Loop is uitgeschakeld! oude versie @@ -149,7 +194,9 @@ Nieuwe versie al zeker %1$d dagen beschikbaar! Terugval LGS na %2$d dagen, loop zal worden uitgeschakeld na %3$d dagen + Voltooid, goed gedaan! Nog niet voltooid Verstreken tijd + Sluimeren diff --git a/plugins/src/main/res/values-no-rNO/strings.xml b/plugins/src/main/res/values-no-rNO/strings.xml index db7a2ef5a3..f96f4f4781 100644 --- a/plugins/src/main/res/values-no-rNO/strings.xml +++ b/plugins/src/main/res/values-no-rNO/strings.xml @@ -156,7 +156,6 @@ IC ISF MÅL - Klon BAS Rekalkulerte siste data diff --git a/plugins/src/main/res/values-pl-rPL/strings.xml b/plugins/src/main/res/values-pl-rPL/strings.xml index d9bda04295..323d926d55 100644 --- a/plugins/src/main/res/values-pl-rPL/strings.xml +++ b/plugins/src/main/res/values-pl-rPL/strings.xml @@ -130,7 +130,6 @@ IC ISF CEL - Sklonuj BAS Użyto przeliczonych wartości diff --git a/plugins/src/main/res/values-pt-rBR/strings.xml b/plugins/src/main/res/values-pt-rBR/strings.xml index 7475e73739..64498d8f54 100644 --- a/plugins/src/main/res/values-pt-rBR/strings.xml +++ b/plugins/src/main/res/values-pt-rBR/strings.xml @@ -142,7 +142,6 @@ IC FSI ALV - Clonar BAS Dados recalculados foram utilizados diff --git a/plugins/src/main/res/values-pt-rPT/strings.xml b/plugins/src/main/res/values-pt-rPT/strings.xml index 4600636738..041334ec80 100644 --- a/plugins/src/main/res/values-pt-rPT/strings.xml +++ b/plugins/src/main/res/values-pt-rPT/strings.xml @@ -129,7 +129,6 @@ IHC FSI ALV - Clone BAS Dados utilizados foram recalculados diff --git a/plugins/src/main/res/values-ro-rRO/strings.xml b/plugins/src/main/res/values-ro-rRO/strings.xml index 36dbd89c90..18f24dabd9 100644 --- a/plugins/src/main/res/values-ro-rRO/strings.xml +++ b/plugins/src/main/res/values-ro-rRO/strings.xml @@ -130,7 +130,6 @@ IC ISF TARG - Clonează BZL Date recalculate utilizate diff --git a/plugins/src/main/res/values-ru-rRU/strings.xml b/plugins/src/main/res/values-ru-rRU/strings.xml index 9d48a6d4a6..bccf2d9f5d 100644 --- a/plugins/src/main/res/values-ru-rRU/strings.xml +++ b/plugins/src/main/res/values-ru-rRU/strings.xml @@ -119,6 +119,7 @@ Показать информацию о работе алгоритма ИПЖ на экране смарт-часов xDrip+. + Показать разбивку IOB на болюсный и базальный IOB на часах Фильтр Еда @@ -155,7 +156,6 @@ IC углкоэф ГУ/инс ISF (чувствительность к инсулину) ЦЕЛЬ - Клонировать БАЗАЛ Используются пересчитанные данные diff --git a/plugins/src/main/res/values-sk-rSK/strings.xml b/plugins/src/main/res/values-sk-rSK/strings.xml index eaae0c125e..bf3ad3f88a 100644 --- a/plugins/src/main/res/values-sk-rSK/strings.xml +++ b/plugins/src/main/res/values-sk-rSK/strings.xml @@ -175,7 +175,6 @@ I:C ISF CIEĽ - Klonovať BAZ Použité prepočítané dáta diff --git a/plugins/src/main/res/values-sv-rSE/strings.xml b/plugins/src/main/res/values-sv-rSE/strings.xml index d3b7868672..12494b8672 100644 --- a/plugins/src/main/res/values-sv-rSE/strings.xml +++ b/plugins/src/main/res/values-sv-rSE/strings.xml @@ -133,7 +133,6 @@ IC ISF Mål - Kopiera BAS Omräknad data används diff --git a/plugins/src/main/res/values-tr-rTR/strings.xml b/plugins/src/main/res/values-tr-rTR/strings.xml index 2d796117cd..9eade1550a 100644 --- a/plugins/src/main/res/values-tr-rTR/strings.xml +++ b/plugins/src/main/res/values-tr-rTR/strings.xml @@ -156,7 +156,6 @@ IC Karbonhidrat İnsülin Oranı IDF İnsülin Duyarlılık Faktörü HDF - Klon BAZ Kullanılan veriler yeniden hesaplandı diff --git a/plugins/src/main/res/values-zh-rCN/strings.xml b/plugins/src/main/res/values-zh-rCN/strings.xml index 1b5ddf76da..bf3e462e18 100644 --- a/plugins/src/main/res/values-zh-rCN/strings.xml +++ b/plugins/src/main/res/values-zh-rCN/strings.xml @@ -139,7 +139,6 @@ IC ISF TARG - 克隆 基础率 重新计算的数据 diff --git a/pump/eopatch/src/main/res/values-fr-rFR/strings.xml b/pump/eopatch/src/main/res/values-fr-rFR/strings.xml index bfa4b403c8..69d5792844 100644 --- a/pump/eopatch/src/main/res/values-fr-rFR/strings.xml +++ b/pump/eopatch/src/main/res/values-fr-rFR/strings.xml @@ -41,10 +41,11 @@ Annuler Erreur de communication pendant la suppression du Patch Pour la désactivation normale, appuyez sur «Réessayer».\nPour forcer la désactivation unilatéralement, appuyez sur «Supprimer». - Pour la désactivation normale, appuyez sur « Réessayer ». + Pour la désactivation normale, appuyez sur «Réessayer». Pour forcer la désactivation unilatéralement, appuyez sur «Supprimer». Désactiver manuellement l\'alarme du Patch Si le Patch est désactivé unilatéralement lors d\'une erreur de communication, le bip d\'alarme du patch peut ne pas s\'arrêter. + Dans ce cas, vous pouvez l\'arrêter complètement avec le trou de coupure d\'alarme sur le Patch comme décrit ci-dessous: 1. Retirez le patch de votre corps et décollez le ruban adhésif. 2. Utilisez un trombonne, enfoncez le dans le trou à côté du port de remplissage d\'insuline avec force. Remplissage de l\'insuline @@ -61,7 +62,24 @@ 3/6 Retirez le ruban adhésif, puis appuyez sur «Suivant». [Attention1] Si une aiguille s\'accroche, appuyez sur «Abandonner». + [Attention2] Si le patch est mouillé ou sale, ou que son ruban adhésif est plié, appuyez sur « Abandonner». + Coller le Patch 4/6 + Nettoyez et séchez le site d\'application, puis collez le patch sur la peau. + Vérifiez le site de la perfusion et appuyez sur «Démarrer la vérification de sécurité». + Démarrer la vérification de sécurité + Contrôle de sécurité… + 5/6 + Cela prend environ 30 secondes. + [Attention] Pour une utilisation sûre, n\'enlevez pas le cache de l\'Aiguille tant que le contrôle de sécurité n\'est pas terminé ! + Insertion de l\'aiguille + 6/6 + Faire pivoter le levier d\'action de l\'Aiguille de plus de 100° pour insérer l\'aiguille et ensuite faire pivoter complètement pour l\'enlever + Vérifiez s\'il y a 1 bip puis appuyez sur «Suivant». + Vérifiez s\'il y a 1 bip puis appuyez sur «Réessayer». + Activation du Patch terminée ! + Le programme \'%1$s\' a été activé. + Avertir lorsque le Patch approche de son heure d\'expiration.\nChangez l\'heure de rappel si nécessaire. Connection en cours Changement en cours Traitement en cours diff --git a/pump/eopatch/src/main/res/values-nl-rNL/strings.xml b/pump/eopatch/src/main/res/values-nl-rNL/strings.xml index 3ea04e700d..436c55e1dc 100644 --- a/pump/eopatch/src/main/res/values-nl-rNL/strings.xml +++ b/pump/eopatch/src/main/res/values-nl-rNL/strings.xml @@ -1,2 +1,134 @@ - + + EOPatch2 + EOP2 + Pomp integratie voor EOPatch2 / GlucoMen Day + Waarschuwingen + Laag reservoir waarschuwing + Patch houdbaarheid herinnering + Patch buzzer herinneringen + h:mm a + Bolus van %1$.2f E succesvol toegediend + BLE Status + Serienummer + Partijnummer + Ontwaak datum & tijd + Verlooptijd + Status + Basis basaalstand + Tijdelijke basaalstand + Totaal toegediend + Basaalstand in het profiel is minder dan 0,05 E/hr. EOPatch heeft een minimale injectie hoeveelheid van 0.5E p/u. Probeer het opnieuw na het instellen van het profiel op meer dan de minimale injectie eenheid. + Geen profiel geselecteerd. Selecteer een profiel en probeer het opnieuw. + dag + + + - + 30 min + 1 uur + 1 uur 30 min + 2 uur + \u0020 + Om naar nieuwe patch te wisselen moet de huidige patch verwijderd worden. Alle insuline toediening van Patch zal worden geannuleerd. + Het verwijderen van de patch is voltooid. + Patch is gedeactiveerd.\nVerwijder de patch.\nVerwijder de patch die op uw lichaam zit aangebracht. + Er wordt op dit. moment een bolus uitgevoerd. Weet je zeker dat je de insuline toediening wilt annuleren en de patch wilt verwijderen? + Er wordt op dit moment een bolus uitgevoerd. Weet je zeker dat je de insuline toediening wilt annuleren en de patch wilt verwijderen? + Er wordt op dit moment een bolus en een tijdelijk basaal uitgevoerd. Weet je zeker dat je de insuline toediening wilt annuleren en de patch wilt verwijderen? + Weet je zeker dat je een Patch wilt verwijderen? + Resterende insuline + Resterende tijd + Voltooien + Verwijder + Negeer Patch Communicatie fout tijdens het verwijderen + Voor normale deactivatie, druk op \'Opnieuw proberen\'.\nVoor unilaterale deactivering druk op \'Verwijderen\'. + Voor de normale deactivatie druk op \'Opnieuw proberen\'. + Voor unilaterale deactivering, Tik op \'Verwijderen\'. + Handmatig het alarm van Patch uitschakelen + Waneer unilateraal gedeactiveerd tijdens een communicatiefout, zal Patch mogelijk niet stoppen met piepen. + In dit geval kunt u dit volledig stopzetten door op de patch in de handmatige alarm poort te steken. Zoals hieronder aangegeven: + 1. Verwijder de Patch van je lichaam en verwijder de bevestigingstape. + 2. Gebruik een clip om krachtig in het gat naast de insuline vul poort te steken. + Insuline vullen + 1/6 + 1. + Vul een nieuwe patch met insuline op kamertemperatuur. Let op de hoek van de vul spuit. + 2. + Controleer op 1 piep. + Begin met koppelen + Patch koppelen + 2/6 + De nieuwe patch wordt gekoppeld.\nHoud de afstand tussen de patch en het slimme apparaat zo klein mogelijk + Bereid je voor om patch aan te brengen + 3/6 + Verwijder de plakker en druk op \'Volgende\'. + [Caution1] Als een naald uitsteekt tik dan op \'Verwijderen\'. + [Caution2] Als de Patch nat of vies is, of de applicatie tape gevouwen is, tik dan op \'Verwijderen\'. + Patch aanbrengen + 4/6 + Maak de applicatie plaats schoon en droog en breng de patch aan op de huid. + Controleer de infuusplek en druk vervolgens op \'Start veiligheidscontrole\'. + Start veiligheidscontrole + Veiligheidscontrole… + 5/6 + Het duurt ongeveer dertig seconden. + [Caution] Voor veilig gebruik, van de naald bedieningshendel afblijven en eerst de veiligheidscheck uitvoeren! + De naald inbrengen + 6/6 + Draai de naald bedieningshendel meer dan 100 ° om de naald in te brengen en draai daarna volledig om deze te verwijderen + Controleer op 1 piep en druk op \'Volgende\'. + Controleer op 1 piep en druk op \'Opnieuw proberen\'. + Patch activering voltooid! + Het programma \'%1$s\' is ingeschakeld. + Waarschuwt je wanneer de patch zijn einde houdbaarheid nadert.\nWijzig de herinneringstijd indien nodig. + Patch houdbaarheid Herinnering + Patch activatie herinnering + Patch activatie is niet afgerond.\n Doorgaan. + Patch communicatie check + Patch communicatie controleren… + Breng je \"smart device\" dichter bij de Patch. + Ga naar een andere locatie en probeer het opnieuw. + Communicatie Fout + Communicatie geslaagd + Verbonden met de Patch. + Koppeling annuleren + dagen +  E + Tot aan het uitstellen zal het leveren van de huidige Bolus & tijdelijk basaal worden geannuleerd. \n\nSnelheid : %1$s E/uur\nResterende tijd: %2$s\n& Insuline te gaan : %3$.2f E + Tot aan het uitstellen wordt de huidige geleverde bolus geannuleerd. \n\nInsuline om te gaan: %1$.2f E + Tijdens het uitstellen zal het momenteel afgeleverde tijdelijke basaal worden geannuleerd. \n\nRatio : %1$s E/uur\nResterende tijd: %2$s + Insuline toediening wordt uitgesteld. + Verwijder/wissel Patch + Activeer Patch + Patch verwijderen + Hervatten + Verwijder + Communicatie check + Onderbreken + Onderbroken + Wordt uitgevoerd + Annuleren + Bevestig + Alarm + Verbinden + Wijzigen + Verwerken + Opnieuw + [Caution] Verwijder de naaldop en plakkers NIET tot verdere instructies. + Weet je zeker dat je de huidige Patch wilt verwijderen? + Door onbevestigde bolus informatie, kan de bolus calculator niet gebruikt worden totdat %s.\n\nBen je er zeker van dat je de huidige patch wilt annuleren? + Naald inbreng fout. + Controleer of de richting van het gat links na het draaien van de hendel recht is en druk op \'Opnieuw proberen\'. + Druk op \'Verwijderen\' om de Patch te deactiveren. + Periode uitstel basaal + Insuline toediening hervatten + Uitstellen insuline is verlopen.\nDruk op \'Bevestigen\' om de insuline toediening te hervatten.\n\n[Caution]\nInsuline levering wordt niet hervat zolang je niet op \'Bevestigen\' klikt.\nAls je niet op \'Bevestigen\' klikt, kun je een ernstige hyper ontwikkelen. + Insuline toediening is uitgesteld. + Insulinetoediening is hervat. + Voltooien + resterende tijd: %1$s:%2$s + Volgende + Probeer opnieuw na patch communicatie controle. + Uitstellen mislukt. + Hervatten mislukt. + EEE d MMM, yyyy hh:mm a + diff --git a/ui/src/main/res/values-af-rZA/strings.xml b/ui/src/main/res/values-af-rZA/strings.xml index 146927d1d7..33df4da408 100644 --- a/ui/src/main/res/values-af-rZA/strings.xml +++ b/ui/src/main/res/values-af-rZA/strings.xml @@ -10,4 +10,6 @@ Statistiek + + diff --git a/ui/src/main/res/values-bg-rBG/strings.xml b/ui/src/main/res/values-bg-rBG/strings.xml index 675c7cb4bf..644eae90ce 100644 --- a/ui/src/main/res/values-bg-rBG/strings.xml +++ b/ui/src/main/res/values-bg-rBG/strings.xml @@ -20,4 +20,6 @@ Възраст Тегло + + diff --git a/ui/src/main/res/values-ca-rES/strings.xml b/ui/src/main/res/values-ca-rES/strings.xml index 51f873aaa6..59f9116b67 100644 --- a/ui/src/main/res/values-ca-rES/strings.xml +++ b/ui/src/main/res/values-ca-rES/strings.xml @@ -13,4 +13,6 @@ ID: Enviar + + diff --git a/ui/src/main/res/values-cs-rCZ/strings.xml b/ui/src/main/res/values-cs-rCZ/strings.xml index 90707a927b..c7c1278035 100644 --- a/ui/src/main/res/values-cs-rCZ/strings.xml +++ b/ui/src/main/res/values-cs-rCZ/strings.xml @@ -34,4 +34,6 @@ Jiné Glukoměr Senzor + + diff --git a/ui/src/main/res/values-da-rDK/strings.xml b/ui/src/main/res/values-da-rDK/strings.xml index 61399f9888..5630cccefd 100644 --- a/ui/src/main/res/values-da-rDK/strings.xml +++ b/ui/src/main/res/values-da-rDK/strings.xml @@ -20,4 +20,6 @@ Vægt Bemærk: Kun data synlige på denne skærm vil blive uploadet anonymt. ID tildeles til denne installation af AAPS. Du kan indsende data igen, hvis din hovedprofil bliver ændret, men lad det køre mindst en uge for at gøre resultatet synligt i tidsinterval. Din hjælp er værdsat. + + diff --git a/ui/src/main/res/values-de-rDE/strings.xml b/ui/src/main/res/values-de-rDE/strings.xml index 235d166cf0..35902ca1b4 100644 --- a/ui/src/main/res/values-de-rDE/strings.xml +++ b/ui/src/main/res/values-de-rDE/strings.xml @@ -18,4 +18,6 @@ Alter Gewicht + + diff --git a/ui/src/main/res/values-el-rGR/strings.xml b/ui/src/main/res/values-el-rGR/strings.xml index 9b26252640..f879c08682 100644 --- a/ui/src/main/res/values-el-rGR/strings.xml +++ b/ui/src/main/res/values-el-rGR/strings.xml @@ -10,4 +10,6 @@ Στατιστικά + + diff --git a/ui/src/main/res/values-es-rES/strings.xml b/ui/src/main/res/values-es-rES/strings.xml index 9b353d93d6..254c61f8e2 100644 --- a/ui/src/main/res/values-es-rES/strings.xml +++ b/ui/src/main/res/values-es-rES/strings.xml @@ -14,4 +14,39 @@ Nota: Sólo los datos visibles en esta pantalla se subirán de forma anónima. El ID es asignado a la instalación de AAPS. Puedes volver a enviar datos si cambias tu perfil principal, pero deja que se ejecute al menos durante una semana, para que el resultado del tiempo en rango sea visible. Agradecemos tu ayuda. + + %1$s ISF: %2$.1f + %1$.1fg IC: %2$.1f + %1$.0fg IC: %2$.1f + %1$d%% + Superbolo + Total + + No hay registros disponibles + Cálculo + IOB: + INVÁLIDO + Insulina: + Carbohidratos: + IOB total: + Duración: + Ins: + IOB: + IOB Total: + OT + Corrección + Comida + Objetivos temporales + Carbohidratos y bolos + Mostrar registros eliminados o invalidados + Ocultar registros eliminados o invalidados + Actualizar de Nightscout + Actualizar desde Nightscout + Mostrar invalidados + Ocultar invalidados + Eliminar registros de inicio de AAPS + Ocultar lazo + Mostrar lazo + Duplicar + Mostrar registros del lazo diff --git a/ui/src/main/res/values-fr-rFR/strings.xml b/ui/src/main/res/values-fr-rFR/strings.xml index 677d44ebc6..02322bb9fc 100644 --- a/ui/src/main/res/values-fr-rFR/strings.xml +++ b/ui/src/main/res/values-fr-rFR/strings.xml @@ -34,4 +34,45 @@ Autre Lecteur Capteur + + %1$s SI: %2$.1f + %1$.1fg G/I: %2$.1f + %1$.0fg G/I: %2$.1f + %1$d%% + Superbolus + Total + + Aucun enregistrement disponible + Calc + IA: + INVALIDE + Insuline: + Glucides: + IA Totale: + Activité IA Totale: + Dur: + Ratio: + Ins: + IA: + IA Totale: + CT + Corr. + Repas + Amorcer + Changements de profil + Cibles Temp + Glucides et bolus + Afficher les enregistrements invalidés / supprimés + Masquer les enregistrements invalidés / supprimés + Rafraîchir depuis Nightscout + Actualiser depuis NS + Montrer les entrées invalides + Masquer les entrées invalides + Suppr. entrées \"Démarrage AAPS\" + Masquer la boucle + Afficher les entrées boucle + Entrées utilisateur + Dupliquer + Afficher les entrées de la boucle + Masquer les entrées de la boucle diff --git a/ui/src/main/res/values-ga-rIE/strings.xml b/ui/src/main/res/values-ga-rIE/strings.xml index 80fe0368a0..a21b9a1524 100644 --- a/ui/src/main/res/values-ga-rIE/strings.xml +++ b/ui/src/main/res/values-ga-rIE/strings.xml @@ -4,4 +4,6 @@ + + diff --git a/ui/src/main/res/values-hr-rHR/strings.xml b/ui/src/main/res/values-hr-rHR/strings.xml index bdf8541ad6..d6d876a493 100644 --- a/ui/src/main/res/values-hr-rHR/strings.xml +++ b/ui/src/main/res/values-hr-rHR/strings.xml @@ -4,4 +4,6 @@ Napomena: Anonimno će se učitati samo podaci vidljivi na ovom zaslonu. ID je dodijeljen ovoj instalaciji AAPS-a. Možete ponovno poslati podatke ako se vaš glavni profil promijeni, ali pustite ga da radi barem tjedan dana kako bi rezultat bio vidljiv u određenom vremenskom rasponu. Cijenimo vašu pomoć. + + diff --git a/ui/src/main/res/values-hu-rHU/strings.xml b/ui/src/main/res/values-hu-rHU/strings.xml index 173f67cf6c..ecb30a96a4 100644 --- a/ui/src/main/res/values-hu-rHU/strings.xml +++ b/ui/src/main/res/values-hu-rHU/strings.xml @@ -5,4 +5,6 @@ Statisztikák Számítás folyamatban + + diff --git a/ui/src/main/res/values-it-rIT/strings.xml b/ui/src/main/res/values-it-rIT/strings.xml index 6042a03d26..45b9d76282 100644 --- a/ui/src/main/res/values-it-rIT/strings.xml +++ b/ui/src/main/res/values-it-rIT/strings.xml @@ -20,4 +20,6 @@ Peso Nota: solo i dati visibili su questa schermata verranno caricati (in modo anonimo). Un ID è assegnato a questa installazione di AAPS. Puoi inviare nuovamente i dati se il tuo profilo principale viene modificato, ma lascialo in esecuzione almeno per una settimana per rendere il risultato visibile nel time in range (TIR). Il tuo aiuto è apprezzato. + + diff --git a/ui/src/main/res/values-iw-rIL/strings.xml b/ui/src/main/res/values-iw-rIL/strings.xml index 45b0e2624e..d5977a6167 100644 --- a/ui/src/main/res/values-iw-rIL/strings.xml +++ b/ui/src/main/res/values-iw-rIL/strings.xml @@ -18,4 +18,6 @@ גיל משקל + + diff --git a/ui/src/main/res/values-ko-rKR/strings.xml b/ui/src/main/res/values-ko-rKR/strings.xml index 4b175cecfe..c4b9a76fd5 100644 --- a/ui/src/main/res/values-ko-rKR/strings.xml +++ b/ui/src/main/res/values-ko-rKR/strings.xml @@ -13,4 +13,6 @@ ID: 확인 + + diff --git a/ui/src/main/res/values-lt-rLT/strings.xml b/ui/src/main/res/values-lt-rLT/strings.xml index 75daf866db..482935a38d 100644 --- a/ui/src/main/res/values-lt-rLT/strings.xml +++ b/ui/src/main/res/values-lt-rLT/strings.xml @@ -17,4 +17,6 @@ Amžius Svoris + + diff --git a/ui/src/main/res/values-nl-rNL/strings.xml b/ui/src/main/res/values-nl-rNL/strings.xml index 72b84028c9..45146b3177 100644 --- a/ui/src/main/res/values-nl-rNL/strings.xml +++ b/ui/src/main/res/values-nl-rNL/strings.xml @@ -1,6 +1,10 @@ Geen actie geselecteerd, er zal niets uitgevoerd worden + Beperking toegepast! + Bolus limiet ingesteld + Koolhydraten beperking ingesteld + TT Dialoog geannuleerd Start inspanning TT Start binnenkort eten TT @@ -10,6 +14,65 @@ Herinner later te bolussen herinnering instellen + Configureer transparantie + AAPS widget + Activiteitsmonitor + Wil je de activiteitenstatistieken resetten? + Statistieken + Berekening wordt uitgevoerd + Ongeldige leeftijd ingevoerd + Ongeldige gewicht ingevoerd + ID: + Verzenden + Leeftijd + Gewicht + Meest voorkomende profiel: + Opmerking: Alleen gegevens die zichtbaar zijn op dit scherm worden anoniem geüpload. ID is toegewezen aan deze installatie van AAPS. U kunt gegevens opnieuw indienen als uw hoofdprofiel wordt gewijzigd, maar laat het ten minste een week draaien om resultaat zichtbaar te maken in de tijd in het bereik. Uw hulp wordt gewaardeerd. + Glucose type + Andere + Meter + Sensor + + %1$s ISF: %2$.1f + %1$.1fg IC: %2$.1f + %1$.0fg IC: %2$.1f + %1$d%% + Superbolus + Totaal + + Geen records beschikbaar + Calc + IOB: + Ongeldig + Insuline: + Koolhydraten: + Totale IOB: + Totale IOB activiteit: + Tijdsduur: + Ratio: + Ins: + IOB: + Totale IOB: + TT + Corr + Maaltijd + Vullen + Profiel wijzigingen + Tijdelijke streefdoelen + Koolhydraten en bolus + Toon ongeldig gemarkeerde / verwijderde records + Verberg ongeldig gemarkeerde / verwijderde records + Ververs vanaf Nightscout + Ververs van NS + Toon ongeldig + Verberg ongeldig + Verwijder AAPS is gestart items + Verberg loop + Toon loop + Gebruikersinvoer + Dupliceren + Toon loop records + Verberg loop records diff --git a/ui/src/main/res/values-no-rNO/strings.xml b/ui/src/main/res/values-no-rNO/strings.xml index 8b5fd87c8f..859ca8279b 100644 --- a/ui/src/main/res/values-no-rNO/strings.xml +++ b/ui/src/main/res/values-no-rNO/strings.xml @@ -25,4 +25,6 @@ Vekt Merk: Kun data synlig på denne skjermen vil bli anonymt lastet opp. ID er tilordnet denne installasjonen av AndroidAPS. Du kan sende inn data igjen hvis hovedprofilen din blir endret, men la den kjøre i minst en uke for å se effekten av resultatet i tidsperioden. Din hjelp blir verdsatt. + + diff --git a/ui/src/main/res/values-pl-rPL/strings.xml b/ui/src/main/res/values-pl-rPL/strings.xml index 045ff0c6a1..7be1ebb38f 100644 --- a/ui/src/main/res/values-pl-rPL/strings.xml +++ b/ui/src/main/res/values-pl-rPL/strings.xml @@ -16,4 +16,6 @@ Czas Waga + + diff --git a/ui/src/main/res/values-pt-rBR/strings.xml b/ui/src/main/res/values-pt-rBR/strings.xml index c86b6d3a2b..9fad612e0b 100644 --- a/ui/src/main/res/values-pt-rBR/strings.xml +++ b/ui/src/main/res/values-pt-rBR/strings.xml @@ -19,4 +19,6 @@ Peso Nota: Apenas os dados visíveis nesta tela serão enviados anonimamente. O ID é atribuído a esta instalação do AndroidAPS. Você pode enviar dados novamente se o perfil principal for alterado, mas deixe-o rodar pelo menos uma semana para tornar o resultado visível no intervalo de tempo. Sua ajuda é apreciada. + + diff --git a/ui/src/main/res/values-pt-rPT/strings.xml b/ui/src/main/res/values-pt-rPT/strings.xml index 78d682ec84..4f5e0cf288 100644 --- a/ui/src/main/res/values-pt-rPT/strings.xml +++ b/ui/src/main/res/values-pt-rPT/strings.xml @@ -14,4 +14,6 @@ ID: Enviar + + diff --git a/ui/src/main/res/values-ro-rRO/strings.xml b/ui/src/main/res/values-ro-rRO/strings.xml index 88375334d6..8b1e45e614 100644 --- a/ui/src/main/res/values-ro-rRO/strings.xml +++ b/ui/src/main/res/values-ro-rRO/strings.xml @@ -14,4 +14,6 @@ ID: Trimiteți + + diff --git a/ui/src/main/res/values-ru-rRU/strings.xml b/ui/src/main/res/values-ru-rRU/strings.xml index 02fc750a83..6c5d65ce39 100644 --- a/ui/src/main/res/values-ru-rRU/strings.xml +++ b/ui/src/main/res/values-ru-rRU/strings.xml @@ -25,4 +25,6 @@ Вес Примечание: Данные, видимые на этом экране, будут загружены анонимно. Для этой установки AAPS назначен идентификатор. Вы можете снова передать данные, если ваш основной профиль будет изменен, но пусть он работает по крайней мере в течение недели, чтобы результат был виден в динамике. Ваша помощь ценна. + + diff --git a/ui/src/main/res/values-sk-rSK/strings.xml b/ui/src/main/res/values-sk-rSK/strings.xml index 39f00c8623..0db43f44b9 100644 --- a/ui/src/main/res/values-sk-rSK/strings.xml +++ b/ui/src/main/res/values-sk-rSK/strings.xml @@ -34,4 +34,6 @@ Iné Glukomer Senzor + + diff --git a/ui/src/main/res/values-sr-rCS/strings.xml b/ui/src/main/res/values-sr-rCS/strings.xml index 5bce2c85f7..e92eaf702d 100644 --- a/ui/src/main/res/values-sr-rCS/strings.xml +++ b/ui/src/main/res/values-sr-rCS/strings.xml @@ -3,4 +3,6 @@ + + diff --git a/ui/src/main/res/values-sv-rSE/strings.xml b/ui/src/main/res/values-sv-rSE/strings.xml index 7a1fac12a5..691e1367db 100644 --- a/ui/src/main/res/values-sv-rSE/strings.xml +++ b/ui/src/main/res/values-sv-rSE/strings.xml @@ -17,4 +17,6 @@ Ålder Vikt + + diff --git a/ui/src/main/res/values-tr-rTR/strings.xml b/ui/src/main/res/values-tr-rTR/strings.xml index 06473b4d14..ae7f3c64b7 100644 --- a/ui/src/main/res/values-tr-rTR/strings.xml +++ b/ui/src/main/res/values-tr-rTR/strings.xml @@ -25,4 +25,6 @@ Ağırlık Not: Yalnızca bu ekranda görünen veriler anonim olarak yüklenecektir. Bu AAPS kurulumunda kimlik atanır. Ana profiliniz değişirse verileri tekrar gönderebilir, ancak sonuçların zaman içinde görünür olması için en az bir hafta çalışmasına izin verebilirsiniz. Yardımın takdire değer. + + diff --git a/ui/src/main/res/values-zh-rCN/strings.xml b/ui/src/main/res/values-zh-rCN/strings.xml index 57f4cc0412..474f775dec 100644 --- a/ui/src/main/res/values-zh-rCN/strings.xml +++ b/ui/src/main/res/values-zh-rCN/strings.xml @@ -18,4 +18,6 @@ 年龄 重量 + + From ed91df63410fe7d2d5a91984e81b9fcdd1b874c5 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Nov 2022 11:08:14 +0100 Subject: [PATCH 11/42] add interfaces -> shared dependency (ResourceHelper) --- .../rx}/events/EventRefreshButtonState.kt | 2 +- .../shared/impl/di/SharedImplModule.kt | 8 ++++++- .../impl}/sharedPreferences/Delegates.kt | 3 ++- .../sharedPreferences/SPImplementation.kt | 3 ++- .../info/nightscout/shared/di/SharedModule.kt | 10 --------- .../extensions/PackageManagerExtension.kt | 2 +- .../extensions/UIUtils.kt | 2 +- .../interfaces/ResourceHelper.kt | 2 +- .../{androidaps => shared}/utils/DateUtil.kt | 8 +++---- .../{androidaps => shared}/utils/T.kt | 2 +- .../info/nightscout/androidaps/MainApp.kt | 4 ++-- .../activities/HistoryBrowseActivity.kt | 8 +++---- .../activities/HistoryBrowserData.kt | 4 ++-- .../activities/MyPreferenceFragment.kt | 2 +- .../activities/ProfileHelperActivity.kt | 6 ++--- .../nightscout/androidaps/di/AppComponent.kt | 2 +- .../nightscout/androidaps/di/AppModule.kt | 4 ++-- .../androidaps/dialogs/ExtendedBolusDialog.kt | 2 +- .../androidaps/dialogs/FillDialog.kt | 2 +- .../androidaps/dialogs/InsulinDialog.kt | 6 ++--- .../androidaps/dialogs/LoopDialog.kt | 10 ++++----- .../androidaps/dialogs/NtpProgressDialog.kt | 2 +- .../androidaps/dialogs/ProfileSwitchDialog.kt | 6 ++--- .../androidaps/dialogs/TempBasalDialog.kt | 2 +- .../androidaps/dialogs/TempTargetDialog.kt | 2 +- .../androidaps/dialogs/TreatmentDialog.kt | 2 +- .../androidaps/dialogs/WizardDialog.kt | 8 +++---- .../androidaps/plugins/aps/OpenAPSFragment.kt | 4 ++-- .../plugins/aps/loop/LoopFragment.kt | 4 ++-- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 6 ++--- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 4 ++-- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 2 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 4 ++-- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 4 ++-- .../OpenAPSSMBDynamicISFPlugin.kt | 4 ++-- .../configBuilder/ConfigBuilderFragment.kt | 4 ++-- .../configBuilder/ConfigBuilderPlugin.kt | 2 +- .../configBuilder/ProfileFunctionImpl.kt | 6 ++--- .../configBuilder/RunningConfiguration.kt | 2 +- .../objectives/ObjectivesFragment.kt | 4 ++-- .../objectives/ObjectivesPlugin.kt | 2 +- .../activities/ObjectivesExamDialog.kt | 6 ++--- .../objectives/objectives/Objective.kt | 6 ++--- .../objectives/objectives/Objective10.kt | 2 +- .../objectives/objectives/Objective3.kt | 2 +- .../objectives/objectives/Objective5.kt | 2 +- .../objectives/objectives/Objective6.kt | 2 +- .../objectives/objectives/Objective7.kt | 2 +- .../objectives/objectives/Objective9.kt | 2 +- .../constraints/safety/SafetyPlugin.kt | 4 ++-- .../general/actions/ActionsFragment.kt | 6 ++--- .../plugins/general/actions/ActionsPlugin.kt | 2 +- .../dataBroadcaster/DataBroadcastPlugin.kt | 6 ++--- .../maintenance/ImportExportPrefsImpl.kt | 6 ++--- .../maintenance/MaintenanceFragment.kt | 4 ++-- .../general/maintenance/MaintenancePlugin.kt | 2 +- .../general/overview/OverviewFragment.kt | 8 +++---- .../plugins/general/overview/OverviewMenus.kt | 2 +- .../general/overview/OverviewPlugin.kt | 2 +- .../general/overview/StatusLightHandler.kt | 4 ++-- .../activities/QuickWizardListActivity.kt | 4 ++-- .../overview/dialogs/EditQuickWizardDialog.kt | 4 ++-- .../general/overview/graphData/GraphData.kt | 2 +- .../notifications/NotificationStore.kt | 4 ++-- .../notifications/NotificationWithAction.kt | 4 ++-- .../PersistentNotificationPlugin.kt | 2 +- .../plugins/general/wear/WearFragment.kt | 2 +- .../plugins/general/wear/WearPlugin.kt | 2 +- .../wear/wearintegration/DataHandlerMobile.kt | 6 ++--- .../DataLayerListenerServiceMobile.kt | 2 +- .../IobCobCalculatorPlugin.kt | 6 ++--- .../iob/iobCobCalculator/IobCobOref1Worker.kt | 6 ++--- .../iob/iobCobCalculator/IobCobOrefWorker.kt | 6 ++--- .../plugins/pump/PumpSyncImplementation.kt | 6 ++--- .../pump/virtual/VirtualPumpFragment.kt | 6 ++--- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 6 ++--- .../sensitivity/AbstractSensitivityPlugin.kt | 2 +- .../sensitivity/SensitivityAAPSPlugin.kt | 4 ++-- .../sensitivity/SensitivityOref1Plugin.kt | 4 ++-- .../SensitivityWeightedAveragePlugin.kt | 4 ++-- .../androidaps/plugins/source/AidexPlugin.kt | 2 +- .../plugins/source/BGSourceFragment.kt | 8 +++---- .../androidaps/plugins/source/DexcomPlugin.kt | 8 +++---- .../plugins/source/EversensePlugin.kt | 4 ++-- .../androidaps/plugins/source/GlimpPlugin.kt | 2 +- .../plugins/source/GlunovoPlugin.kt | 6 ++--- .../plugins/source/IntelligoPlugin.kt | 8 +++---- .../androidaps/plugins/source/MM640gPlugin.kt | 4 ++-- .../plugins/source/NSClientSourcePlugin.kt | 6 ++--- .../plugins/source/PoctechPlugin.kt | 2 +- .../plugins/source/RandomBgPlugin.kt | 4 ++-- .../androidaps/plugins/source/TomatoPlugin.kt | 2 +- .../androidaps/plugins/source/XdripPlugin.kt | 2 +- .../plugins/sync/nsShared/NSClientFragment.kt | 2 +- .../plugins/sync/nsShared/StoreDataForDb.kt | 2 +- .../nsShared/events/EventNSClientStatus.kt | 2 +- .../DataSyncSelectorImplementation.kt | 2 +- .../sync/nsclient/NSClientAddUpdateWorker.kt | 2 +- .../plugins/sync/nsclient/NSClientPlugin.kt | 2 +- .../sync/nsclient/NsClientReceiverDelegate.kt | 2 +- .../nsclient/data/NSDeviceStatusHandler.kt | 2 +- .../sync/nsclient/data/NSSettingsStatus.kt | 2 +- .../data/ProcessedDeviceStatusData.kt | 6 ++--- .../sync/nsclient/services/NSClientService.kt | 6 ++--- .../sync/nsclientV3/NSClientV3Plugin.kt | 6 ++--- .../EffectiveProfileSwitchExtension.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 4 ++-- .../sync/nsclientV3/workers/LoadBgWorker.kt | 2 +- .../workers/LoadDeviceStatusWorker.kt | 4 ++-- .../workers/LoadTreatmentsWorker.kt | 2 +- .../workers/ProcessTreatmentsWorker.kt | 2 +- .../plugins/sync/tidepool/TidepoolPlugin.kt | 4 ++-- .../sync/tidepool/comm/TidepoolUploader.kt | 6 ++--- .../plugins/sync/tidepool/comm/UploadChunk.kt | 4 ++-- .../sync/tidepool/elements/BasalElement.kt | 2 +- .../sync/tidepool/elements/BaseElement.kt | 2 +- .../tidepool/elements/BloodGlucoseElement.kt | 2 +- .../sync/tidepool/elements/BolusElement.kt | 2 +- .../sync/tidepool/elements/ProfileElement.kt | 2 +- .../tidepool/elements/SensorGlucoseElement.kt | 2 +- .../sync/tidepool/elements/WizardElement.kt | 2 +- .../messages/OpenDatasetRequestMessage.kt | 4 ++-- .../plugins/sync/tidepool/utils/RateLimit.kt | 4 ++-- .../androidaps/receivers/KeepAliveWorker.kt | 6 ++--- .../androidaps/setupwizard/SWDefinition.kt | 2 +- .../androidaps/setupwizard/SWScreen.kt | 2 +- .../elements/SWEditEncryptedPassword.kt | 2 +- .../androidaps/setupwizard/elements/SWItem.kt | 2 +- .../nightscout/androidaps/utils/SntpClient.kt | 1 + .../alertDialogs/PrefImportSummaryDialog.kt | 2 +- .../alertDialogs/TwoMessagesAlertDialog.kt | 2 +- .../NotificationHolderImpl.kt | 2 +- .../utils/extensions/DeviceStatusExtension.kt | 2 +- .../androidaps/utils/wizard/BolusWizard.kt | 6 ++--- .../utils/wizard/QuickWizardEntry.kt | 2 +- .../workflow/CalculationWorkflow.kt | 4 ++-- .../androidaps/workflow/LoadBgDataWorker.kt | 2 +- .../workflow/PrepareBasalDataWorker.kt | 2 +- .../workflow/PrepareBgDataWorker.kt | 2 +- .../workflow/PrepareBucketedDataWorker.kt | 2 +- .../PrepareIobAutosensGraphDataWorker.kt | 4 ++-- .../workflow/PreparePredictionsWorker.kt | 4 ++-- .../PrepareTemporaryTargetDataWorker.kt | 2 +- .../workflow/PrepareTreatmentsDataWorker.kt | 4 ++-- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../plugins/aps/loop/LoopPluginTest.kt | 4 ++-- .../configBuilder/ConfigBuilderPluginTest.kt | 2 +- .../objectives/ObjectivesPluginTest.kt | 4 ++-- .../maintenance/MaintenancePluginTest.kt | 2 +- .../pump/virtual/VirtualPumpPluginUTest.kt | 4 ++-- .../AbstractSensitivityPluginTest.kt | 2 +- .../plugins/source/GlimpPluginTest.kt | 2 +- .../plugins/source/MM640GPluginTest.kt | 2 +- .../plugins/source/NSClientPluginTest.kt | 2 +- .../plugins/source/XdripPluginTest.kt | 2 +- .../nsclient/NsClientReceiverDelegateTest.kt | 2 +- .../androidaps/utils/SntpClientTest.kt | 1 + .../utils/wizard/BolusWizardTest.kt | 4 ++-- .../nightscout/automation/AutomationEvent.kt | 4 ++-- .../automation/AutomationFragment.kt | 4 ++-- .../nightscout/automation/AutomationPlugin.kt | 6 ++--- .../nightscout/automation/actions/Action.kt | 2 +- .../automation/actions/ActionAlarm.kt | 2 +- .../actions/ActionCarePortalEvent.kt | 4 ++-- .../automation/actions/ActionLoopResume.kt | 2 +- .../automation/actions/ActionProfileSwitch.kt | 2 +- .../automation/actions/ActionRunAutotune.kt | 2 +- .../actions/ActionStartTempTarget.kt | 2 +- .../actions/ActionStopTempTarget.kt | 2 +- .../dialogs/ChooseOperationDialog.kt | 2 +- .../automation/dialogs/EditEventDialog.kt | 2 +- .../automation/elements/Comparator.kt | 2 +- .../automation/elements/ComparatorConnect.kt | 2 +- .../automation/elements/ComparatorExists.kt | 2 +- .../elements/InputCarePortalMenu.kt | 2 +- .../automation/elements/InputDateTime.kt | 4 ++-- .../automation/elements/InputDelta.kt | 2 +- .../automation/elements/InputDropdownMenu.kt | 2 +- .../automation/elements/InputLocationMode.kt | 2 +- .../automation/elements/InputProfileName.kt | 2 +- .../automation/elements/InputTime.kt | 4 ++-- .../automation/elements/InputTimeRange.kt | 4 ++-- .../automation/elements/LabelWithElement.kt | 2 +- .../automation/elements/StaticLabel.kt | 2 +- .../automation/services/LocationService.kt | 2 +- .../nightscout/automation/triggers/Trigger.kt | 4 ++-- .../automation/triggers/TriggerConnector.kt | 2 +- .../automation/triggers/TriggerTime.kt | 2 +- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../nightscout/androidaps/TestPumpPlugin.kt | 2 +- .../automation/AutomationEventTest.kt | 2 +- .../automation/actions/ActionAlarmTest.kt | 4 ++-- .../actions/ActionNotificationTest.kt | 2 +- .../automation/actions/ActionsTestBase.kt | 2 +- .../triggers/TriggerRecurringTimeTest.kt | 2 +- .../automation/triggers/TriggerTimeTest.kt | 2 +- .../DaggerAppCompatActivityWithResult.kt | 2 +- .../nightscout/androidaps/data/IobTotal.kt | 2 +- .../androidaps/data/ProfileSealed.kt | 6 ++--- .../androidaps/data/PumpEnactResultImpl.kt | 2 +- .../nightscout/androidaps/di/CoreModule.kt | 2 +- .../androidaps/dialogs/BolusProgressDialog.kt | 2 +- .../dialogs/DialogFragmentWithDate.kt | 4 ++-- .../androidaps/dialogs/ErrorDialog.kt | 2 +- .../androidaps/dialogs/ProfileViewerDialog.kt | 6 ++--- .../events/EventPreferenceChange.kt | 2 +- .../events/EventPumpStatusChanged.kt | 2 +- .../androidaps/events/EventStatus.kt | 2 +- .../androidaps/extensions/BlockExtension.kt | 4 ++-- .../BolusCalculatorResultExtension.kt | 2 +- .../androidaps/extensions/BolusExtension.kt | 2 +- .../extensions/EmptyRecyclerView.kt | 2 ++ .../extensions/ExtendedBolusExtension.kt | 4 ++-- .../extensions/GlucoseValueExtension.kt | 2 +- .../androidaps/extensions/HtmlString.kt | 2 +- .../androidaps/extensions/JSONObjectExt.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 4 ++-- .../extensions/PumpStateExtension.kt | 4 ++-- .../extensions/TemporaryBasalExtension.kt | 4 ++-- .../extensions/TemporaryTargetExtension.kt | 4 ++-- .../extensions/TotalDailyDoseExtension.kt | 4 ++-- .../androidaps/interfaces/PluginBase.kt | 1 + .../androidaps/interfaces/Profile.kt | 3 ++- .../androidaps/interfaces/ProfileStore.kt | 3 ++- .../androidaps/interfaces/PumpPluginBase.kt | 1 + .../androidaps/interfaces/stats/DexcomTIR.kt | 2 +- .../androidaps/interfaces/stats/TIR.kt | 4 ++-- .../androidaps/logging/UserEntryLogger.kt | 2 +- .../androidaps/plugins/aps/loop/APSResult.kt | 4 ++-- .../versionChecker/VersionCheckerUtils.kt | 6 ++--- .../maintenance/PrefFileListProvider.kt | 2 +- .../activities/PrefImportListActivity.kt | 2 +- .../formats/EncryptedPrefsFormat.kt | 2 +- .../plugins/general/overview/OverviewData.kt | 6 ++--- .../graphExtensions/BolusDataPoint.kt | 2 +- .../graphExtensions/CarbsDataPoint.kt | 2 +- .../EffectiveProfileSwitchDataPoint.kt | 4 ++-- .../graphExtensions/ExtendedBolusDataPoint.kt | 2 +- .../graphExtensions/GlucoseValueDataPoint.kt | 2 +- .../InMemoryGlucoseValueDataPoint.kt | 2 +- .../graphExtensions/TherapyEventDataPoint.kt | 2 +- .../iob/iobCobCalculator/AutosensDataStore.kt | 4 ++-- .../plugins/iob/iobCobCalculator/CobInfo.kt | 4 ++-- .../iobCobCalculator/GlucoseStatusProvider.kt | 2 +- .../iob/iobCobCalculator/data/AutosensData.kt | 4 ++-- .../plugins/pump/common/ble/BlePreCheck.kt | 2 +- .../bolusInfo/DetailedBolusInfoStorage.kt | 2 +- .../common/bolusInfo/TemporaryBasalStorage.kt | 2 +- .../plugins/pump/common/defs/PumpType.kt | 2 +- .../androidaps/queue/commands/Command.kt | 2 +- .../androidaps/services/AlarmSoundService.kt | 2 +- .../androidaps/utils/ActionModeHelper.kt | 2 +- .../androidaps/utils/DecimalFormatter.kt | 2 +- .../nightscout/androidaps/utils/HardLimits.kt | 2 +- .../nightscout/androidaps/utils/Translator.kt | 2 +- .../nightscout/androidaps/utils/WarnColors.kt | 2 +- .../androidaps/utils/alertDialogs/OKDialog.kt | 2 +- .../utils/alertDialogs/WarningDialog.kt | 2 +- .../utils/protection/BiometricCheck.kt | 2 +- .../utils/protection/ProtectionCheck.kt | 2 +- .../resources/ResourceHelperImplementation.kt | 2 +- .../androidaps/utils/ui/NumberPicker.kt | 2 +- .../androidaps/utils/ui/UIRunnable.kt | 2 +- .../androidaps/utils/ui/WeekdayPicker.kt | 2 +- .../userEntry/UserEntryPresentationHelper.kt | 4 ++-- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../androidaps/data/IobTotalTest.kt | 2 +- .../nightscout/androidaps/data/ProfileTest.kt | 4 ++-- .../extensions/BlockExtensionKtTest.kt | 2 +- .../VersionCheckerUtilsKtTest.kt | 4 ++-- .../formats/EncryptedPrefsFormatTest.kt | 2 +- .../iob/iobCalculator/GlucoseStatusTest.kt | 4 ++-- .../iobCobCalculator/AutosensDataStoreTest.kt | 4 ++-- .../androidaps/utils/DateUtilTest.kt | 4 +++- .../info/nightscout/androidaps/utils/TTest.kt | 1 + .../implementation/AndroidPermissionImpl.kt | 2 +- .../implementation/BolusTimerImpl.kt | 2 +- .../implementation/CarbTimerImpl.kt | 2 +- .../implementation/LocalAlertUtilsImpl.kt | 6 ++--- .../implementation/TrendCalculatorImpl.kt | 4 ++-- .../implementation/XDripBroadcastImpl.kt | 4 ++-- .../queue/CommandQueueImplementation.kt | 4 ++-- .../implementation/queue/QueueThread.kt | 4 ++-- .../queue/commands/CommandReadStatus.kt | 2 +- .../queue/commands/CommandSMBBolus.kt | 4 ++-- .../queue/commands/CommandSetProfile.kt | 2 +- .../stats/DexcomTirCalculatorImpl.kt | 6 ++--- .../implementation/stats/DexcomTirImpl.kt | 2 +- .../implementation/stats/TddCalculatorImpl.kt | 6 ++--- .../implementation/stats/TirCalculatorImpl.kt | 6 ++--- .../implementation/stats/TirImpl.kt | 4 ++-- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../implementation/BolusTimerImplTest.kt | 4 ++-- .../implementation/CarbTimerImplTest.kt | 4 ++-- .../queue/CommandQueueImplementationTest.kt | 4 ++-- .../pump/insight/InsightAlertService.java | 2 +- .../pump/insight/LocalInsightFragment.java | 4 ++-- .../pump/insight/LocalInsightPlugin.java | 6 ++--- .../plugins/pump/insight/utils/AlertUtils.kt | 2 +- interfaces/build.gradle | 6 +++++ .../general/openhumans/OpenHumansUploader.kt | 2 +- .../bgQualityCheck/BgQualityCheckPlugin.kt | 6 ++--- .../constraints/dstHelper/DstHelperPlugin.kt | 4 ++-- .../phoneChecker/PhoneCheckerPlugin.kt | 2 +- .../SignatureVerifierPlugin.kt | 2 +- .../storage/StorageConstraintPlugin.kt | 2 +- .../versionChecker/VersionCheckerPlugin.kt | 4 ++-- .../plugins/general/autotune/AutotuneFS.kt | 2 +- .../general/autotune/AutotuneFragment.kt | 8 +++---- .../plugins/general/autotune/AutotuneIob.kt | 4 ++-- .../general/autotune/AutotunePlugin.kt | 6 ++--- .../plugins/general/autotune/AutotunePrep.kt | 4 ++-- .../general/autotune/data/ATProfile.kt | 6 ++--- .../plugins/general/autotune/data/BGDatum.kt | 4 ++-- .../plugins/general/autotune/data/CRDatum.kt | 2 +- .../general/autotune/data/PreppedGlucose.kt | 2 +- .../plugins/general/food/FoodFragment.kt | 4 ++-- .../plugins/general/food/FoodPlugin.kt | 2 +- .../general/smsCommunicator/AuthRequest.kt | 6 ++--- .../SmsCommunicatorFragment.kt | 2 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 6 ++--- .../smsCommunicator/otp/OneTimePassword.kt | 4 ++-- .../general/themes/ThemeSwitcherPlugin.kt | 2 +- .../xdripStatusline/StatusLinePlugin.kt | 2 +- .../plugins/insulin/ActivityGraph.kt | 2 +- .../plugins/insulin/InsulinFragment.kt | 2 +- .../plugins/insulin/InsulinLyumjevPlugin.kt | 2 +- .../plugins/insulin/InsulinOrefBasePlugin.kt | 4 ++-- .../insulin/InsulinOrefFreePeakPlugin.kt | 2 +- .../insulin/InsulinOrefRapidActingPlugin.kt | 2 +- .../InsulinOrefUltraRapidActingPlugin.kt | 2 +- .../plugins/profile/ProfileFragment.kt | 6 ++--- .../plugins/profile/ProfilePlugin.kt | 4 ++-- .../nsclient/extensions/BolusExtension.kt | 2 +- .../nsclient/extensions/CarbsExtension.kt | 2 +- .../EffectiveProfileSwitchExtension.kt | 2 +- .../extensions/ExtendedBolusExtension.kt | 4 ++-- .../extensions/OfflineEventExtension.kt | 4 ++-- .../extensions/ProfileSwitchExtension.kt | 4 ++-- .../extensions/TemporaryBasalExtension.kt | 4 ++-- .../extensions/TemporaryTargetExtension.kt | 4 ++-- .../extensions/TherapyEventExtension.kt | 6 ++--- .../nightscout/plugins/ui/TimeListEdit.java | 2 +- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../BgQualityCheckPluginTest.kt | 6 ++--- .../dstHelper/DstHelperPluginTest.kt | 2 +- .../SignatureVerifierPluginTest.kt | 2 +- .../storage/StorageConstraintPluginTest.kt | 2 +- .../general/autotune/AutotuneCoreTest.kt | 4 ++-- .../general/autotune/AutotunePrepTest.kt | 4 ++-- .../smsCommunicator/AuthRequestTest.kt | 6 ++--- .../SmsCommunicatorPluginTest.kt | 4 ++-- .../insulin/InsulinLyumjevPluginTest.kt | 2 +- .../insulin/InsulinOrefBasePluginTest.kt | 2 +- .../insulin/InsulinOrefFreePeakPluginTest.kt | 2 +- .../InsulinOrefRapidActingPluginTest.kt | 2 +- .../InsulinOrefUltraRapidActingPluginTest.kt | 2 +- .../plugins/pump/combo/ComboFragment.kt | 6 ++--- .../plugins/pump/combo/ComboPlugin.java | 6 ++--- .../plugins/pump/combo/ComboPluginTest.kt | 4 ++-- .../androidaps/dana/DanaFragment.kt | 8 +++---- .../nightscout/androidaps/dana/DanaPump.kt | 4 ++-- .../dana/activities/DanaHistoryActivity.kt | 4 ++-- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../danaRKorean/DanaRKoreanPlugin.kt | 4 ++-- .../services/DanaRKoreanExecutionService.java | 6 ++--- .../androidaps/danaRv2/DanaRv2Plugin.java | 6 ++--- .../danaRv2/comm/MsgHistoryEventsV2.kt | 2 +- .../services/DanaRv2ExecutionService.java | 6 ++--- .../androidaps/danar/AbstractDanaRPlugin.java | 4 ++-- .../androidaps/danar/DanaRPlugin.java | 4 ++-- .../androidaps/danar/comm/MessageBase.kt | 4 ++-- .../androidaps/danar/comm/MsgHistoryAll.kt | 2 +- .../danar/comm/MsgStatusBolusExtended.kt | 2 +- .../danar/comm/MsgStatusTempBasal.kt | 2 +- .../AbstractDanaRExecutionService.java | 4 ++-- .../danar/services/DanaRExecutionService.java | 2 +- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../plugins/pump/danaR/comm/DanaRTestBase.kt | 4 ++-- .../danaR/comm/MsgStatusBolusExtendedTest.kt | 2 +- .../androidaps/danars/DanaRSPlugin.kt | 6 ++--- .../androidaps/danars/comm/DanaRSPacket.kt | 2 +- .../comm/DanaRSPacketAPSHistoryEvents.kt | 4 ++-- .../comm/DanaRSPacketBasalGetBasalRate.kt | 2 +- .../comm/DanaRSPacketBolusGetBolusOption.kt | 2 +- .../comm/DanaRSPacketBolusSetStepBolusStop.kt | 2 +- .../comm/DanaRSPacketGeneralGetPumpCheck.kt | 2 +- .../danars/comm/DanaRSPacketHistory.kt | 2 +- .../danars/comm/DanaRSPacketNotifyAlarm.kt | 2 +- .../DanaRSPacketNotifyDeliveryComplete.kt | 2 +- .../DanaRSPacketNotifyDeliveryRateDisplay.kt | 2 +- .../danars/dialogs/PairingProgressDialog.java | 2 +- .../androidaps/danars/services/BLEComm.kt | 6 ++--- .../danars/services/DanaRSService.kt | 6 ++--- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../androidaps/diaconn/DiaconnG8Fragment.kt | 6 ++--- .../androidaps/diaconn/DiaconnG8Plugin.kt | 6 ++--- .../androidaps/diaconn/DiaconnG8Pump.kt | 4 ++-- .../activities/DiaconnG8HistoryActivity.kt | 4 ++-- .../packet/BasalLimitInquireResponsePacket.kt | 2 +- .../BigAPSMainInfoInquireResponsePacket.kt | 2 +- .../packet/BigLogInquireResponsePacket.kt | 6 ++--- .../BigMainInfoInquireResponsePacket.kt | 2 +- .../diaconn/packet/DiaconnG8Packet.java | 2 +- .../IncarnationInquireResponsePacket.kt | 2 +- ...njectionExtendedBolusResultReportPacket.kt | 2 +- .../InjectionSnackResultReportPacket.kt | 2 +- .../packet/SerialNumInquireResponsePacket.kt | 2 +- .../diaconn/service/BLECommonService.kt | 2 +- .../diaconn/service/DiaconnG8Service.kt | 4 ++-- .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 6 ++--- .../pump/eopatch/alarm/AlarmManager.kt | 4 ++-- .../pump/eopatch/ble/PatchManager.java | 4 ++-- .../pump/eopatch/ui/dialogs/AlarmDialog.kt | 2 +- .../ui/viewmodel/EopatchOverviewViewModel.kt | 22 +++++++++---------- .../eopatch/ui/viewmodel/EopatchViewModel.kt | 2 +- .../pump/medtronic/MedtronicFragment.kt | 8 +++---- .../pump/medtronic/MedtronicPumpPlugin.kt | 6 ++--- .../comm/ui/MedtronicUIPostprocessor.kt | 2 +- .../medtronic/data/MedtronicHistoryData.kt | 2 +- .../data/dto/RLHistoryItemMedtronic.kt | 2 +- .../dialog/MedtronicHistoryActivity.kt | 2 +- .../medtronic/driver/MedtronicPumpStatus.kt | 2 +- .../pump/medtronic/util/MedtronicUtil.kt | 2 +- .../info/nightscout/androidaps/TestBase.kt | 2 +- .../common/fragment/ActionFragmentBase.kt | 2 +- .../common/fragment/WizardFragmentBase.kt | 2 +- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 6 ++--- .../dash/ui/DashPodManagementActivity.kt | 2 +- .../dash/ui/OmnipodDashOverviewFragment.kt | 4 ++-- .../action/DashInitializePodViewModel.kt | 2 +- .../action/DashInsertCannulaViewModel.kt | 2 +- .../plugins/pump/omnipod/dash/util/I8n.kt | 2 +- .../omnipod/eros/OmnipodErosPumpPlugin.java | 6 ++--- .../eros/data/RLHistoryItemOmnipod.java | 2 +- .../eros/manager/AapsOmnipodErosManager.java | 4 ++-- .../eros/ui/ErosPodHistoryActivity.java | 2 +- .../eros/ui/ErosPodManagementActivity.kt | 2 +- .../eros/ui/OmnipodErosOverviewFragment.kt | 4 ++-- .../omnipod/eros/util/AapsOmnipodUtil.java | 2 +- .../omnipod/eros/OmnipodErosPumpPluginTest.kt | 2 +- .../plugins/pump/common/PumpPluginAbstract.kt | 4 ++-- .../pump/common/ble/BondStateReceiver.kt | 2 +- .../pump/common/defs/PumpHistoryEntryGroup.kt | 2 +- .../driver/ble/PumpBLESelectorAbstract.kt | 2 +- .../common/driver/history/PumpHistoryEntry.kt | 2 +- .../pump/common/ui/PumpBLEConfigActivity.kt | 2 +- .../pump/common/ui/PumpHistoryActivity.kt | 2 +- .../plugins/pump/common/utils/StringUtil.java | 2 +- .../dialog/RileyLinkBLEConfigActivity.kt | 2 +- .../EventRileyLinkDeviceStatusChange.kt | 2 +- .../pump/common/hw/rileylink/ble/RFSpy.java | 2 +- .../ble/defs/RileyLinkEncodingType.java | 2 +- .../hw/rileylink/data/RLHistoryItem.java | 2 +- .../dialog/RileyLinkStatusGeneralFragment.kt | 4 ++-- .../dialog/RileyLinkStatusHistoryFragment.kt | 4 ++-- .../hw/rileylink/service/RileyLinkService.kt | 2 +- .../tasks/ResetRileyLinkConfigurationTask.kt | 2 +- .../service/tasks/WakeAndTuneTask.kt | 2 +- .../ui/activities/SurveyActivity.kt | 2 +- .../ui/activities/TDDStatsActivity.kt | 2 +- .../ui/activities/TreatmentsActivity.kt | 2 +- .../fragments/TreatmentsBolusCarbsFragment.kt | 8 +++---- .../fragments/TreatmentsCareportalFragment.kt | 8 +++---- .../TreatmentsExtendedBolusesFragment.kt | 8 +++---- .../TreatmentsProfileSwitchFragment.kt | 8 +++---- .../fragments/TreatmentsTempTargetFragment.kt | 8 +++---- .../TreatmentsTemporaryBasalsFragment.kt | 8 +++---- .../fragments/TreatmentsUserEntryFragment.kt | 8 +++---- .../ui/defaultProfile/DefaultProfile.kt | 2 +- .../ui/defaultProfile/DefaultProfileDPV.kt | 2 +- .../ui/dialogs/CalibrationDialog.kt | 2 +- .../info/nightscout/ui/dialogs/CarbsDialog.kt | 4 ++-- .../info/nightscout/ui/dialogs/CareDialog.kt | 4 ++-- .../nightscout/ui/dialogs/WizardInfoDialog.kt | 4 ++-- .../nightscout/ui/utils/ActivityMonitor.kt | 6 ++--- .../java/info/nightscout/ui/widget/Widget.kt | 6 ++--- .../androidaps/TestBaseWithProfile.kt | 4 ++-- .../nightscout/androidaps/di/WearModule.kt | 2 +- .../actions/QuickSnoozeActivity.kt | 2 +- .../interaction/utils/Inevitable.kt | 2 +- .../interaction/utils/Persistence.kt | 2 +- .../watchfaces/DigitalStyleWatchface.kt | 2 +- .../watchfaces/utils/BaseWatchFace.kt | 6 ++--- .../watchfaces/utils/BgGraphBuilder.kt | 2 +- .../info/nightscout/androidaps/TestBase.kt | 2 +- 486 files changed, 817 insertions(+), 802 deletions(-) rename {pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common => app-wear-shared/rx/src/main/java/info/nightscout/rx}/events/EventRefreshButtonState.kt (62%) rename app-wear-shared/{shared/src/main/java/info/nightscout/shared => shared-impl/src/main/java/info/nightcout/shared/impl}/sharedPreferences/Delegates.kt (96%) rename app-wear-shared/{shared/src/main/java/info/nightscout/shared => shared-impl/src/main/java/info/nightcout/shared/impl}/sharedPreferences/SPImplementation.kt (98%) rename app-wear-shared/shared/src/main/java/info/nightscout/{androidaps => shared}/extensions/PackageManagerExtension.kt (96%) rename app-wear-shared/shared/src/main/java/info/nightscout/{androidaps => shared}/extensions/UIUtils.kt (87%) rename app-wear-shared/shared/src/main/java/info/nightscout/{androidaps => shared}/interfaces/ResourceHelper.kt (97%) rename app-wear-shared/shared/src/main/java/info/nightscout/{androidaps => shared}/utils/DateUtil.kt (98%) rename app-wear-shared/shared/src/main/java/info/nightscout/{androidaps => shared}/utils/T.kt (95%) diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRefreshButtonState.kt b/app-wear-shared/rx/src/main/java/info/nightscout/rx/events/EventRefreshButtonState.kt similarity index 62% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRefreshButtonState.kt rename to app-wear-shared/rx/src/main/java/info/nightscout/rx/events/EventRefreshButtonState.kt index 401e40083f..109994ab2e 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRefreshButtonState.kt +++ b/app-wear-shared/rx/src/main/java/info/nightscout/rx/events/EventRefreshButtonState.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.common.events +package info.nightscout.rx.events import info.nightscout.rx.events.Event diff --git a/app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/di/SharedImplModule.kt b/app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/di/SharedImplModule.kt index 38f8b32239..01f092c1fb 100644 --- a/app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/di/SharedImplModule.kt +++ b/app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/di/SharedImplModule.kt @@ -1,5 +1,7 @@ -package info.nightscout.rx.di +package info.nightcout.shared.impl.di +import android.content.Context +import androidx.preference.PreferenceManager import dagger.Module import dagger.Provides import info.nightcout.shared.impl.logging.LImpl @@ -13,6 +15,10 @@ import javax.inject.Singleton ) open class SharedImplModule { + @Provides + @Singleton + fun provideSharedPreferences(context: Context): SP = info.nightcout.shared.impl.sharedPreferences.SPImplementation(PreferenceManager.getDefaultSharedPreferences(context), context) + @Provides @Singleton fun provideL(sp: SP): L = LImpl(sp) diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/shared/sharedPreferences/Delegates.kt b/app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/sharedPreferences/Delegates.kt similarity index 96% rename from app-wear-shared/shared/src/main/java/info/nightscout/shared/sharedPreferences/Delegates.kt rename to app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/sharedPreferences/Delegates.kt index a7f80f7128..9c88ce07d8 100644 --- a/app-wear-shared/shared/src/main/java/info/nightscout/shared/sharedPreferences/Delegates.kt +++ b/app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/sharedPreferences/Delegates.kt @@ -1,5 +1,6 @@ -package info.nightscout.shared.sharedPreferences +package info.nightcout.shared.impl.sharedPreferences +import info.nightscout.shared.sharedPreferences.SP import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/shared/sharedPreferences/SPImplementation.kt b/app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/sharedPreferences/SPImplementation.kt similarity index 98% rename from app-wear-shared/shared/src/main/java/info/nightscout/shared/sharedPreferences/SPImplementation.kt rename to app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/sharedPreferences/SPImplementation.kt index 71ebc4808c..6e1763a819 100644 --- a/app-wear-shared/shared/src/main/java/info/nightscout/shared/sharedPreferences/SPImplementation.kt +++ b/app-wear-shared/shared-impl/src/main/java/info/nightcout/shared/impl/sharedPreferences/SPImplementation.kt @@ -1,10 +1,11 @@ -package info.nightscout.shared.sharedPreferences +package info.nightcout.shared.impl.sharedPreferences import android.annotation.SuppressLint import android.content.Context import android.content.SharedPreferences import androidx.annotation.StringRes import info.nightscout.shared.SafeParse +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/shared/di/SharedModule.kt b/app-wear-shared/shared/src/main/java/info/nightscout/shared/di/SharedModule.kt index 51536f3d29..e5b7f70778 100644 --- a/app-wear-shared/shared/src/main/java/info/nightscout/shared/di/SharedModule.kt +++ b/app-wear-shared/shared/src/main/java/info/nightscout/shared/di/SharedModule.kt @@ -1,20 +1,10 @@ package info.nightscout.shared.di -import android.content.Context -import androidx.preference.PreferenceManager import dagger.Module -import dagger.Provides -import info.nightscout.shared.sharedPreferences.SP -import info.nightscout.shared.sharedPreferences.SPImplementation -import javax.inject.Singleton @Module( includes = [ ] ) open class SharedModule { - - @Provides - @Singleton - fun provideSharedPreferences(context: Context): SP = SPImplementation(PreferenceManager.getDefaultSharedPreferences(context), context) } \ No newline at end of file diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/extensions/PackageManagerExtension.kt b/app-wear-shared/shared/src/main/java/info/nightscout/shared/extensions/PackageManagerExtension.kt similarity index 96% rename from app-wear-shared/shared/src/main/java/info/nightscout/androidaps/extensions/PackageManagerExtension.kt rename to app-wear-shared/shared/src/main/java/info/nightscout/shared/extensions/PackageManagerExtension.kt index a1a37df5f3..003236cd9e 100644 --- a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/extensions/PackageManagerExtension.kt +++ b/app-wear-shared/shared/src/main/java/info/nightscout/shared/extensions/PackageManagerExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.shared.extensions import android.content.Intent import android.content.pm.PackageInfo diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/extensions/UIUtils.kt b/app-wear-shared/shared/src/main/java/info/nightscout/shared/extensions/UIUtils.kt similarity index 87% rename from app-wear-shared/shared/src/main/java/info/nightscout/androidaps/extensions/UIUtils.kt rename to app-wear-shared/shared/src/main/java/info/nightscout/shared/extensions/UIUtils.kt index 874ce798e6..431db3162c 100644 --- a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/extensions/UIUtils.kt +++ b/app-wear-shared/shared/src/main/java/info/nightscout/shared/extensions/UIUtils.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.shared.extensions import android.os.Handler import android.os.Looper diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/interfaces/ResourceHelper.kt b/app-wear-shared/shared/src/main/java/info/nightscout/shared/interfaces/ResourceHelper.kt similarity index 97% rename from app-wear-shared/shared/src/main/java/info/nightscout/androidaps/interfaces/ResourceHelper.kt rename to app-wear-shared/shared/src/main/java/info/nightscout/shared/interfaces/ResourceHelper.kt index b7371e967e..d17cda614e 100644 --- a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/interfaces/ResourceHelper.kt +++ b/app-wear-shared/shared/src/main/java/info/nightscout/shared/interfaces/ResourceHelper.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.shared.interfaces import android.content.Context import android.content.res.AssetFileDescriptor diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/utils/DateUtil.kt b/app-wear-shared/shared/src/main/java/info/nightscout/shared/utils/DateUtil.kt similarity index 98% rename from app-wear-shared/shared/src/main/java/info/nightscout/androidaps/utils/DateUtil.kt rename to app-wear-shared/shared/src/main/java/info/nightscout/shared/utils/DateUtil.kt index 64f169c193..1ed083888d 100644 --- a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/utils/DateUtil.kt +++ b/app-wear-shared/shared/src/main/java/info/nightscout/shared/utils/DateUtil.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.utils +package info.nightscout.shared.utils import android.content.Context import android.os.Build import androidx.annotation.RequiresApi import androidx.collection.LongSparseArray import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.R import info.nightscout.shared.SafeParse import org.apache.commons.lang3.time.DateUtils.isSameDay @@ -119,10 +119,10 @@ class DateUtil @Inject constructor(private val context: Context) { val beginOfToday = beginOfDay(now()) return if (mills < now()) // Past when { - mills > beginOfToday -> rh.gs(R.string.today) + mills > beginOfToday -> rh.gs(R.string.today) mills > beginOfToday - T.days(1).msecs() -> rh.gs(R.string.yesterday) mills > beginOfToday - T.days(7).msecs() -> dayAgo(mills, rh, true) - else -> day + else -> day } else // Future when { diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/utils/T.kt b/app-wear-shared/shared/src/main/java/info/nightscout/shared/utils/T.kt similarity index 95% rename from app-wear-shared/shared/src/main/java/info/nightscout/androidaps/utils/T.kt rename to app-wear-shared/shared/src/main/java/info/nightscout/shared/utils/T.kt index 6a0f540b28..d2dbe761f3 100644 --- a/app-wear-shared/shared/src/main/java/info/nightscout/androidaps/utils/T.kt +++ b/app-wear-shared/shared/src/main/java/info/nightscout/shared/utils/T.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.utils +package info.nightscout.shared.utils @Suppress("SpellCheckingInspection") class T(val time: Long = 0L) { diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 8669daa0d7..b3068cce38 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -28,7 +28,7 @@ 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.androidaps.interfaces.ResourceHelper +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 @@ -40,7 +40,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.ProcessLifecycleListener import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.plugins.general.themes.ThemeSwitcherPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt index 11df4a9bf5..e5e409fbe9 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt @@ -13,18 +13,18 @@ import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding -import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.androidaps.extensions.toVisibilityKeepSpace +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibilityKeepSpace import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.plugins.general.overview.OverviewMenus import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.workflow.CalculationWorkflow import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventAutosensCalculationFinished diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt index b434c87629..da614de8cd 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt @@ -4,10 +4,10 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.workflow.CalculationWorkflow 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 759c30d795..ed0f7f6242 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -27,7 +27,7 @@ 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.androidaps.interfaces.ResourceHelper +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 diff --git a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt index bbf79e13dd..f96c52231b 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt @@ -15,13 +15,13 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.databinding.ActivityProfilehelperBinding import info.nightscout.androidaps.dialogs.ProfileViewerDialog -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.stats.TddCalculator -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.plugins.profile.ProfilePlugin diff --git a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt index 7bf8b71f5c..e6789a9b8c 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt @@ -25,7 +25,7 @@ import info.nightscout.automation.di.AutomationModule import info.nightscout.implementation.di.ImplementationModule import info.nightscout.plugins.di.PluginsModule import info.nightscout.rx.di.RxModule -import info.nightscout.rx.di.SharedImplModule +import info.nightcout.shared.impl.di.SharedImplModule import info.nightscout.shared.di.SharedModule import info.nightscout.ui.di.UiModule import javax.inject.Singleton 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 df429cd091..e9d2a00a84 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -30,7 +30,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.SmsCommunicator import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.interfaces.XDripBroadcast @@ -47,7 +47,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorP 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.androidaps.utils.DateUtil +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 diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt index 5bc5f11a9c..fac792c765 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt @@ -17,7 +17,7 @@ import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.HtmlHelper diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index c6c27ae420..a92d423bb0 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -21,7 +21,7 @@ import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index 48d020b7d7..a4920b99eb 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogInsulinBinding import info.nightscout.androidaps.extensions.formatColor -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BolusTimer @@ -29,13 +29,13 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.toSignedString diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt index 2bf606bcc8..bc1bc5cb42 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -21,8 +21,8 @@ import info.nightscout.androidaps.database.transactions.CancelCurrentOfflineEven import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.androidaps.databinding.DialogLoopBinding import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.extensions.runOnUiThread -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.runOnUiThread +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue @@ -34,13 +34,13 @@ import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpDescription -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt index 13a753f17f..5336b64407 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.core.R import info.nightscout.androidaps.core.databinding.DialogBolusprogressBinding -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt index e92f10d54c..379d769d54 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt @@ -19,17 +19,17 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogProfileswitchBinding -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index d1589f1561..d7db5e0fee 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.HtmlHelper diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index 1bfd70b4a7..769fb7ed12 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -23,7 +23,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.interfaces.utils.HtmlHelper diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index 40a432fe52..aa0d2b94ba 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -22,7 +22,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index 36df01c9bb..2cf3e9cb6e 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -25,8 +25,8 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.databinding.DialogWizardBinding import info.nightscout.androidaps.extensions.formatColor -import info.nightscout.androidaps.extensions.runOnUiThread -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.runOnUiThread +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraint @@ -35,8 +35,8 @@ import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.HtmlHelper diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/OpenAPSFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/OpenAPSFragment.kt index 99d047eac1..335bb0eca1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/OpenAPSFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/OpenAPSFragment.kt @@ -16,10 +16,10 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.OpenapsFragmentBinding import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.JSONFormatter import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt index bc60f20f48..7eac530a47 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt @@ -16,10 +16,10 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.LoopFragmentBinding import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers 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 5a34e252df..f42529c2d7 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,7 +41,7 @@ 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.androidaps.interfaces.ResourceHelper +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 @@ -51,10 +51,10 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNo 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.buildDeviceStatus import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index 14797d64db..d09b6c367f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -18,14 +18,14 @@ 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.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.OpenAPSFragment import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index 825ae79077..3f2f6ff8f3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.androidaps.plugins.aps.loop.ScriptReader diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index 5d70de8377..fe6bae54a5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -20,14 +20,14 @@ 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.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.OpenAPSFragment import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler import info.nightscout.interfaces.aps.SMBDefaults diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index 4440c3467e..54be09e70a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -15,14 +15,14 @@ import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.TddCalculator import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.Round import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt index 1581f7ed59..3883b1ad57 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt @@ -11,11 +11,11 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt index ba1cd689fe..23335b1531 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt @@ -19,13 +19,13 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.activities.SingleFragmentActivity import info.nightscout.androidaps.databinding.ConfigbuilderFragmentBinding -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.protection.ProtectionCheck 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 c22ac4fbc5..d1f22fd2c3 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,7 @@ 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.androidaps.interfaces.ResourceHelper +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 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 cd028221c4..8b1c22c0fc 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,12 +12,12 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.fromConstant import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt index 4d1db04996..ceb1e700ce 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt @@ -6,7 +6,7 @@ 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.androidaps.interfaces.ResourceHelper +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt index b3999456ba..d178ac41d0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt @@ -23,14 +23,14 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.databinding.ObjectivesFragmentBinding import info.nightscout.androidaps.databinding.ObjectivesItemBinding import info.nightscout.androidaps.dialogs.NtpProgressDialog -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.ExamTask import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.setupwizard.events.EventSWUpdate -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.SntpClient 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 94e02b782f..f7b39ecb05 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,7 @@ 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.androidaps.interfaces.ResourceHelper +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt index b647ed53b0..fc917ae093 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/activities/ObjectivesExamDialog.kt @@ -7,13 +7,13 @@ import android.view.ViewGroup import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ObjectivesExamFragmentBinding -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.ExamTask import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.Option -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.rx.bus.RxBus import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.kt index 9929db80e8..830fb04c77 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.kt @@ -9,9 +9,9 @@ import androidx.annotation.StringRes import androidx.fragment.app.FragmentActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective10.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective10.kt index 2a41557913..efbbc91a97 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective10.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective10.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T class Objective10(injector: HasAndroidInjector) : Objective(injector, "auto", R.string.objectives_auto_objective, R.string.objectives_auto_gate) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt index 5a89f50ff9..36d6dc1e2b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective3.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import javax.inject.Inject @Suppress("SpellCheckingInspection") diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt index 8a5393fd5a..e570952c4a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import javax.inject.Inject @Suppress("SpellCheckingInspection") diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.kt index e15e5279a3..2999b02c49 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective6.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import javax.inject.Inject @Suppress("SpellCheckingInspection") diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.kt index 1f99b50164..57698d2fcb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective7.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T class Objective7(injector: HasAndroidInjector) : Objective(injector, "autosens", R.string.objectives_autosens_objective, R.string.objectives_autosens_gate) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective9.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective9.kt index df9bbccafe..9ea48b4bf9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective9.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective9.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T class Objective9(injector: HasAndroidInjector) : Objective(injector, "smb", R.string.objectives_smb_objective, R.string.objectives_smb_gate) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt index 7713151d85..58aea81850 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt @@ -19,7 +19,7 @@ import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpDescription -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.Safety import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin @@ -27,7 +27,7 @@ import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDyn import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.utils.Round diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index 9b1872ff3a..9a9f9d9db3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.dialogs.TempBasalDialog import info.nightscout.androidaps.dialogs.TempTargetDialog import info.nightscout.androidaps.extensions.toStringMedium import info.nightscout.androidaps.extensions.toStringShort -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BuildHelper @@ -33,13 +33,13 @@ import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.androidaps.plugins.general.overview.StatusLightHandler import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.skins.SkinProvider -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt index cf2f611875..62a3d26dd8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt @@ -6,7 +6,7 @@ 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.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject import javax.inject.Singleton 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 6a9e7a9307..4138355326 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,20 +7,20 @@ import android.os.Bundle import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.extensions.durationInMinutes -import info.nightscout.androidaps.extensions.safeQueryBroadcastReceivers +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.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.Config diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt index 94059fc847..c4d7ed5539 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt @@ -33,7 +33,7 @@ import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.ImportExportPrefs -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat import info.nightscout.interfaces.data.maintenance.PrefFileNotFoundError @@ -43,9 +43,9 @@ import info.nightscout.interfaces.data.maintenance.Prefs import info.nightscout.interfaces.data.maintenance.PrefsFormat import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey import info.nightscout.interfaces.data.maintenance.PrefsStatus -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.PrefImportSummaryDialog diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index 683922c9cd..b4688b4ec8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -16,13 +16,13 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.insight.database.InsightDatabase import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity import info.nightscout.androidaps.plugins.general.overview.OverviewData 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 418624b6d4..a2753670e1 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 @@ -12,7 +12,7 @@ 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.ResourceHelper +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.rx.logging.AAPSLogger 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 00f0059ae1..68e24c07ea 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,8 @@ 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.androidaps.extensions.runOnUiThread -import info.nightscout.androidaps.extensions.toVisibility +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 +59,7 @@ 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.androidaps.interfaces.ResourceHelper +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 @@ -80,7 +80,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt index 055f579deb..e32fef0f32 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.R import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview 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 fce3ed8ccd..6facf41961 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 @@ -18,7 +18,7 @@ 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.androidaps.interfaces.ResourceHelper +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt index 2ad816f816..c1ad2d89b3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt @@ -11,10 +11,10 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.WarnColors -import info.nightscout.androidaps.interfaces.ResourceHelper +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/general/overview/activities/QuickWizardListActivity.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt index f19fd18d94..9e0a4fdbf6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt @@ -18,11 +18,11 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.databinding.OverviewQuickwizardlistActivityBinding import info.nightscout.androidaps.databinding.OverviewQuickwizardlistItemBinding -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog import info.nightscout.androidaps.plugins.general.overview.events.EventQuickWizardChange import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.interfaces.dragHelpers.ItemTouchHelperAdapter diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt index 94287c7701..b89c07ec32 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt @@ -13,8 +13,8 @@ import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.OverviewEditquickwizardDialogBinding import info.nightscout.androidaps.plugins.general.overview.events.EventQuickWizardChange -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.selectedItemPosition import info.nightscout.androidaps.utils.extensions.setEnableForChildren import info.nightscout.androidaps.utils.extensions.setSelection diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt index 3c4355c26f..35e58e4ff0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt @@ -11,7 +11,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.graphExtensions.AreaGraphSeries import info.nightscout.androidaps.plugins.general.overview.graphExtensions.BolusDataPoint diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt index b30043ef3f..787d988091 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt @@ -17,10 +17,10 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt index 1aa1a7e0b1..2c8bd8c49a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.general.overview.notifications import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.interfaces.ResourceHelper +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.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index 6a46f13241..84476757f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -21,7 +21,7 @@ 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.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy 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 37f6193315..d2bf545ca9 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 @@ -7,7 +7,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt index ab221c3824..f0ebe5f9b7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.rx.events.EventOverviewBolusProgress 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 dbb01a3e57..93ce00d453 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,7 +33,7 @@ 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.androidaps.interfaces.ResourceHelper +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 @@ -41,12 +41,12 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.androidaps.utils.DateUtil +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.androidaps.utils.T +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt index da9390fddf..e8ddf0792e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt @@ -22,7 +22,7 @@ import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.wear.WearPlugin import info.nightscout.androidaps.plugins.general.wear.events.EventWearUpdateGui import info.nightscout.androidaps.receivers.ReceiverStatusStore diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index de64470006..fb9f250a26 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -27,14 +27,14 @@ 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.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.workflow.CalculationWorkflow import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt index b6fd44d7e2..a5913840a8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification @@ -24,11 +24,11 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCa import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.Profiler -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.workflow.CalculationWorkflow import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt index b5c4aadb42..0709de9bb7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt @@ -13,7 +13,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification @@ -22,11 +22,11 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCa import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.Profiler -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.workflow.CalculationWorkflow import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt index 07588f3cb0..808a6cda76 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt @@ -32,14 +32,14 @@ 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.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T 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/pump/virtual/VirtualPumpFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt index 102d588ffa..dd1af9d626 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt @@ -12,11 +12,11 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.virtual.events.EventVirtualPumpUpdateGui -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt index edf56a75ea..d7b24cabcb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -23,17 +23,17 @@ 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.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.InstanceId -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt index f7586edf4b..27233787dd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt index 2f3d6cd790..ebad2db295 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt @@ -7,12 +7,12 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt index 8e56dd9433..2c0164e4e8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt @@ -7,12 +7,12 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt index 91cfd402ce..7e5b9b2bf2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -8,12 +8,12 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription 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 41ff71caa2..d0bb5b6ac1 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 @@ -16,7 +16,7 @@ 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.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt index 61b5f1ee7e..e155dd9bd3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt @@ -25,17 +25,17 @@ 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.androidaps.extensions.toVisibility +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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus 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 989704f72d..c1a9c3bebb 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,20 +18,20 @@ 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.androidaps.extensions.safeGetInstalledPackages +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.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +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.sharedPreferences.SP 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 8b71e20ed0..712b1db606 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 @@ -15,10 +15,10 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP 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 c39c0a7628..5026cd4330 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 @@ -14,7 +14,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 c167a7b742..51ce38808d 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 @@ -17,12 +17,12 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP 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 1844253adf..4393861eec 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 @@ -15,17 +15,17 @@ 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.androidaps.extensions.safeGetInstalledPackages +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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP 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 0e4b508197..cad68c1ee8 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 @@ -13,10 +13,10 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt index 0fd10c3c76..bf803033aa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt @@ -12,14 +12,14 @@ 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.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +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 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 ab9da0a3eb..402e2d5f32 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 @@ -14,7 +14,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.rx.logging.AAPSLogger 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 2865dc34df..b94c25009b 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,10 +10,10 @@ 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.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.isRunningTest import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.PluginDescription 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 584d650b79..06bffd9096 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 @@ -13,7 +13,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 8f5e6eaabb..b2e19ed545 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 @@ -13,7 +13,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt index 83823bf94b..4e1f003f0e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/NSClientFragment.kt @@ -21,7 +21,7 @@ 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.androidaps.interfaces.ResourceHelper +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt index 3028832d48..fa139ebde4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/StoreDataForDb.kt @@ -40,7 +40,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotifi 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.notifications.Notification diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt index e83c862a99..0ed0d48916 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsShared/events/EventNSClientStatus.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.sync.nsShared.events import info.nightscout.androidaps.events.EventStatus import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper class EventNSClientStatus(var text: String, val version: NsClient.Version) : EventStatus() { override fun getStatus(rh: ResourceHelper): String = text diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt index 0fe20d456f..92c544d2f1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/DataSyncSelectorImplementation.kt @@ -21,7 +21,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.toJson import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt index be311e750f..336d7b3d7a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientAddUpdateWorker.kt @@ -15,7 +15,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.utils.JsonHelper diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt index 61a221f41f..7220ddc5c8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NSClientPlugin.kt @@ -17,7 +17,7 @@ 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.androidaps.interfaces.ResourceHelper +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt index 3f1e92b68e..418b146987 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegate.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.sync.nsclient import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventChargingState diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt index 8a18a1d423..321117d679 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.Config import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.JsonHelper diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt index a9686fff86..4665b6f477 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/NSSettingsStatus.kt @@ -6,7 +6,7 @@ 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.androidaps.interfaces.ResourceHelper +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt index 4f69f66db6..6af1385cf0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/data/ProcessedDeviceStatusData.kt @@ -3,10 +3,10 @@ package info.nightscout.androidaps.plugins.sync.nsclient.data import android.text.Spanned import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.APSResult -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt index ed2e809482..470a4162a5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclient/services/NSClientService.kt @@ -21,7 +21,7 @@ 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.androidaps.interfaces.ResourceHelper +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 @@ -44,9 +44,9 @@ import info.nightscout.androidaps.plugins.sync.nsclient.data.NSDeviceStatusHandl 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T.Companion.mins +import info.nightscout.shared.utils.T.Companion.mins import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.notifications.Notification diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 3aeed76751..a4218cb84c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -16,7 +16,7 @@ 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.androidaps.interfaces.ResourceHelper +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 @@ -30,9 +30,9 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt index a022d65380..2b97063c31 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.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.androidaps.utils.DateUtil +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt index 46652e8598..41f27cc3da 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -4,8 +4,8 @@ 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.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt index 070be71a8a..e9736e6939 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadBgWorker.kt @@ -15,7 +15,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt index 2f07cb139c..c4f528421a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.plugins.sync.nsShared.events.EventNSClientNewL 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.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import kotlinx.coroutines.runBlocking diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt index e7b98e3355..bf6f08a54e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -13,7 +13,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import kotlinx.coroutines.runBlocking diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt index e1c48c4eb7..d9448aa17d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt @@ -23,7 +23,7 @@ import info.nightscout.androidaps.plugins.sync.nsclientV3.extensions.toTemporary 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt index 74b342cb94..66bc129d46 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/TidepoolPlugin.kt @@ -9,7 +9,7 @@ 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.androidaps.interfaces.ResourceHelper +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 @@ -20,7 +20,7 @@ import info.nightscout.androidaps.plugins.sync.tidepool.events.EventTidepoolUpda import info.nightscout.androidaps.plugins.sync.tidepool.utils.RateLimit import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt index 54472b090a..4221589884 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/TidepoolUploader.kt @@ -6,15 +6,15 @@ import android.os.SystemClock import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt index 2085630b64..44cf474e28 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/comm/UploadChunk.kt @@ -15,8 +15,8 @@ import info.nightscout.androidaps.plugins.sync.tidepool.elements.SensorGlucoseEl 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.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T 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/elements/BasalElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt index f4efd137c9..a848e95566 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BasalElement.kt @@ -4,7 +4,7 @@ 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.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import java.util.* class BasalElement(tbr: TemporaryBasal, private val profile: Profile, dateUtil: DateUtil) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt index 59df1bec63..d761a2cf70 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BaseElement.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil open class BaseElement(timestamp: Long, uuid: String, dateUtil: DateUtil) { @Expose diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index e753a72906..7679dc39cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -4,7 +4,7 @@ import com.google.gson.annotations.Expose import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import java.util.* class BloodGlucoseElement(therapyEvent: TherapyEvent, dateUtil: DateUtil) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt index 436468e30a..0a3f0d1683 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/BolusElement.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import java.util.* class BolusElement(bolus: Bolus, dateUtil: DateUtil) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt index 96cc274dd4..827ff2ba65 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/ProfileElement.kt @@ -5,7 +5,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import java.util.* class ProfileElement(ps: EffectiveProfileSwitch, serialNumber: String, dateUtil: DateUtil) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt index 757a12ce39..250e08ce82 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/SensorGlucoseElement.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import java.util.* class SensorGlucoseElement(bgReading: GlucoseValue, private val dateUtil: DateUtil) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt index c2e1b724f5..af80c5b30a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/elements/WizardElement.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import java.util.* class WizardElement(carbs: Carbs, dateUtil: DateUtil) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt index 2de5434727..25e89a7883 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/messages/OpenDatasetRequestMessage.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.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.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import java.util.* class OpenDatasetRequestMessage(serialNumber: String, dateUtil: DateUtil) : BaseMessage() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt index 482c01797d..ab4fcdd0c9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sync/tidepool/utils/RateLimit.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.sync.tidepool.utils -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +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 javax.inject.Inject 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 6c5563fff4..d53dce1d33 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -22,13 +22,13 @@ 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.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.buildDeviceStatus import info.nightscout.interfaces.Config import info.nightscout.interfaces.LocalAlertUtils 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 da21e80294..8ec20dd32e 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -16,7 +16,7 @@ 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.androidaps.interfaces.ResourceHelper +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 diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWScreen.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWScreen.kt index bb82acec9a..d6c1d0b298 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWScreen.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWScreen.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.setupwizard import dagger.android.HasAndroidInjector import info.nightscout.androidaps.setupwizard.elements.SWItem -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditEncryptedPassword.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditEncryptedPassword.kt index 60886e0efc..5d9c5e71b6 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditEncryptedPassword.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditEncryptedPassword.kt @@ -11,7 +11,7 @@ import android.widget.LinearLayout import android.widget.TextView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.setupwizard.SWTextValidator import info.nightscout.androidaps.utils.CryptoUtil diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWItem.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWItem.kt index 9e703c1e52..1dcff122c5 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWItem.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWItem.kt @@ -8,7 +8,7 @@ import androidx.annotation.StringRes import androidx.appcompat.app.AppCompatActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/utils/SntpClient.kt b/app/src/main/java/info/nightscout/androidaps/utils/SntpClient.kt index 0499951dfd..475507b645 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/SntpClient.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/SntpClient.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.utils import android.os.SystemClock import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.utils.DateUtil import java.net.DatagramPacket import java.net.DatagramSocket import java.net.InetAddress diff --git a/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt b/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt index 22d28f496a..cf7146d777 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt @@ -18,7 +18,7 @@ import androidx.annotation.StyleRes import androidx.appcompat.view.ContextThemeWrapper import com.google.android.material.dialog.MaterialAlertDialogBuilder import info.nightscout.androidaps.R -import info.nightscout.androidaps.extensions.runOnUiThread +import info.nightscout.shared.extensions.runOnUiThread import info.nightscout.interfaces.data.maintenance.Prefs import info.nightscout.interfaces.data.maintenance.PrefsStatus import info.nightscout.androidaps.utils.ToastUtils diff --git a/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/TwoMessagesAlertDialog.kt b/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/TwoMessagesAlertDialog.kt index d4f2787538..320d358a49 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/TwoMessagesAlertDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/TwoMessagesAlertDialog.kt @@ -10,7 +10,7 @@ import android.widget.TextView import androidx.annotation.DrawableRes import com.google.android.material.dialog.MaterialAlertDialogBuilder import info.nightscout.androidaps.R -import info.nightscout.androidaps.extensions.runOnUiThread +import info.nightscout.shared.extensions.runOnUiThread object TwoMessagesAlertDialog { diff --git a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt index 0ac1a14f2a..2ec4057baf 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.core.R import info.nightscout.androidaps.interfaces.IconsProvider import info.nightscout.interfaces.NotificationHolder -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt b/app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt index ffc3ddc8ac..94abd15d4b 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/extensions/DeviceStatusExtension.kt @@ -8,7 +8,7 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun DeviceStatus.toJson(dateUtil: DateUtil): JSONObject = diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index af7cd0b09f..437c732f7e 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -32,15 +32,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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt index 732f37eece..e47af141cf 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper.safeGetInt import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/CalculationWorkflow.kt b/app/src/main/java/info/nightscout/androidaps/workflow/CalculationWorkflow.kt index 88de76bf7f..9adfdb307b 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/CalculationWorkflow.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/CalculationWorkflow.kt @@ -14,14 +14,14 @@ import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOref1Worker import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOrefWorker import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/LoadBgDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/LoadBgDataWorker.kt index 0e012a45f5..213b808af0 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/LoadBgDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/LoadBgDataWorker.kt @@ -8,7 +8,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBasalDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBasalDataWorker.kt index 909ea4929c..6f3c7c47fa 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBasalDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBasalDataWorker.kt @@ -11,7 +11,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.graphExtensions.ScaledDataPoint import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt index 7b27505a00..e801c228c8 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Point import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import java.util.ArrayList import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBucketedDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBucketedDataWorker.kt index b51cbfece8..7cf1837afe 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBucketedDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBucketedDataWorker.kt @@ -7,7 +7,7 @@ import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface import info.nightscout.androidaps.plugins.general.overview.graphExtensions.InMemoryGlucoseValueDataPoint diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt index e0bd34f1e3..5db55ebc88 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.OverviewMenus @@ -27,7 +27,7 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger 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 eb70bcc3e3..6d367d0943 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt @@ -8,7 +8,7 @@ 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.androidaps.interfaces.ResourceHelper +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 @@ -17,7 +17,7 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Point import info.nightscout.androidaps.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import java.util.Calendar diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt index 8de67bd294..dd2fca9b9b 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.receivers.DataWorkerStorage diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt index a210c90cbe..91ba8bcf23 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.graphExtensions.BolusDataPoint import info.nightscout.androidaps.plugins.general.overview.graphExtensions.CarbsDataPoint @@ -25,7 +25,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCa import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.Translator import info.nightscout.rx.bus.RxBus import javax.inject.Inject diff --git a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index d3aeee31d2..cb737bf581 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -12,8 +12,8 @@ import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus import org.json.JSONObject 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 8b46cc47a2..bc8df4dc93 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 @@ -16,12 +16,12 @@ 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.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt index 9fbac0640b..62079d1ca3 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt @@ -5,7 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt index da937f0aa9..68e78b4bc4 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt @@ -7,10 +7,10 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraint -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil 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 581d87d18c..c762397071 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,7 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.ResourceHelper +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.shared.sharedPreferences.SP diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt index ffef9af52b..660339d5f3 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt @@ -8,9 +8,9 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt index 3c16455548..e3aa72718d 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.interfaces.PluginDescription -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt index 065a7d0d7f..e1736d5c3e 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.source import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.ResourceHelper +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/MM640GPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt index 4c6a487343..eb92cb7f0c 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.source import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.ResourceHelper +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 86b83f649f..ff3f949df6 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,7 +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.androidaps.interfaces.ResourceHelper +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/XdripPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.kt index cc6e66c095..a3e87ff9b3 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/XdripPluginTest.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.source import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper 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/app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt index cd70af2694..f70a6aa7a1 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/sync/nsclient/NsClientReceiverDelegateTest.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.sync.nsclient import android.content.Context import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventChargingState diff --git a/app/src/test/java/info/nightscout/androidaps/utils/SntpClientTest.kt b/app/src/test/java/info/nightscout/androidaps/utils/SntpClientTest.kt index 04f0156e77..7ead71d03d 100644 --- a/app/src/test/java/info/nightscout/androidaps/utils/SntpClientTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/utils/SntpClientTest.kt @@ -1,6 +1,7 @@ package info.nightscout.androidaps.utils import info.nightscout.androidaps.TestBase +import info.nightscout.shared.utils.DateUtil import org.junit.Assert import org.junit.Test import org.mockito.Mock 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 e309afb5c4..1b10aacabe 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,11 +15,11 @@ 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.androidaps.interfaces.ResourceHelper +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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.bus.RxBus import org.junit.Assert import org.junit.Test diff --git a/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt b/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt index 3c431ebd34..3ad795dd31 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationEvent.kt @@ -1,8 +1,8 @@ package info.nightscout.automation import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionDummy import info.nightscout.automation.actions.ActionStopProcessing diff --git a/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt b/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt index ec5cb94394..0ce2afe3df 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt @@ -25,8 +25,8 @@ import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.FabricPrivacy diff --git a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt index d9f94c15ab..e4974b0eae 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt @@ -14,11 +14,11 @@ import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionAlarm import info.nightscout.automation.actions.ActionCarePortalEvent diff --git a/automation/src/main/java/info/nightscout/automation/actions/Action.kt b/automation/src/main/java/info/nightscout/automation/actions/Action.kt index d7c300a101..0981e487ce 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/Action.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/Action.kt @@ -3,7 +3,7 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.triggers.Trigger import info.nightscout.rx.logging.AAPSLogger diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt index 829315fbe9..c16a3662e1 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt @@ -6,7 +6,7 @@ import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.TimerUtil import info.nightscout.automation.R diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt index 876478db84..4a143b4f78 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt @@ -13,9 +13,9 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.automation.R import info.nightscout.automation.elements.InputCarePortalMenu import info.nightscout.automation.elements.InputDuration diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt index b72747d481..d7cf38427f 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.automation.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt index f65109c293..d556930ad1 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.InputProfileName diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt index aefccf54e7..ca2d1c1455 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Autotune import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt index d2a13544e6..ffc9af51db 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble import info.nightscout.automation.R diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt index d31a3644e0..48a6637cc3 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.automation.R import info.nightscout.rx.logging.LTag diff --git a/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt b/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt index bd56e331ce..632a853d30 100644 --- a/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt +++ b/automation/src/main/java/info/nightscout/automation/dialogs/ChooseOperationDialog.kt @@ -6,7 +6,7 @@ import android.view.View import android.view.ViewGroup import android.widget.RadioButton import info.nightscout.androidaps.dialogs.DialogFragmentWithDate -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.databinding.AutomationDialogChooseOperationBinding import info.nightscout.automation.triggers.TriggerConnector import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt b/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt index 1a27dd9821..72bcdfab9d 100644 --- a/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt +++ b/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt @@ -11,7 +11,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dialogs.DialogFragmentWithDate -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.automation.AutomationEvent diff --git a/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt b/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt index cfb63d1295..5ecd472a0c 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/Comparator.kt @@ -7,7 +7,7 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R class Comparator(private val rh: ResourceHelper) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt b/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt index bf638d1548..3627d455b0 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/ComparatorConnect.kt @@ -7,7 +7,7 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R class ComparatorConnect(private val rh: ResourceHelper) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt b/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt index 055ecc8e15..e3fca470da 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/ComparatorExists.kt @@ -7,7 +7,7 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R class ComparatorExists(private val rh: ResourceHelper, var value: Compare = Compare.EXISTS) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt b/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt index 8f18fbf49e..488e8e4b34 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt @@ -9,7 +9,7 @@ import android.widget.Spinner import androidx.annotation.DrawableRes import androidx.annotation.StringRes import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R class InputCarePortalMenu(private val rh: ResourceHelper) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt b/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt index 7fd3d9d3d6..b11f0d18f0 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputDateTime.kt @@ -12,8 +12,8 @@ import androidx.fragment.app.FragmentManager import com.google.android.material.datepicker.MaterialDatePicker import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.automation.R import java.util.Calendar diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt b/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt index 4115111e38..2fd2eb2a7f 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputDelta.kt @@ -7,7 +7,7 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.ui.NumberPicker import info.nightscout.automation.R import java.text.DecimalFormat diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt b/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt index f4faa23301..615a6346c0 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputDropdownMenu.kt @@ -6,7 +6,7 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R class InputDropdownMenu(private val rh: ResourceHelper) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt b/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt index 47f139f4c9..a165842004 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputLocationMode.kt @@ -7,7 +7,7 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.StringRes -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R class InputLocationMode(private val rh: ResourceHelper) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt b/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt index 47b17fe30e..6bb1108cc5 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputProfileName.kt @@ -7,7 +7,7 @@ import android.widget.ArrayAdapter import android.widget.LinearLayout import android.widget.Spinner import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R class InputProfileName(private val rh: ResourceHelper, private val activePlugin: ActivePlugin, val name: String = "", private val addActive: Boolean = false) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt b/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt index e494f6fca7..851d71b4ab 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt @@ -12,8 +12,8 @@ import androidx.fragment.app.FragmentManager import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.automation.R import java.util.Calendar diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt b/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt index 0f388e88b9..016fa92a05 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt @@ -13,8 +13,8 @@ import androidx.fragment.app.FragmentManager import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.automation.R import java.util.Calendar diff --git a/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt b/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt index 4d6b72d35b..fa73ca5dc3 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/LabelWithElement.kt @@ -4,7 +4,7 @@ import android.graphics.Typeface import android.view.Gravity import android.widget.LinearLayout import android.widget.TextView -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper class LabelWithElement( private val rh: ResourceHelper, diff --git a/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt b/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt index 03455053e4..530640d537 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/StaticLabel.kt @@ -4,7 +4,7 @@ import android.graphics.Typeface import android.view.ViewGroup import android.widget.LinearLayout import android.widget.TextView -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R import info.nightscout.automation.triggers.Trigger diff --git a/automation/src/main/java/info/nightscout/automation/services/LocationService.kt b/automation/src/main/java/info/nightscout/automation/services/LocationService.kt index bc0605515e..21f6b21732 100644 --- a/automation/src/main/java/info/nightscout/automation/services/LocationService.kt +++ b/automation/src/main/java/info/nightscout/automation/services/LocationService.kt @@ -18,7 +18,7 @@ import com.google.android.gms.location.LocationServices import dagger.android.DaggerService import info.nightscout.interfaces.NotificationHolder import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.automation.R import info.nightscout.automation.events.EventLocationChange import info.nightscout.rx.AapsSchedulers diff --git a/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt b/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt index 36a6344d42..37c1f23d67 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt @@ -13,9 +13,9 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.automation.R import info.nightscout.automation.dialogs.ChooseTriggerDialog import info.nightscout.automation.events.EventTriggerChanged diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt index b530e73e4c..7753a38fa8 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerConnector.kt @@ -9,7 +9,7 @@ import android.widget.TextView import androidx.annotation.StringRes import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.androidaps.utils.ui.VerticalTextView import info.nightscout.automation.R diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt index d3fd18ad13..68d10e1118 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTime.kt @@ -4,7 +4,7 @@ import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.automation.R import info.nightscout.automation.elements.InputDateTime import info.nightscout.automation.elements.LayoutBuilder diff --git a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index edb91245cc..85a097a29c 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -10,8 +10,8 @@ import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus diff --git a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index cf100ba22f..1680787d1b 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType diff --git a/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt b/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt index bcaecd4d82..091c95c61e 100644 --- a/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt +++ b/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt @@ -5,7 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionLoopEnable import info.nightscout.automation.actions.ActionStopProcessing diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt index 4c1eba61e9..a734eed337 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt @@ -5,9 +5,9 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.TimerUtil import info.nightscout.automation.R import info.nightscout.automation.elements.InputString diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt index 820f30ae6a..1b6c5f3c11 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.database.transactions.Transaction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.automation.elements.InputString diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index 1f7066c548..8be9dca969 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -16,7 +16,7 @@ import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileSource -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.SmsCommunicator import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.triggers.Trigger diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerRecurringTimeTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerRecurringTimeTest.kt index 420886e011..94ae1bc1ec 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerRecurringTimeTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerRecurringTimeTest.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.triggers import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import org.json.JSONObject import org.junit.Assert import org.junit.Before diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt index f5c01adea5..bdab5ffc22 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import org.json.JSONException import org.json.JSONObject import org.junit.Assert diff --git a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt b/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt index 80fc72fe81..6e1c050b97 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt @@ -7,7 +7,7 @@ import androidx.core.app.ActivityCompat import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.core.R import info.nightscout.androidaps.interfaces.ImportExportPrefs -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.interfaces.permissions.OptimizationPermissionContract diff --git a/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt b/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt index 609ae15925..3e8c0c383c 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt +++ b/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.data import android.content.Context import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.Round import org.json.JSONException import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt b/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt index b6b8cd4216..3aaaee0120 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt +++ b/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt @@ -20,12 +20,12 @@ import info.nightscout.androidaps.interfaces.Profile.Companion.secondsFromMidnig import info.nightscout.androidaps.interfaces.Profile.Companion.toMgdl import info.nightscout.androidaps.interfaces.Profile.ProfileValue import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import org.json.JSONArray import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt b/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt index 30e5f2f034..eed77b2044 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt +++ b/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.data import dagger.android.HasAndroidInjector import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.interfaces.utils.Round import info.nightscout.interfaces.data.PumpEnactResult diff --git a/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt b/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt index 52b08039e3..7609530279 100644 --- a/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt +++ b/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt @@ -5,7 +5,7 @@ import android.os.Build import android.telephony.SmsManager import dagger.Module import dagger.Provides -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelperImplementation import javax.inject.Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt index 6214485f5e..0258993c5c 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.rx.events.EventOverviewBolusProgress diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt index 108a19fbfb..3417716d58 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt @@ -14,8 +14,8 @@ import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt index e1b9a95cf2..9b901f2814 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt index e91acf1be7..4206dad71c 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt @@ -14,12 +14,12 @@ import info.nightscout.androidaps.core.databinding.DialogProfileviewerBinding import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.getCustomizedName import info.nightscout.androidaps.utils.extensions.pureProfileFromJson diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt b/core/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt index 8781fb5bab..edf853afe1 100644 --- a/core/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt +++ b/core/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.events -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.events.Event class EventPreferenceChange : Event { diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt b/core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt index 935ef1d008..b8e251c0eb 100644 --- a/core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt +++ b/core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.events import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper class EventPumpStatusChanged : EventStatus { diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt b/core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt index 7536e9cd90..138787d662 100644 --- a/core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt +++ b/core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.events -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.events.Event // pass string to startup wizard diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt index 972a602573..013b1536eb 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt index 1073b543ba..001952e053 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.database.entities.BolusCalculatorResult import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt index 9727aa143f..34162b2368 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt b/core/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt index b9a8aba3c5..7601bc1f08 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt @@ -4,6 +4,8 @@ import android.content.Context import android.util.AttributeSet import android.view.View import androidx.recyclerview.widget.RecyclerView +import info.nightscout.shared.extensions.runOnUiThread +import info.nightscout.shared.extensions.toVisibility class EmptyRecyclerView : RecyclerView { diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt index daf803471a..619ae5c390 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt @@ -8,9 +8,9 @@ import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import kotlin.math.ceil import kotlin.math.max import kotlin.math.min diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt index 79d0faf2ad..d5c3be00b7 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.extensions import info.nightscout.interfaces.Constants import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.interfaces.GlucoseUnit -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt b/core/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt index f22227f657..72df946cea 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.extensions import android.content.Context import androidx.annotation.AttrRes import androidx.annotation.ColorRes -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper fun String.formatBold(): String = "$this" diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt b/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt index acbccbb4e5..4079c6bbe9 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.extensions import androidx.annotation.StringRes -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt index c4f297fc20..fd5b58556f 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt @@ -7,10 +7,10 @@ import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.extensions.targetBlockFromJsonArray import info.nightscout.androidaps.interfaces.GlucoseUnit -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import org.json.JSONObject import java.util.TimeZone diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt index 42bc522b74..755243fca2 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt @@ -2,10 +2,10 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import kotlin.math.ceil import kotlin.math.max import kotlin.math.min diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt index e06ff75f4b..7553aa59f8 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt @@ -7,10 +7,10 @@ import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import kotlin.math.ceil import kotlin.math.max import kotlin.math.min diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt index 4a221c85bc..fac501c109 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt @@ -4,8 +4,8 @@ import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.interfaces.Constants import java.util.concurrent.TimeUnit diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt index cfe75f642f..fa5afa61c9 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt @@ -7,8 +7,8 @@ import android.widget.TableRow import android.widget.TextView import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.TotalDailyDose -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper val TotalDailyDose.total get() = if (totalAmount > 0) totalAmount else basalAmount + bolusAmount diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.kt index 08a4c28c58..37487cbca0 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.kt @@ -7,6 +7,7 @@ import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper /** * Created by mike on 09.06.2016. diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt index 7bae1e82b1..2b08583a0a 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt @@ -2,13 +2,14 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to1Decimal import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.utils.Round import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.DateTime import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt index 4909610ceb..364022fefc 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt @@ -4,13 +4,14 @@ import androidx.collection.ArrayMap import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt index 27a013bc82..acf64b8d6c 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt @@ -6,6 +6,7 @@ import info.nightscout.androidaps.core.R import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper abstract class PumpPluginBase( pluginDescription: PluginDescription, diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt index 925b728ca2..580f4f23a1 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt @@ -4,7 +4,7 @@ import android.content.Context import android.widget.TableRow import android.widget.TextView import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper interface DexcomTIR { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt index ba7b6a5a13..4cdfc13e64 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.interfaces.stats import android.content.Context import android.widget.TableRow -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil interface TIR { diff --git a/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt b/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt index 458573003d..36f87e20ae 100644 --- a/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt +++ b/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt @@ -6,7 +6,7 @@ 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.UserEntryTransaction -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.userEntry.UserEntryMapper import info.nightscout.androidaps.utils.userEntry.ValueWithUnitMapper import info.nightscout.rx.AapsSchedulers diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt b/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt index 5f6d1521c1..837b39ca8f 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt @@ -13,8 +13,8 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpDescription -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.interfaces.utils.HtmlHelper.fromHtml import info.nightscout.rx.logging.AAPSLogger diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt b/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt index d297303d1c..f25cb683a0 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt @@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.constraints.versionChecker import android.os.Build import info.nightscout.androidaps.core.R import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt index bbd9ad2157..fd4ee5aef2 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.core.R import info.nightscout.interfaces.Config import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils import info.nightscout.androidaps.plugins.general.maintenance.formats.* -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.storage.Storage import info.nightscout.interfaces.data.maintenance.PrefMetadata import info.nightscout.interfaces.data.maintenance.PrefMetadataMap diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt index 9e9bef24fc..1534c51271 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey import info.nightscout.interfaces.data.maintenance.PrefsStatus import info.nightscout.interfaces.locale.LocaleHelper -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class PrefImportListActivity : DaggerAppCompatActivity() { diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt index a43c0bf29f..ac7b2a4323 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt @@ -4,7 +4,7 @@ import info.nightscout.androidaps.core.R import info.nightscout.androidaps.utils.CryptoUtil import info.nightscout.androidaps.extensions.hexStringToByteArray import info.nightscout.androidaps.extensions.toHex -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.storage.Storage import info.nightscout.interfaces.data.maintenance.PrefFileNotFoundError import info.nightscout.interfaces.data.maintenance.PrefFormatError 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 a50b7805b3..0cbd49f33d 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,7 @@ 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.androidaps.interfaces.ResourceHelper +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,9 +30,9 @@ 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.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP import java.util.Calendar diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt index f70199cd44..de29e58319 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt @@ -4,7 +4,7 @@ import android.content.Context import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt index 6933771c62..ca9c3bcf7f 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper class CarbsDataPoint( val data: Carbs, diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt index 57de803f7b..e17131a927 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.T class EffectiveProfileSwitchDataPoint( val data: EffectiveProfileSwitch, diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt index e6388038d8..19a9b037f4 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt @@ -4,7 +4,7 @@ import android.content.Context import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.ExtendedBolus import info.nightscout.androidaps.extensions.toStringTotal -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper class ExtendedBolusDataPoint( val data: ExtendedBolus, diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt index a243611044..ea5283a816 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DefaultValueHelper class GlucoseValueDataPoint( diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt index 406ad9e221..cb507c5585 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.core.R import info.nightscout.androidaps.data.InMemoryGlucoseValue import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper class InMemoryGlucoseValueDataPoint( val data: InMemoryGlucoseValue, diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt index 4ee2f7ad7c..d1ca2efca4 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.Translator class TherapyEventDataPoint( diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt index a008aea3b6..56158ecff8 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt @@ -8,8 +8,8 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt index d37ec7f2c8..65e6ae87b9 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper /** All COB up to now, including carbs not yet processed by IobCob calculation. */ class CobInfo(val timestamp: Long, val displayCob: Double?, val futureCarbs: Double) { diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt index 37a01b3d4d..522481c899 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator import dagger.Reusable import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt index c7d8bb9be2..798aa29f95 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt @@ -6,13 +6,13 @@ import info.nightscout.interfaces.Constants import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt index 6b82a07878..95cdceeac5 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt @@ -13,7 +13,7 @@ import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat import info.nightscout.androidaps.core.R import info.nightscout.androidaps.extensions.safeEnable -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt index 97c7cd0641..4c97446250 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.bolusInfo import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt index 615b4a660a..3d38653bf9 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.bolusInfo import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt index 4d1688fa8c..251bc8930a 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.common.defs import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.utils.Round import info.nightscout.interfaces.pump.DoseSettings import info.nightscout.interfaces.pump.DoseStepSize diff --git a/core/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt b/core/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt index e28b739212..faba5a75a8 100644 --- a/core/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt +++ b/core/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.core.R import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt b/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt index 30c9b45cae..396e1ca8d0 100644 --- a/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt +++ b/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt @@ -11,7 +11,7 @@ import android.os.Looper import dagger.android.DaggerService import info.nightscout.androidaps.core.R import info.nightscout.interfaces.NotificationHolder -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt b/core/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt index 460cd78344..97d023cca9 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt @@ -9,7 +9,7 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper class ActionModeHelper(val rh: ResourceHelper, val activity: FragmentActivity?, val fragment: Fragment?) { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt b/core/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt index 864e0153ba..787be730c0 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils import info.nightscout.androidaps.core.R import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import java.text.DecimalFormat object DecimalFormatter { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt b/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt index 4fcee4fac4..c077c761be 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP diff --git a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt b/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt index 9248492ce4..601d64a0aa 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.entities.TherapyEvent 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.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt b/core/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt index 58b3a439e1..b705d64e3c 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt @@ -4,7 +4,7 @@ import android.widget.TextView import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.extensions.isOlderThan -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt b/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt index 53b25b4a67..b7f53746c1 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt @@ -8,7 +8,7 @@ import android.text.Spanned import androidx.fragment.app.FragmentActivity import com.google.android.material.dialog.MaterialAlertDialogBuilder import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.extensions.runOnUiThread +import info.nightscout.shared.extensions.runOnUiThread object OKDialog { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt b/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt index 1c72451ee3..8206f74ccb 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt @@ -7,7 +7,7 @@ import android.os.SystemClock import androidx.annotation.StringRes import com.google.android.material.dialog.MaterialAlertDialogBuilder import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.extensions.runOnUiThread +import info.nightscout.shared.extensions.runOnUiThread // if you need error dialog - duplicate to ErrorDialog and make it and use: AppThemeErrorDialog & R.drawable.ic_header_error instead diff --git a/core/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt b/core/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt index 16f32a7035..a9df635e47 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt @@ -5,7 +5,7 @@ import androidx.biometric.BiometricPrompt.* import androidx.fragment.app.FragmentActivity import info.nightscout.androidaps.core.R import info.nightscout.androidaps.utils.ToastUtils -import info.nightscout.androidaps.extensions.runOnUiThread +import info.nightscout.shared.extensions.runOnUiThread import java.util.concurrent.Executors object BiometricCheck { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt b/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt index d8d1a57efd..b810fa8b56 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils.protection import androidx.fragment.app.FragmentActivity import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.sharedPreferences.SP import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt b/core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt index 45f02d582b..d943766c3e 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt @@ -14,7 +14,7 @@ import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.view.ContextThemeWrapper import androidx.core.content.ContextCompat import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.FabricPrivacy import java.util.* import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt b/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt index cb0da420a1..b4a198f2ff 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt @@ -23,7 +23,7 @@ import android.widget.Button import android.widget.LinearLayout import info.nightscout.androidaps.core.R import info.nightscout.androidaps.core.databinding.NumberPickerLayoutBinding -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.SafeParse import java.text.NumberFormat diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt b/core/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt index 36f44f6693..d80d7bfb47 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.utils.ui -import info.nightscout.androidaps.extensions.runOnUiThread +import info.nightscout.shared.extensions.runOnUiThread class UIRunnable (val runnable: Runnable) : Runnable { override fun run() { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/WeekdayPicker.kt b/core/src/main/java/info/nightscout/androidaps/utils/ui/WeekdayPicker.kt index b623b7514b..c5eaa9986b 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/WeekdayPicker.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/ui/WeekdayPicker.kt @@ -7,7 +7,7 @@ import android.widget.Checkable import androidx.appcompat.widget.AppCompatCheckedTextView import androidx.constraintlayout.widget.ConstraintLayout import info.nightscout.androidaps.core.databinding.WeekdayPickerBinding -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import java.util.* class WeekdayPicker constructor( diff --git a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt index decec3f24f..7f76025588 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt @@ -12,11 +12,11 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.Translator -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject @Reusable diff --git a/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 9eca1f7df5..aff38f1b2f 100644 --- a/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -9,8 +9,8 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits diff --git a/core/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt b/core/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt index c9c30b296a..84ae1fe96b 100644 --- a/core/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.data import android.content.Context import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt b/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt index dbcf168193..15e14ff6ec 100644 --- a/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt @@ -9,8 +9,8 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config diff --git a/core/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt b/core/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt index 52525dec31..7d905537b8 100644 --- a/core/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.database.data.TargetBlock import info.nightscout.androidaps.database.data.checkSanity -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import org.junit.Assert import org.junit.Test diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt b/core/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt index 301e3083e9..e2a794e98d 100644 --- a/core/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt @@ -3,11 +3,11 @@ package info.nightscout.androidaps.plugins.contraints.versionChecker import android.content.Context import info.nightscout.androidaps.TestBase import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils import info.nightscout.androidaps.plugins.constraints.versionChecker.numericVersionPart import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert.assertArrayEquals diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt b/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt index ad8715b1a1..8813652ae9 100644 --- a/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.general.maintenance.formats import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.utils.CryptoUtil -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.data.maintenance.PrefFormatError import info.nightscout.interfaces.data.maintenance.PrefMetadata import info.nightscout.interfaces.data.maintenance.Prefs diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt b/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt index 20975c9654..f9d8736b23 100644 --- a/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt @@ -7,8 +7,8 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.plugins.iob.iobCobCalculator.asRounded -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt b/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt index 5fbafb3419..bca9698cb6 100644 --- a/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator import android.content.Context import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/core/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt b/core/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt index 793aa2241b..16b0d92740 100644 --- a/core/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt @@ -3,7 +3,9 @@ package info.nightscout.androidaps.utils import android.content.Context import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.junit.Assert import org.junit.Test import org.mockito.Mock diff --git a/core/src/test/java/info/nightscout/androidaps/utils/TTest.kt b/core/src/test/java/info/nightscout/androidaps/utils/TTest.kt index 7893ffda67..02da4b6b45 100644 --- a/core/src/test/java/info/nightscout/androidaps/utils/TTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/utils/TTest.kt @@ -1,5 +1,6 @@ package info.nightscout.androidaps.utils +import info.nightscout.shared.utils.T import org.junit.Assert import org.junit.Test import kotlin.math.abs diff --git a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt index 76e68a78bb..331cb2748a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.AndroidPermission import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.utils.ToastUtils diff --git a/implementation/src/main/java/info/nightscout/implementation/BolusTimerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/BolusTimerImpl.kt index 19f4f1034b..291e3f8179 100644 --- a/implementation/src/main/java/info/nightscout/implementation/BolusTimerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/BolusTimerImpl.kt @@ -3,7 +3,7 @@ package info.nightscout.implementation import dagger.android.HasAndroidInjector import info.nightscout.interfaces.BolusTimer import info.nightscout.androidaps.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.AutomationEvent import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.actions.ActionAlarm diff --git a/implementation/src/main/java/info/nightscout/implementation/CarbTimerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/CarbTimerImpl.kt index aa9675f2d6..a86d7388f4 100644 --- a/implementation/src/main/java/info/nightscout/implementation/CarbTimerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/CarbTimerImpl.kt @@ -3,7 +3,7 @@ package info.nightscout.implementation import dagger.android.HasAndroidInjector import info.nightscout.interfaces.CarbTimer import info.nightscout.androidaps.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.utils.TimerUtil import info.nightscout.automation.AutomationEvent import info.nightscout.automation.AutomationPlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt index 5458fcd27b..e638859e77 100644 --- a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt @@ -12,14 +12,14 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.SmsCommunicator 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.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt index bf715aef4d..1df309db04 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt @@ -3,9 +3,9 @@ package info.nightscout.implementation import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.TrendCalculator -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt b/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt index 55483637d3..1612da81f4 100644 --- a/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt @@ -5,10 +5,10 @@ import android.content.Intent import android.os.Bundle import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.extensions.safeQueryBroadcastReceivers +import info.nightscout.shared.extensions.safeQueryBroadcastReceivers import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.Intents import info.nightscout.androidaps.utils.ToastUtils diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index 9131218c6c..fbc7dc8b4e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -23,13 +23,13 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.queue.commands.Command.CommandType -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.getCustomizedName import info.nightscout.implementation.R diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt b/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt index 6c9080f423..100506e39d 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt @@ -13,10 +13,10 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.AndroidPermission import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.implementation.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt index 280a915a7b..09a3f53eb9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandReadStatus.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.implementation.R import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt index c007783d68..fb53e43d46 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt @@ -7,8 +7,8 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.implementation.R import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt index 49e03f51ad..3753ee0798 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.implementation.R import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt index acf8280100..27496e697e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt @@ -6,12 +6,12 @@ import android.view.ViewGroup import android.widget.TableLayout import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.DexcomTIR import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt index 669fdc818c..314c9e63fc 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt @@ -9,7 +9,7 @@ import android.widget.TextView import info.nightscout.interfaces.Constants import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.DexcomTIR import info.nightscout.implementation.R import java.util.* diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt index d791aec4c4..33b7d2c55c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt @@ -18,11 +18,11 @@ import info.nightscout.androidaps.extensions.toTableRowHeader import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.TddCalculator -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.implementation.R import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt index b580af9136..11bd1dd255 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt @@ -12,12 +12,12 @@ import info.nightscout.interfaces.Constants import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.TIR import info.nightscout.androidaps.interfaces.stats.TirCalculator -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.implementation.R import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt index 7934d806ae..5974f9e35c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TirImpl.kt @@ -5,9 +5,9 @@ import android.content.Context import android.view.Gravity import android.widget.TableRow import android.widget.TextView -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.TIR -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.implementation.R class TirImpl(override val date: Long, override val lowThreshold: Double, override val highThreshold: Double) : TIR { diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c8c0e6e0e3..e4d3ebdd2e 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config diff --git a/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt index ffc6ddc293..77fa152724 100644 --- a/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.services.LocationServiceHelper diff --git a/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt index 887e3b9b2a..f266e3cdbe 100644 --- a/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.TimerUtil import info.nightscout.automation.AutomationPlugin diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index 4700324718..dac7df5859 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -18,11 +18,11 @@ import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java index 457d8c8294..a3e25730b1 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/InsightAlertService.java @@ -39,7 +39,7 @@ import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_erro import info.nightscout.androidaps.plugins.pump.insight.utils.AlertUtils; import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator; import info.nightscout.interfaces.utils.HtmlHelper; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; public class InsightAlertService extends DaggerService implements InsightConnectionService.StateCallback { diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java index 28ebf7228a..d1a1393ba2 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 @@ -32,10 +32,10 @@ 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.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.androidaps.utils.FabricPrivacy; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.rx.AapsSchedulers; import io.reactivex.rxjava3.disposables.CompositeDisposable; diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index e935905d56..2520ae7c0a 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -51,7 +51,7 @@ import info.nightscout.androidaps.interfaces.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.interfaces.PumpSync.PumpState.TemporaryBasal; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.interfaces.pump.ManufacturerType; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; @@ -124,8 +124,8 @@ import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_erro import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_errors.NoActiveTBRToCanceLException; import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator; import info.nightscout.androidaps.plugins.pump.insight.utils.ParameterBlockUtil; -import info.nightscout.androidaps.utils.DateUtil; -import info.nightscout.androidaps.utils.T; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; import info.nightscout.interfaces.Config; import info.nightscout.interfaces.PluginType; import info.nightscout.rx.bus.RxBus; diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/utils/AlertUtils.kt b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/utils/AlertUtils.kt index bb30687792..a2212a2cca 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/utils/AlertUtils.kt +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/utils/AlertUtils.kt @@ -4,7 +4,7 @@ import info.nightscout.androidaps.insight.R import info.nightscout.androidaps.plugins.pump.insight.descriptors.Alert import info.nightscout.androidaps.plugins.pump.insight.descriptors.AlertCategory import info.nightscout.androidaps.plugins.pump.insight.descriptors.AlertType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import java.text.DecimalFormat import javax.inject.Inject import javax.inject.Singleton diff --git a/interfaces/build.gradle b/interfaces/build.gradle index e94dcc4ac3..52c31537eb 100644 --- a/interfaces/build.gradle +++ b/interfaces/build.gradle @@ -17,6 +17,12 @@ android { } dependencies { + // I don't like this low level dependency but it helps + // to move more code to interface module + // database module is compiled longer anyway + // (ResourceHelper interface) + implementation project(':app-wear-shared:shared') + api "androidx.appcompat:appcompat:$appcompat_version" api "androidx.preference:preference-ktx:$preferencektx_version" diff --git a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt index dda9fef80f..9512189fdf 100644 --- a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt +++ b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.plugin.general.openhumans.delegates.OHStateDel import info.nightscout.androidaps.plugin.general.openhumans.ui.OHFragment import info.nightscout.androidaps.plugin.general.openhumans.ui.OHLoginActivity import info.nightscout.rx.bus.RxBus -import info.nightscout.androidaps.interfaces.ResourceHelper +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/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt index bb9773edb6..cd38ec6446 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt @@ -7,11 +7,11 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt index 11a002ecfa..a539bf15ec 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt @@ -8,9 +8,9 @@ import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.notifications.Notification -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt index be363312e6..6284ad631a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.plugins.R import info.nightscout.rx.logging.AAPSLogger import javax.inject.Inject diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt index 6edc7fce43..40f66c607c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.plugins.R diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt index ea1288e4fc..c635cb094f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.plugins.R diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt index 3565928ae2..c82e70556b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt @@ -7,11 +7,11 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFS.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFS.kt index 317e1d5c07..1eb3d7addf 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFS.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFS.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.general.autotune -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 54d3c47bb2..1fe426eb60 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -25,16 +25,16 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.dialogs.ProfileViewerDialog -import info.nightscout.androidaps.extensions.runOnUiThread -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.runOnUiThread +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.interfaces.utils.Round diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt index a64f354b03..b19aeb96c8 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt @@ -17,8 +17,8 @@ import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.plugins.sync.nsclient.extensions.toJson -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.interfaces.Constants import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index 489091dd06..cf1477b2c4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -16,12 +16,12 @@ import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt index 4330cae601..0e6e88aada 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt @@ -4,10 +4,10 @@ import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.BGDatum diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index e0c101320a..5b6335cbc2 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -13,9 +13,9 @@ import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config import info.nightscout.interfaces.utils.Round diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt index 176aaf9237..6be309eb58 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt @@ -2,8 +2,8 @@ package info.nightscout.plugins.general.autotune.data import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.entities.GlucoseValue.TrendArrow -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONException import org.json.JSONObject import java.util.TimeZone diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/CRDatum.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/CRDatum.kt index 44a802e5a4..698a8a4f02 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/CRDatum.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/CRDatum.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.general.autotune.data -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/PreppedGlucose.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/PreppedGlucose.kt index 6b5cc6fc27..ddc834902d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/PreppedGlucose.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/PreppedGlucose.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.general.autotune.data -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONException import org.json.JSONObject 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 5d043286f1..c0c314aed7 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 @@ -17,9 +17,9 @@ import info.nightscout.androidaps.database.entities.Food import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.transactions.InvalidateFoodTransaction -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.interfaces.ActivityNames -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog diff --git a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt index dd0cad2bb4..bc009d3b1d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.extensions.foodFromJson import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt index 1b04b2acfc..173bc37b12 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt @@ -5,10 +5,10 @@ import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Constants import info.nightscout.interfaces.data.smsCommunicator.Sms import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt index 606c213461..fcd2a46985 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt @@ -7,7 +7,7 @@ import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.interfaces.data.smsCommunicator.Sms import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.plugins.databinding.SmscommunicatorFragmentBinding 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 0af83f741a..edf1532d2d 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 @@ -36,16 +36,16 @@ import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper 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.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/otp/OneTimePassword.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/otp/OneTimePassword.kt index 58bb086dc5..0a01fca02a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/otp/OneTimePassword.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/otp/OneTimePassword.kt @@ -5,8 +5,8 @@ import com.eatthepath.otp.HmacOneTimePasswordGenerator import com.google.common.io.BaseEncoding import info.nightscout.interfaces.Constants import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.plugins.R import info.nightscout.shared.sharedPreferences.SP import java.net.URLEncoder diff --git a/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt index ea657e2298..e8d6b4f171 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventThemeSwitch diff --git a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt index a443d545ab..6b03ffee42 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -13,7 +13,7 @@ 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.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.plugins.R diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt index 05cb3b1556..58679ba98a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt @@ -8,7 +8,7 @@ import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import java.util.* import kotlin.math.floor diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinFragment.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinFragment.kt index 15bbe3320d..2894c1cbee 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinFragment.kt @@ -6,7 +6,7 @@ import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.plugins.R import info.nightscout.plugins.databinding.InsulinFragmentBinding import javax.inject.Inject diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt index 75da4030f2..1eec73b2ee 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt index 4df7985223..b4a4b96399 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt @@ -10,11 +10,11 @@ import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt index a577b737a2..e98300cb08 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.extensions.storeInt import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt index 4a77ee382c..1fa1929cd4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt index ac5b4e892d..43193fd712 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index fee013d37b..44eb25b9e4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -14,15 +14,15 @@ import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.ValueWithUnit -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index 1821f8ddc2..4092d333ac 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -21,11 +21,11 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.utils.JsonHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt index 166d58dba8..3dd977809e 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt @@ -3,7 +3,7 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt index 3a09d8165f..3e588b8723 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt @@ -3,7 +3,7 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index 18e32b5dd3..144be220ed 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.GlucoseUnit -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt index a6bdf85da5..03e45f2c1a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt @@ -6,8 +6,8 @@ import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.Profile import info.nightscout.plugins.sync.nsclient.extensions.toJson -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt index cc729cb1d4..704a47da3f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt @@ -3,8 +3,8 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.OfflineEvent import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt index 58dd2466e7..ac2b9378b3 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt @@ -5,8 +5,8 @@ import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +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.getCustomizedName import info.nightscout.androidaps.utils.extensions.pureProfileFromJson diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt index 92afb9d5c8..eb2cc38596 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt @@ -6,8 +6,8 @@ import info.nightscout.androidaps.database.entities.TemporaryBasal.Type.Companio import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt index f924c7c45c..071985691a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -4,8 +4,8 @@ import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +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 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 1210bdd96c..cdffc5e7d6 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,9 +3,9 @@ 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.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +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 diff --git a/plugins/src/main/java/info/nightscout/plugins/ui/TimeListEdit.java b/plugins/src/main/java/info/nightscout/plugins/ui/TimeListEdit.java index aa6cf35307..6b6d7c35ff 100644 --- a/plugins/src/main/java/info/nightscout/plugins/ui/TimeListEdit.java +++ b/plugins/src/main/java/info/nightscout/plugins/ui/TimeListEdit.java @@ -24,7 +24,7 @@ import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.ui.NumberPicker; import info.nightscout.plugins.R; import info.nightscout.rx.logging.AAPSLogger; diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c8c0e6e0e3..e4d3ebdd2e 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt index 6c995a118b..718322e5ec 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt @@ -6,11 +6,11 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import org.junit.Assert diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt index fe7015c224..81bbc12a62 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPluginTest.kt @@ -5,7 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt index ea6e1920c3..ba81af98bd 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt @@ -4,7 +4,7 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt index ae25e436af..8118643c17 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.Constraint -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import org.junit.Assert diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt index 1a6d091c15..8c3e3b9721 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt @@ -8,9 +8,9 @@ import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.database.data.TargetBlock import info.nightscout.androidaps.interfaces.GlucoseUnit -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt index e0bdb6ce8e..30fc5b19cb 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt @@ -15,9 +15,9 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.extensions.shiftBlock import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose diff --git a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt index 8e39332b8c..d1b19d7e47 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt @@ -5,12 +5,12 @@ import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Constants import info.nightscout.androidaps.TestBase import info.nightscout.interfaces.data.smsCommunicator.Sms -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.SmsCommunicator import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.plugins.R import org.junit.Assert import org.junit.Before 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 ab9874ce19..3ef6e37b19 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 @@ -29,8 +29,8 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.data.smsCommunicator.Sms import info.nightscout.plugins.R diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt index 6f83ca556a..bd285c2499 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt @@ -5,7 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt index e843fe725d..3d9e6a06c4 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt index 3f94e05521..fb11a045dc 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.TestBase import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt index e8e6a65d20..20e20fd41f 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt @@ -5,7 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt index 102a8c66e0..72cd7b7702 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt @@ -5,7 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.kt b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.kt index 48483f6168..dd0eaef99a 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.kt +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.kt @@ -10,16 +10,16 @@ import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.combo.R import info.nightscout.androidaps.combo.databinding.CombopumpFragmentBinding -import info.nightscout.androidaps.extensions.runOnUiThread +import info.nightscout.shared.extensions.runOnUiThread import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.combo.data.ComboErrorUtil import info.nightscout.androidaps.plugins.pump.combo.data.ComboErrorUtil.DisplayType import info.nightscout.androidaps.plugins.pump.combo.events.EventComboPumpUpdateGUI import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.PumpState import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 3008fc8c77..6864e05aa2 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -36,7 +36,7 @@ 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.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.interfaces.pump.ManufacturerType; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; @@ -56,9 +56,9 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpH import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistoryRequest; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Tdd; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.InstanceId; -import info.nightscout.androidaps.utils.T; +import info.nightscout.shared.utils.T; import info.nightscout.interfaces.PluginType; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; diff --git a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt index 5e23612321..201bd5d29d 100644 --- a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt +++ b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt @@ -11,10 +11,10 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraint import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.RuffyScripter import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.PluginType import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt index 13fc02cb0f..5b82966aaf 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt @@ -16,19 +16,19 @@ import info.nightscout.androidaps.dana.databinding.DanarFragmentBinding import info.nightscout.androidaps.dana.events.EventDanaRNewStatus import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Dana import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.userEntry.UserEntryMapper.Action diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt index 7162b20567..e45bcf669e 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt @@ -7,9 +7,9 @@ import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt index 943d570f06..b16b364224 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt @@ -23,10 +23,10 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.rx.logging.LTag diff --git a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index dfcd01ae5c..de8003dd46 100644 --- a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -9,8 +9,8 @@ import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index 982a276f1c..b44f7a0ff7 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -20,9 +20,9 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.utils.Round diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java index 3cfe233a91..3e4cc125b7 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java @@ -46,14 +46,14 @@ import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; 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.queue.commands.Command; -import info.nightscout.androidaps.utils.DateUtil; -import info.nightscout.androidaps.utils.T; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; import info.nightscout.rx.events.EventProfileSwitchChanged; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index 2c93d50c34..d7aabc0c80 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -25,15 +25,15 @@ import info.nightscout.androidaps.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.interfaces.utils.Round; -import info.nightscout.androidaps.utils.T; +import info.nightscout.shared.utils.T; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventAppExit; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt index b95a2f85f0..2ac150f815 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.danar.comm.MessageBase import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.LTag import java.util.GregorianCalendar diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java index 117cf288af..db3d566fe1 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java @@ -60,15 +60,15 @@ import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.Pump; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; 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.interfaces.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; -import info.nightscout.androidaps.utils.DateUtil; -import info.nightscout.androidaps.utils.T; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; import info.nightscout.rx.events.EventProfileSwitchChanged; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index c2c2865df0..17bbd983a7 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -25,12 +25,12 @@ 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.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.interfaces.pump.ManufacturerType; 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.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.interfaces.utils.Round; import info.nightscout.interfaces.PluginType; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index bc44f3af7c..0304cfc9d5 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -24,10 +24,10 @@ import info.nightscout.androidaps.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.interfaces.utils.Round; import info.nightscout.interfaces.PluginType; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt index 554815e734..e6e6b04a85 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt @@ -12,11 +12,11 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.utils.CRC.getCrc16 -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAll.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAll.kt index 5a83ae6159..d72e00886b 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAll.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgHistoryAll.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.comm.RecordTypes import info.nightscout.androidaps.dana.database.DanaHistoryRecord -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBolusExtended.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBolusExtended.kt index ef288f8795..ad15de225f 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBolusExtended.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusBolusExtended.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.LTag import kotlin.math.abs import kotlin.math.floor diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusTempBasal.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusTempBasal.kt index 0f79a42c0c..18496f9114 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusTempBasal.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgStatusTempBasal.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.LTag import kotlin.math.abs import kotlin.math.floor diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java index 20bf641486..a5c0c2bf43 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java @@ -45,11 +45,11 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; 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.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.ToastUtils; import info.nightscout.rx.AapsSchedulers; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java index f35863c262..e925c11fbb 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java @@ -52,7 +52,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.interfaces.notifications.Notification; diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c2ae58502b..2278cd9707 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -10,8 +10,8 @@ import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus import org.json.JSONObject diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt index ee4b61e091..3b57d248c8 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt @@ -16,9 +16,9 @@ import info.nightscout.androidaps.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP import org.junit.Before diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgStatusBolusExtendedTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgStatusBolusExtendedTest.kt index 9f2390dc56..e471c7f4d9 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgStatusBolusExtendedTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgStatusBolusExtendedTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import org.junit.Assert import org.junit.Test diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index b7181a8e97..7bf0b799b2 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -29,7 +29,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification @@ -38,11 +38,11 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.PluginType import info.nightscout.rx.AapsSchedulers diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacket.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacket.kt index 4a84198bd2..51347b1fd7 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacket.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacket.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.danars.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import org.joda.time.DateTime import org.joda.time.IllegalInstantException diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt index 8f439820e3..64a4cad34f 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt @@ -7,10 +7,10 @@ import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBasalGetBasalRate.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBasalGetBasalRate.kt index afb6629307..44020f8244 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBasalGetBasalRate.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBasalGetBasalRate.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.ResourceHelper +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.interfaces.notifications.Notification diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusGetBolusOption.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusGetBolusOption.kt index 10f626d2eb..8f3e92f751 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusGetBolusOption.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusGetBolusOption.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.ResourceHelper +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.interfaces.notifications.Notification diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStop.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStop.kt index de45da70bf..0652069a99 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStop.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStop.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketGeneralGetPumpCheck.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketGeneralGetPumpCheck.kt index f78265cbc1..4416c29f44 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketGeneralGetPumpCheck.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketGeneralGetPumpCheck.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.bus.RxBus diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt index d82d78d4a2..027955337d 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.dana.comm.RecordTypes import info.nightscout.androidaps.dana.database.DanaHistoryRecord import info.nightscout.androidaps.dana.database.DanaHistoryRecordDao import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.rx.logging.LTag diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyAlarm.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyAlarm.kt index 1ef25953ad..eee8ba10ae 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyAlarm.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyAlarm.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.bus.RxBus diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt index a35bd9aa16..bc884e87ec 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryComplete.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt index 3b72a73adc..3b99be1013 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyDeliveryRateDisplay.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java b/pump/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java index a2e326aeb2..9bc29513ec 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java @@ -19,7 +19,7 @@ import info.nightscout.androidaps.danars.R; import info.nightscout.androidaps.danars.activities.PairingHelperActivity; import info.nightscout.androidaps.danars.databinding.DanarsPairingProgressDialogBinding; import info.nightscout.androidaps.danars.events.EventDanaRSPairingSuccess; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt index 0760c138f4..7800ee4fe8 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt @@ -34,12 +34,12 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.waitMillis import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +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.interfaces.notifications.Notification -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt index 24303fa75f..0fd5afdd5f 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt @@ -66,15 +66,15 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index b1a3540546..e73715ea9d 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -9,8 +9,8 @@ import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt index adb473c0b3..ec139af39d 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt @@ -18,11 +18,11 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.WarnColors import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index e4b6bef366..2d6458daee 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -27,7 +27,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType @@ -38,11 +38,11 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.PluginType import info.nightscout.rx.AapsSchedulers diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt index c9e8858ddd..b4a5b8a923 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt @@ -3,9 +3,9 @@ package info.nightscout.androidaps.diaconn import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt index f87835491c..1e08f22bff 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt @@ -20,10 +20,10 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.AapsSchedulers import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalLimitInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalLimitInquireResponsePacket.kt index 4bc89075c6..8080f46e95 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalLimitInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BasalLimitInquireResponsePacket.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigAPSMainInfoInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigAPSMainInfoInquireResponsePacket.kt index 955f92b651..26c7289212 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigAPSMainInfoInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigAPSMainInfoInquireResponsePacket.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP import org.joda.time.DateTime diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt index 67ea80049c..46fda8d2e8 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt @@ -40,15 +40,15 @@ import info.nightscout.androidaps.diaconn.pumplog.LOG_TB_START_V3 import info.nightscout.androidaps.diaconn.pumplog.LOG_TB_STOP_V3 import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.androidaps.extensions.safeGetPackageInfo +import info.nightscout.shared.extensions.safeGetPackageInfo import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt index 80f17adc73..7ea91b38cb 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil import info.nightscout.androidaps.interfaces.PumpDescription -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DiaconnG8Packet.java b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DiaconnG8Packet.java index 4eb1553dab..2e444948e5 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DiaconnG8Packet.java +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DiaconnG8Packet.java @@ -6,7 +6,7 @@ import java.nio.ByteOrder; import javax.inject.Inject; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/IncarnationInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/IncarnationInquireResponsePacket.kt index 672a282f91..1419fe19eb 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/IncarnationInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/IncarnationInquireResponsePacket.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.diaconn.packet import dagger.android.HasAndroidInjector import info.nightscout.androidaps.diaconn.DiaconnG8Pump -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionExtendedBolusResultReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionExtendedBolusResultReportPacket.kt index d085f1dcba..1d1b027b6f 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionExtendedBolusResultReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionExtendedBolusResultReportPacket.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.diaconn.packet import dagger.android.HasAndroidInjector import info.nightscout.androidaps.diaconn.DiaconnG8Pump -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionSnackResultReportPacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionSnackResultReportPacket.kt index 75f3da2f43..9cb6753360 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionSnackResultReportPacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/InjectionSnackResultReportPacket.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.diaconn.packet import dagger.android.HasAndroidInjector import info.nightscout.androidaps.diaconn.DiaconnG8Pump -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquireResponsePacket.kt index 25c2cf5814..495c903955 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquireResponsePacket.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.diaconn.packet import dagger.android.HasAndroidInjector import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt index 7c5d96534e..bdf6762e57 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt @@ -29,7 +29,7 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.waitMillis import info.nightscout.interfaces.ActivityNames -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index 656b5dcadd..00950b50cc 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -56,7 +56,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.interfaces.notifications.Notification @@ -64,7 +64,7 @@ import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInf import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index 5e8a021105..8ba4400a02 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -13,7 +13,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType @@ -29,9 +29,9 @@ import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.ui.EopatchOverviewFragment import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.interfaces.PluginType import info.nightscout.rx.AapsSchedulers diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt index edbb54eaf1..963dacd15c 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt @@ -5,7 +5,7 @@ import android.content.Intent import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.defs.PumpType @@ -24,7 +24,7 @@ import info.nightscout.androidaps.plugins.pump.eopatch.code.AlarmCategory import info.nightscout.androidaps.plugins.pump.eopatch.event.EventEoPatchAlarm import info.nightscout.androidaps.plugins.pump.eopatch.ui.AlarmHelperActivity import info.nightscout.androidaps.plugins.pump.eopatch.vo.Alarms -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java index cd6cc4e48f..c642ccb059 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java @@ -14,7 +14,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.eopatch.R; import info.nightscout.androidaps.plugins.pump.eopatch.RxAction; @@ -45,7 +45,7 @@ import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchLifecycleEvent; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventCustomActionsChanged; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt index 83dcc69317..a70db271dc 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager import info.nightscout.androidaps.plugins.pump.eopatch.databinding.DialogAlarmBinding import info.nightscout.androidaps.plugins.pump.eopatch.ui.AlarmHelperActivity import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt index 31998bea4c..5ccecbeebc 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt @@ -5,7 +5,7 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.Transformations import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager @@ -18,8 +18,8 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ui.event.UIEvent import info.nightscout.androidaps.plugins.pump.eopatch.vo.Alarms import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -218,14 +218,14 @@ class EopatchOverviewViewModel @Inject constructor( .subscribe({ response -> if (response.isSuccess) { var result = pumpSync.syncTemporaryBasalWithPumpId( - timestamp = dateUtil.now(), - rate = 0.0, - duration = T.mins((pauseDurationHour * 60).toLong()).msecs(), - isAbsolute = true, - type = PumpSync.TemporaryBasalType.PUMP_SUSPEND, - pumpId = dateUtil.now(), - pumpType = PumpType.EOFLOW_EOPATCH2, - pumpSerial = patchManager.patchConfig.patchSerialNumber + timestamp = dateUtil.now(), + rate = 0.0, + duration = T.mins((pauseDurationHour * 60).toLong()).msecs(), + isAbsolute = true, + type = PumpSync.TemporaryBasalType.PUMP_SUSPEND, + pumpId = dateUtil.now(), + pumpType = PumpType.EOFLOW_EOPATCH2, + pumpSerial = patchManager.patchConfig.patchSerialNumber ) aapsLogger.debug(LTag.PUMP, "syncTemporaryBasalWithPumpId: Result: $result") diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchViewModel.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchViewModel.kt index 0a1c000647..142d4fb646 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchViewModel.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchViewModel.kt @@ -5,7 +5,7 @@ import androidx.annotation.StringRes import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.Transformations -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.eopatch.CommonUtils import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.RxAction diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index 41f99a6344..ecf2d789d5 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -13,9 +13,9 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState -import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState +import info.nightscout.rx.events.EventRefreshButtonState import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice @@ -31,9 +31,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPu import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.AapsSchedulers diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index d7a660b4ed..3ddb56fb23 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType @@ -28,7 +28,7 @@ import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState +import info.nightscout.rx.events.EventRefreshButtonState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpInfo @@ -63,7 +63,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtro import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.isSame -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.interfaces.PluginType diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.kt index f9420e56ed..fe3605d41d 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUIPostprocessor.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.ui -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BasalProfile import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BatteryStatusDTO diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index 03708d1020..48909583e5 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -6,7 +6,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.defs.PumpType diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.kt index 4cf5637b3f..e2664eec3d 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/RLHistoryItemMedtronic.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.LocalDateTime class RLHistoryItemMedtronic(private val medtronicCommandType: MedtronicCommandType) : diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.kt index 0ca333fd3b..38dd6fecbb 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/dialog/MedtronicHistoryActivity.kt @@ -16,7 +16,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup import info.nightscout.androidaps.plugins.pump.medtronic.R import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.data.MedtronicHistoryData -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import java.util.* import javax.inject.Inject diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt index 3af51d4f59..02de0e041f 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.driver -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt index a5ffc9489a..140de43b9f 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.util import com.google.gson.GsonBuilder -import info.nightscout.androidaps.interfaces.ResourceHelper +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.interfaces.notifications.Notification diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt index f7737a1881..eb308c26f6 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt index 2b8e628f81..7f2d426fff 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/ActionFragmentBase.kt @@ -10,7 +10,7 @@ import android.widget.TextView import androidx.annotation.LayoutRes import info.nightscout.androidaps.plugins.pump.omnipod.common.R import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ActionViewModelBase -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility abstract class ActionFragmentBase : WizardFragmentBase() { diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt index 1781757032..f3e1140230 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/fragment/WizardFragmentBase.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.Omnipo import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonWizardProgressIndicationBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.activity.OmnipodWizardActivityBase import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.viewmodel.ViewModelBase -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import kotlin.math.roundToInt diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 02225773ac..21488681c3 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -21,7 +21,7 @@ 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.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType @@ -61,12 +61,12 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.Constants import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.mapProfileToBasalProgram import info.nightscout.androidaps.queue.commands.Command import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.interfaces.PluginType import info.nightscout.rx.AapsSchedulers diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt index affd5d1830..91af859843 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt @@ -5,7 +5,7 @@ import android.content.Intent import android.os.Bundle import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandPlayTestBeep diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt index 7f55f82acc..d7cbdffd91 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewButtonsBinding @@ -35,7 +35,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definitio import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt index 4aee796fb5..d74f67a3fb 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt @@ -4,7 +4,7 @@ import androidx.annotation.StringRes import dagger.android.HasAndroidInjector import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InitializePodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.dash.R diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index ebfebcc328..89e39b1dae 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -7,7 +7,7 @@ import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.defs.PumpType diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/I8n.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/I8n.kt index 7f57283f56..08722c212f 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/I8n.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/I8n.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.util -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.omnipod.dash.R import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.FailedToConnectException import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions.NotConnectedException diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index a13b9a54ce..be7b1de920 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -48,7 +48,7 @@ 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.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.interfaces.pump.ManufacturerType; import info.nightscout.interfaces.pump.actions.CustomActionType; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; @@ -98,11 +98,11 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUti import info.nightscout.interfaces.queue.Callback; import info.nightscout.interfaces.queue.CustomCommand; import info.nightscout.androidaps.services.AlarmSoundService; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.interfaces.utils.Round; -import info.nightscout.androidaps.utils.T; +import info.nightscout.shared.utils.T; import info.nightscout.interfaces.utils.TimeChangeType; import info.nightscout.interfaces.PluginType; import info.nightscout.rx.AapsSchedulers; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java index 46a04949bf..2ab8d95822 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/data/RLHistoryItemOmnipod.java @@ -8,7 +8,7 @@ import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; public class RLHistoryItemOmnipod extends RLHistoryItem { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index ad792cbfa7..f9e9c28bd0 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -21,7 +21,7 @@ import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.interfaces.ActivityNames; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.ResourceHelper; +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.rx.events.EventOverviewBolusProgress; @@ -75,7 +75,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.Ero import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; -import info.nightscout.androidaps.utils.T; +import info.nightscout.shared.utils.T; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.Event; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java index 530d2d0f2e..37d17be423 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java @@ -24,7 +24,7 @@ import javax.inject.Inject; import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; import info.nightscout.androidaps.interfaces.Profile; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt index b9413319b3..1911a480e2 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt @@ -7,7 +7,7 @@ import android.os.Handler import android.os.HandlerThread import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.CommandQueue diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt index bb9e1eea58..dac4584837 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange @@ -43,7 +43,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java index 72df66c023..787b3487ad 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/util/AapsOmnipodUtil.java @@ -21,7 +21,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Al import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; /** * Created by andy on 4/8/19. diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt index a5f8ebb2d2..4c7cc4be21 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt @@ -9,7 +9,7 @@ import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index 90c352e943..49506fb4f0 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -22,7 +22,7 @@ import info.nightscout.androidaps.interfaces.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus @@ -30,7 +30,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryCarbs import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.androidaps.utils.FabricPrivacy diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BondStateReceiver.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BondStateReceiver.kt index 025133ba71..7d867a98c1 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BondStateReceiver.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BondStateReceiver.kt @@ -7,7 +7,7 @@ import androidx.annotation.StringRes import com.google.gson.Gson import dagger.android.DaggerBroadcastReceiver import info.nightscout.androidaps.extensions.safeGetParcelableExtra -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.events.EventPumpConnectionParametersChanged import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.kt index 189353809a..f1aeda210b 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpHistoryEntryGroup.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.defs import info.nightscout.androidaps.plugins.pump.common.R -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import kotlin.streams.toList /** diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/driver/ble/PumpBLESelectorAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/driver/ble/PumpBLESelectorAbstract.kt index 5142254dc0..55f62f0b6e 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/driver/ble/PumpBLESelectorAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/driver/ble/PumpBLESelectorAbstract.kt @@ -5,7 +5,7 @@ import android.bluetooth.le.ScanFilter import android.bluetooth.le.ScanSettings import android.content.Context import android.widget.Toast -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.R import info.nightscout.androidaps.plugins.pump.common.driver.PumpBLESelector import info.nightscout.rx.bus.RxBus diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/driver/history/PumpHistoryEntry.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/driver/history/PumpHistoryEntry.kt index 02e4e91b4c..abfd781c18 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/driver/history/PumpHistoryEntry.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/driver/history/PumpHistoryEntry.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.driver.history import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper interface PumpHistoryEntry { diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpBLEConfigActivity.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpBLEConfigActivity.kt index fadc2ff4cb..f1447053ac 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpBLEConfigActivity.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpBLEConfigActivity.kt @@ -22,7 +22,7 @@ import android.widget.BaseAdapter import android.widget.TextView import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.R import info.nightscout.androidaps.plugins.pump.common.ble.BlePreCheck import info.nightscout.androidaps.plugins.pump.common.databinding.PumpBleConfigActivityBinding diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpHistoryActivity.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpHistoryActivity.kt index e262f9d3bd..b2625951d2 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpHistoryActivity.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpHistoryActivity.kt @@ -13,7 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.R import info.nightscout.androidaps.plugins.pump.common.databinding.PumpHistoryActivityBinding import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java index 0f9986dce1..a2050a7273 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java @@ -8,7 +8,7 @@ import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; -import info.nightscout.androidaps.utils.DateUtil; +import info.nightscout.shared.utils.DateUtil; /** * Created by geoff on 4/28/15. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt index 60bff894fa..4ad796466b 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt @@ -28,7 +28,7 @@ import android.widget.Toast import androidx.core.app.ActivityCompat import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.ble.BlePreCheck import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt index d0e45dc576..1e6cf11a25 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper open class EventRileyLinkDeviceStatusChange : EventStatus { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java index 3e178b101b..1350d03aab 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java @@ -12,7 +12,7 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java index a6e0f11e30..6d8fdb163a 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/defs/RileyLinkEncodingType.java @@ -4,7 +4,7 @@ import java.util.HashMap; import java.util.Map; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; public enum RileyLinkEncodingType { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java index fbc77b5fc4..74defd7a00 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java @@ -6,7 +6,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; -import info.nightscout.androidaps.interfaces.ResourceHelper; +import info.nightscout.shared.interfaces.ResourceHelper; /** diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt index 6a3ac9e78a..e82d3cec56 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt @@ -6,14 +6,14 @@ import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusGeneralBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP import org.joda.time.LocalDateTime diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt index 63605c1a7e..6925a1783c 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt @@ -13,8 +13,8 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusHistoryBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusHistoryItemBinding -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class RileyLinkStatusHistoryFragment : DaggerFragment() { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt index ebc8a04579..88293787e1 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt @@ -7,7 +7,7 @@ import android.content.Intent import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.kt index 79b7377df4..78c288c3d3 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/ResetRileyLinkConfigurationTask.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventRefreshButtonState import javax.inject.Inject class ResetRileyLinkConfigurationTask(injector: HasAndroidInjector) : PumpTask(injector) { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.kt index b5ec03a89c..d69546de2c 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/WakeAndTuneTask.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.plugins.pump.common.events.EventRefreshButtonState import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventRefreshButtonState import javax.inject.Inject class WakeAndTuneTask(injector: HasAndroidInjector) : PumpTask(injector) { diff --git a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt index 047da675af..93eb2f35cb 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.stats.TddCalculator -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.InstanceId import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.SafeParse diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index 7f29af0325..5dcc39a3ca 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -27,7 +27,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.rx.AapsSchedulers import info.nightscout.shared.SafeParse import info.nightscout.shared.sharedPreferences.SP diff --git a/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt index 5a955105eb..d297b7606f 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TreatmentsActivity.kt @@ -6,7 +6,7 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentTransaction import com.google.android.material.tabs.TabLayout import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.BuildHelper import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index 2108831e51..4b58fcd6f6 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -29,15 +29,15 @@ import info.nightscout.androidaps.database.transactions.InvalidateBolusTransacti import info.nightscout.androidaps.database.transactions.InvalidateCarbsTransaction import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.iobCalc -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.interfaces.BuildHelper diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt index bad94659fd..8fdac45234 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -21,13 +21,13 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InvalidateAAPSStartedTherapyEventTransaction import info.nightscout.androidaps.database.transactions.InvalidateTherapyEventTransaction -import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt index 13100ab5a2..87ffa156e9 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -21,16 +21,16 @@ import info.nightscout.androidaps.database.transactions.InvalidateExtendedBolusT import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.isInProgress -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.rx.bus.RxBus import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.AapsSchedulers diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 8e42550b37..6b513d45fc 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -25,14 +25,14 @@ import info.nightscout.androidaps.database.transactions.InvalidateProfileSwitchT import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewHistoryData -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.getCustomizedName diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt index c6a8686caf..a2c45426b1 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -28,14 +28,14 @@ import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.friendlyDescription import info.nightscout.androidaps.extensions.highValueToUnitsToString import info.nightscout.androidaps.extensions.lowValueToUnitsToString -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 28ab1beabd..331c1d000c 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -30,16 +30,16 @@ import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.extensions.toTemporaryBasal -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.rx.bus.RxBus import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.AapsSchedulers diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index 5b9a32a9f2..eab367c440 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -17,15 +17,15 @@ import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.rx.bus.RxBus -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.AapsSchedulers diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt index e9d7e5ffd6..4c192e8a90 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt @@ -4,7 +4,7 @@ import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.Round import org.json.JSONArray import org.json.JSONObject diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt index d98f68addd..7dd694b303 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONObject import java.util.* diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt index a84546c8bf..b541f01211 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index e4ad8726b6..8909f5caa8 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -26,7 +26,7 @@ import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider @@ -34,7 +34,7 @@ import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt index eb0a64bb8a..33eceee057 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt @@ -21,11 +21,11 @@ import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.logging.LTag diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt index 4d93276d30..758a156c4c 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt @@ -12,8 +12,8 @@ import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson import info.nightscout.androidaps.extensions.toJson import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.Constants import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogWizardinfoBinding diff --git a/ui/src/main/java/info/nightscout/ui/utils/ActivityMonitor.kt b/ui/src/main/java/info/nightscout/ui/utils/ActivityMonitor.kt index 7ba31693c0..e755c1dd59 100644 --- a/ui/src/main/java/info/nightscout/ui/utils/ActivityMonitor.kt +++ b/ui/src/main/java/info/nightscout/ui/utils/ActivityMonitor.kt @@ -10,9 +10,9 @@ import android.view.ViewGroup import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.T +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.shared.SafeParse import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt index f9d173e6be..cbf78ae4e9 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt @@ -17,7 +17,7 @@ import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.extensions.directionToIcon -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames @@ -28,12 +28,12 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.interfaces.VariableSensitivityResult import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c8c0e6e0e3..e4d3ebdd2e 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config diff --git a/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt b/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt index fb02384128..e36e0311f6 100644 --- a/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt +++ b/wear/src/main/java/info/nightscout/androidaps/di/WearModule.kt @@ -6,7 +6,7 @@ import dagger.Module import dagger.android.HasAndroidInjector import info.nightscout.androidaps.Aaps import info.nightscout.rx.di.RxModule -import info.nightscout.rx.di.SharedImplModule +import info.nightcout.shared.impl.di.SharedImplModule import info.nightscout.shared.di.SharedModule @Suppress("unused") diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/QuickSnoozeActivity.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/QuickSnoozeActivity.kt index 7364404ecd..4fa2557ed6 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/QuickSnoozeActivity.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/QuickSnoozeActivity.kt @@ -8,7 +8,7 @@ import android.widget.Toast import dagger.android.DaggerActivity import info.nightscout.androidaps.R import info.nightscout.rx.events.EventWearToMobile -import info.nightscout.androidaps.extensions.safeGetPackageInfo +import info.nightscout.shared.extensions.safeGetPackageInfo import info.nightscout.rx.bus.RxBus import info.nightscout.rx.weardata.EventData import javax.inject.Inject diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.kt index ba79093eb7..e15958bc16 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.interaction.utils import info.nightscout.androidaps.BuildConfig -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Persistence.kt b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Persistence.kt index a208a5978e..b6e1868fde 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Persistence.kt +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Persistence.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.interaction.utils -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyleWatchface.kt b/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyleWatchface.kt index ef11f9d22a..70e5a42670 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyleWatchface.kt +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/DigitalStyleWatchface.kt @@ -12,7 +12,7 @@ import androidx.core.content.ContextCompat import androidx.viewbinding.ViewBinding import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityDigitalstyleBinding -import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.watchfaces.utils.BaseWatchFace import info.nightscout.rx.logging.LTag diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BaseWatchFace.kt b/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BaseWatchFace.kt index b392b82a55..a2a7399c1e 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BaseWatchFace.kt +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BaseWatchFace.kt @@ -25,13 +25,13 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.data.RawDisplayData import info.nightscout.androidaps.events.EventWearPreferenceChange import info.nightscout.rx.events.EventWearToMobile -import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.androidaps.extensions.toVisibilityKeepSpace +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibilityKeepSpace import info.nightscout.androidaps.interaction.menus.MainMenuActivity import info.nightscout.androidaps.interaction.utils.Persistence import info.nightscout.androidaps.interaction.utils.WearUtil import info.nightscout.rx.bus.RxBus -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BgGraphBuilder.kt b/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BgGraphBuilder.kt index a504c1e367..5cd8aa682a 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BgGraphBuilder.kt +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/utils/BgGraphBuilder.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.watchfaces.utils import android.graphics.DashPathEffect import info.nightscout.androidaps.R -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.sharedPreferences.SP import info.nightscout.rx.weardata.EventData import info.nightscout.rx.weardata.EventData.SingleBg diff --git a/wear/src/test/java/info/nightscout/androidaps/TestBase.kt b/wear/src/test/java/info/nightscout/androidaps/TestBase.kt index ff0fdb621c..12adb1059f 100644 --- a/wear/src/test/java/info/nightscout/androidaps/TestBase.kt +++ b/wear/src/test/java/info/nightscout/androidaps/TestBase.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.interaction.utils.Persistence import info.nightscout.androidaps.interaction.utils.WearUtil import info.nightscout.androidaps.testing.mockers.WearUtilMocker import info.nightscout.androidaps.testing.mocks.SharedPreferencesMock -import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLoggerTest import info.nightscout.shared.sharedPreferences.SP import org.junit.Before From 936192b0deb2af59a8533d524ecdc11a8f3a9b74 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Nov 2022 12:17:53 +0100 Subject: [PATCH 12/42] resolve rireylink -> pump-common dependency --- app/build.gradle | 1 + pump/medtronic/build.gradle | 1 + .../pump/medtronic/MedtronicFragment.kt | 14 ++++++------- .../comm/MedtronicCommunicationManager.kt | 4 ++-- .../pump/medtronic/comm/MedtronicConverter.kt | 18 +++++++++------- .../comm/history/MedtronicHistoryDecoder.kt | 9 ++++---- .../comm/history/MedtronicHistoryEntry.kt | 4 ++-- .../medtronic/comm/history/RawHistoryPage.kt | 2 +- .../comm/history/cgms/CGMSHistoryEntry.kt | 2 +- .../cgms/MedtronicCGMSHistoryDecoder.kt | 2 +- .../pump/MedtronicPumpHistoryDecoder.kt | 14 ++++++------- .../comm/history/pump/PumpHistoryEntry.kt | 6 +++--- .../GetHistoryPageCarelinkMessageBody.kt | 2 +- .../medtronic/comm/message/MessageBody.kt | 2 +- .../medtronic/comm/message/PumpMessage.kt | 4 ++-- .../pump/medtronic/comm/ui/MedtronicUITask.kt | 8 ++++--- .../medtronic/data/MedtronicHistoryData.kt | 6 +++--- .../pump/medtronic/data/dto/BasalProfile.kt | 2 +- .../pump/medtronic/data/dto/BolusDTO.kt | 4 ++-- .../pump/medtronic/data/dto/DailyTotalsDTO.kt | 18 ++++++++-------- .../data/dto/PumpTimeStampedRecord.kt | 4 ++-- .../pump/medtronic/data/dto/TempBasalPair.kt | 2 +- .../pump/medtronic/di/MedtronicModule.kt | 2 +- .../medtronic/driver/MedtronicPumpStatus.kt | 4 ++-- .../service/RileyLinkMedtronicService.kt | 5 ++--- .../pump/medtronic/util/MedtronicUtil.kt | 6 +++--- .../info/nightscout/androidaps/TestBase.kt | 4 ++-- .../comm/MedtronicHistoryDataUTest.kt | 2 +- .../pump/MedtronicPumpHistoryDecoderUTest.kt | 2 +- pump/omnipod-eros/build.gradle | 1 + .../communication/message/OmnipodMessage.java | 2 +- .../communication/message/OmnipodPacket.java | 2 +- .../command/AcknowledgeAlertsCommand.java | 2 +- .../command/BasalScheduleExtraCommand.java | 3 ++- .../message/command/BeepConfigCommand.java | 2 +- .../message/command/BolusExtraCommand.java | 2 +- .../command/CancelDeliveryCommand.java | 2 +- .../command/ConfigureAlertsCommand.java | 2 +- .../message/command/DeactivatePodCommand.java | 2 +- .../message/command/FaultConfigCommand.java | 2 +- .../command/SetInsulinScheduleCommand.java | 2 +- .../message/command/SetupPodCommand.java | 2 +- .../command/TempBasalExtraCommand.java | 2 +- .../message/response/ErrorResponse.java | 2 +- .../message/response/StatusResponse.java | 2 +- .../message/response/VersionResponse.java | 2 +- .../response/podinfo/PodInfoActiveAlerts.java | 2 +- .../response/podinfo/PodInfoDataLog.java | 2 +- .../podinfo/PodInfoDetailedStatus.java | 2 +- .../podinfo/PodInfoOlderPulseLog.java | 2 +- .../podinfo/PodInfoRecentPulseLog.java | 2 +- .../response/podinfo/PodInfoResponse.java | 2 +- .../driver/definition/AlertConfiguration.java | 3 ++- .../driver/definition/ErrorEventInfo.java | 2 +- .../schedule/BasalDeliverySchedule.java | 2 +- .../definition/schedule/BasalTableEntry.java | 2 +- .../schedule/BolusDeliverySchedule.java | 2 +- .../driver/definition/schedule/RateEntry.java | 6 +++--- .../schedule/TempBasalDeliverySchedule.java | 2 +- .../exception/NotEnoughDataException.java | 2 +- .../eros/manager/AapsOmnipodErosManager.java | 14 ++++++------- .../OmnipodRileyLinkCommunicationManager.java | 4 ++-- .../service/RileyLinkOmnipodService.java | 2 +- .../BasalScheduleExtraCommandTest.java | 12 +++++------ .../command/BeepConfigCommandTest.java | 6 +++--- .../command/BolusExtraCommandTest.java | 6 +++--- .../command/CancelDeliveryCommandTest.java | 6 +++--- .../command/ConfigureAlertsCommandTest.java | 6 +++--- .../message/command/GetStatusCommandTest.java | 6 +++--- .../SetInsulinScheduleCommandTest.java | 6 +++--- .../message/command/SetupPodCommandTest.java | 6 +++--- .../command/TempBasalExtraCommandTest.java | 6 +++--- .../message/response/ErrorResponseTest.java | 12 +++++------ .../message/response/StatusResponseTest.java | 18 ++++++++-------- .../message/response/VersionResponseTest.java | 10 ++++----- .../podinfo/PodInfoActiveAlertsTest.java | 8 +++---- .../response/podinfo/PodInfoDataLogTest.java | 8 +++---- .../podinfo/PodInfoDetailedStatusTest.java | 18 ++++++++-------- ...PodInfoFaultAndInitializationTimeTest.java | 8 +++---- .../podinfo/PodInfoRecentPulseLogTest.java | 6 +++--- .../response/podinfo/PodInfoResponseTest.java | 14 ++++++------- .../pump/common/defs/PumpDriverState.kt | 4 +--- .../src/main/res/values/strings.xml | 8 ------- pump/pump-core/.gitignore | 1 + pump/pump-core/build.gradle | 20 ++++++++++++++++++ pump/pump-core/consumer-rules.pro | 0 pump/pump-core/proguard-rules.pro | 21 +++++++++++++++++++ pump/pump-core/src/main/AndroidManifest.xml | 4 ++++ .../pump/core}/defs/PumpDeviceState.kt | 4 ++-- .../nightscout/pump/core}/utils/ByteUtil.java | 2 +- .../pump/core}/utils/StringUtil.java | 18 +++++++--------- .../pump/core}/utils/ThreadUtil.java | 2 +- .../pump-core/src/main/res/values/strings.xml | 14 +++++++++++++ pump/rileylink/build.gradle | 1 + .../EventRileyLinkDeviceStatusChange.kt | 2 +- .../RileyLinkCommunicationManager.java | 4 ++-- .../pump/common/hw/rileylink/ble/RFSpy.java | 8 +++---- .../common/hw/rileylink/ble/RFSpyReader.kt | 4 ++-- .../common/hw/rileylink/ble/RileyLinkBLE.kt | 6 +++--- .../rileylink/ble/command/SendAndListen.java | 2 +- .../hw/rileylink/ble/data/RadioPacket.java | 2 +- .../hw/rileylink/ble/data/RadioResponse.java | 2 +- .../data/encoding/Encoding4b6bAbstract.java | 2 +- .../ble/data/encoding/Encoding4b6bGeoff.java | 2 +- .../hw/rileylink/ble/device/OrangeLinkImpl.kt | 2 +- .../hw/rileylink/data/RLHistoryItem.java | 2 +- .../dialog/RileyLinkStatusGeneralFragment.kt | 8 +++---- .../dialog/RileyLinkStatusHistoryFragment.kt | 4 ++-- .../hw/rileylink/service/RileyLinkService.kt | 4 ++-- .../ble/RFToolsParametrizedUTest.java | 2 +- settings.gradle | 1 + 111 files changed, 307 insertions(+), 252 deletions(-) create mode 100644 pump/pump-core/.gitignore create mode 100644 pump/pump-core/build.gradle create mode 100644 pump/pump-core/consumer-rules.pro create mode 100644 pump/pump-core/proguard-rules.pro create mode 100644 pump/pump-core/src/main/AndroidManifest.xml rename pump/{pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common => pump-core/src/main/java/info/nightscout/pump/core}/defs/PumpDeviceState.kt (83%) rename pump/{pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common => pump-core/src/main/java/info/nightscout/pump/core}/utils/ByteUtil.java (99%) rename pump/{pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common => pump-core/src/main/java/info/nightscout/pump/core}/utils/StringUtil.java (79%) rename pump/{pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common => pump-core/src/main/java/info/nightscout/pump/core}/utils/ThreadUtil.java (86%) create mode 100644 pump/pump-core/src/main/res/values/strings.xml diff --git a/app/build.gradle b/app/build.gradle index 45ae641bf4..3c04647ee4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -200,6 +200,7 @@ dependencies { implementation project(':insight') implementation project(':pump:medtronic') implementation project(':pump:pump-common') + implementation project(':pump:pump-core') implementation project(':pump:rileylink') implementation project(':pump:omnipod-common') implementation project(':pump:omnipod-eros') diff --git a/pump/medtronic/build.gradle b/pump/medtronic/build.gradle index 337bb98cbf..ade2787122 100644 --- a/pump/medtronic/build.gradle +++ b/pump/medtronic/build.gradle @@ -21,6 +21,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':core') implementation project(':pump:pump-common') + implementation project(':pump:pump-core') implementation project(':pump:rileylink') implementation project(':interfaces') } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index ecf2d789d5..57d90464c3 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -13,9 +13,6 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState -import info.nightscout.rx.events.EventRefreshButtonState import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice @@ -29,19 +26,22 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.interfaces.queue.Callback +import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange +import info.nightscout.rx.events.EventQueueChanged +import info.nightscout.rx.events.EventRefreshButtonState import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt index 537bd763da..0838bcda9d 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt @@ -1,7 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm import android.os.SystemClock -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst @@ -10,7 +9,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.Radi import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RadioResponse import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage @@ -36,6 +34,8 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.createByteArray import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.getByteArrayFromUnsignedShort +import info.nightscout.pump.core.defs.PumpDeviceState +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.LTag import org.joda.time.LocalDateTime import java.util.Calendar diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt index 24d5a97115..acfe57893f 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BasalProfile import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BatteryStatusDTO import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpConfigurationGroup import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil +import info.nightscout.pump.core.utils.StringUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import org.joda.time.IllegalFieldValueException @@ -119,8 +119,9 @@ class MedtronicConverter @Inject constructor( addSettingToMap("PCFG_MAX_BOLUS", "" + decodeMaxBolus(rd), PumpConfigurationGroup.Bolus, map) addSettingToMap( "PCFG_MAX_BASAL", "" - + decodeBasalInsulin(ByteUtil.makeUnsignedShort(rd[settingIndexMaxBasal].toInt(), - rd[settingIndexMaxBasal + 1].toInt())), PumpConfigurationGroup.Basal, map) + + decodeBasalInsulin( + ByteUtil.makeUnsignedShort(rd[settingIndexMaxBasal].toInt(), + rd[settingIndexMaxBasal + 1].toInt())), PumpConfigurationGroup.Basal, map) addSettingToMap("CFG_BASE_CLOCK_MODE", if (rd[settingIndexTimeDisplayFormat].toInt() == 0) "12h" else "24h", PumpConfigurationGroup.General, map) addSettingToMap("PCFG_BASAL_PROFILES_ENABLED", parseResultEnable(rd[10].toInt()), PumpConfigurationGroup.Basal, map) @@ -152,14 +153,15 @@ class MedtronicConverter @Inject constructor( addSettingToMap("PCFG_AUDIO_BOLUS_ENABLED", parseResultEnable(rd[2].toInt()), PumpConfigurationGroup.Bolus, map) if (rd[2].toInt() == 1) { addSettingToMap("PCFG_AUDIO_BOLUS_STEP_SIZE", "" + decodeBolusInsulin(ByteUtil.asUINT8(rd[3])), - PumpConfigurationGroup.Bolus, map) + PumpConfigurationGroup.Bolus, map) } addSettingToMap("PCFG_VARIABLE_BOLUS_ENABLED", parseResultEnable(rd[4].toInt()), PumpConfigurationGroup.Bolus, map) addSettingToMap("PCFG_MAX_BOLUS", "" + decodeMaxBolus(rd), PumpConfigurationGroup.Bolus, map) addSettingToMap( "PCFG_MAX_BASAL", "" - + decodeBasalInsulin(ByteUtil.makeUnsignedShort(rd[settingIndexMaxBasal].toInt(), - rd[settingIndexMaxBasal + 1].toInt())), PumpConfigurationGroup.Basal, map) + + decodeBasalInsulin( + ByteUtil.makeUnsignedShort(rd[settingIndexMaxBasal].toInt(), + rd[settingIndexMaxBasal + 1].toInt())), PumpConfigurationGroup.Basal, map) addSettingToMap("CFG_BASE_CLOCK_MODE", if (rd[settingIndexTimeDisplayFormat].toInt() == 0) "12h" else "24h", PumpConfigurationGroup.General, map) if (MedtronicDeviceType.isSameDevice(medtronicUtil.medtronicPumpModel, MedtronicDeviceType.Medtronic_523andHigher)) { @@ -201,7 +203,7 @@ class MedtronicConverter @Inject constructor( val map = decodeSettings512(rd) addSettingToMap("PCFG_MM_RESERVOIR_WARNING_TYPE_TIME", if (rd[18].toInt() != 0) "PCFG_MM_RESERVOIR_WARNING_TYPE_TIME" else "PCFG_MM_RESERVOIR_WARNING_TYPE_UNITS", PumpConfigurationGroup.Other, map) addSettingToMap("PCFG_MM_SRESERVOIR_WARNING_POINT", "" + ByteUtil.asUINT8(rd[19]), - PumpConfigurationGroup.Other, map) + PumpConfigurationGroup.Other, map) addSettingToMap("CFG_MM_KEYPAD_LOCKED", parseResultEnable(rd[20].toInt()), PumpConfigurationGroup.Other, map) if (MedtronicDeviceType.isSameDevice(medtronicUtil.medtronicPumpModel, MedtronicDeviceType.Medtronic_523andHigher)) { addSettingToMap("PCFG_BOLUS_SCROLL_STEP_SIZE", "" + rd[21], PumpConfigurationGroup.Bolus, map) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt index 25da4499e1..55912956ee 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryDecoder.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil +import info.nightscout.pump.core.utils.StringUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import org.apache.commons.lang3.StringUtils @@ -16,7 +16,8 @@ import org.apache.commons.lang3.StringUtils */ abstract class MedtronicHistoryDecoder(var aapsLogger: AAPSLogger, var medtronicUtil: MedtronicUtil, - var bitUtils: ByteUtil) : MedtronicHistoryDecoderInterface { + var bitUtils: ByteUtil +) : MedtronicHistoryDecoderInterface { // STATISTICS (remove at later time or not) protected var statisticsEnabled = true @@ -112,7 +113,7 @@ abstract class MedtronicHistoryDecoder(var aapsLogge } fun getFormattedFloat(value: Float, decimals: Int): String { - return StringUtil.getFormatedValueUS(value, decimals) + return StringUtil.getFormattedValueUS(value, decimals) } } \ No newline at end of file diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt index 7a70667d51..d36cc0f031 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/MedtronicHistoryEntry.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history import com.google.gson.annotations.Expose -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil +import info.nightscout.pump.core.utils.ByteUtil +import info.nightscout.pump.core.utils.StringUtil /** * This file was taken from GGC - GNU Gluco Control (ggc.sourceforge.net), application for diabetes diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt index 330ce83f70..7e0d44aca2 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/RawHistoryPage.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.common.utils.CRC import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import java.util.Arrays diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt index 82beed1655..43dbbaabd0 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/CGMSHistoryEntry.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.cgms -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryEntry +import info.nightscout.pump.core.utils.ByteUtil import org.apache.commons.lang3.StringUtils import org.joda.time.LocalDateTime diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt index 146c4ed6d5..00f3b89b89 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.cgms -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryDecoder import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RecordDecodeStatus import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.cgms.CGMSHistoryEntryType.Companion.getByCode import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import okhttp3.internal.and diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt index e8babfcbe1..2e7166e986 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoder.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryDecoder import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RecordDecodeStatus @@ -13,6 +12,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalPair import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpBolusType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import java.util.Locale @@ -426,15 +426,15 @@ class MedtronicPumpHistoryDecoder @Inject constructor( val data = entry.head if (MedtronicDeviceType.isSameDevice(medtronicUtil.medtronicPumpModel, MedtronicDeviceType.Medtronic_523andHigher)) { bolus = BolusDTO(atechDateTime = entry.atechDateTime, - requestedAmount = ByteUtil.toInt(data.get(0), data.get(1)) / 40.0, - deliveredAmount = ByteUtil.toInt(data.get(2), data.get(3)) / 40.0, - duration = data.get(6) * 30) + requestedAmount = ByteUtil.toInt(data.get(0), data.get(1)) / 40.0, + deliveredAmount = ByteUtil.toInt(data.get(2), data.get(3)) / 40.0, + duration = data.get(6) * 30) bolus.insulinOnBoard = ByteUtil.toInt(data.get(4), data.get(5)) / 40.0 } else { bolus = BolusDTO(atechDateTime = entry.atechDateTime, - requestedAmount = ByteUtil.asUINT8(data.get(0)) / 10.0, - deliveredAmount = ByteUtil.asUINT8(data.get(1)) / 10.0, - duration = ByteUtil.asUINT8(data.get(2)) * 30) + requestedAmount = ByteUtil.asUINT8(data.get(0)) / 10.0, + deliveredAmount = ByteUtil.asUINT8(data.get(1)) / 10.0, + duration = ByteUtil.asUINT8(data.get(2)) * 30) } bolus.bolusType = if (bolus.duration > 0) PumpBolusType.Extended else PumpBolusType.Normal entry.addDecodedData("Object", bolus) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt index 2c7481fd73..777745b9d9 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/PumpHistoryEntry.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump import com.google.gson.annotations.Expose -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.MedtronicHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BolusDTO import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType -import java.util.* +import info.nightscout.pump.core.utils.ByteUtil +import info.nightscout.pump.core.utils.StringUtil +import java.util.Objects /** * This file was taken from GGC - GNU Gluco Control (ggc.sourceforge.net), application for diabetes diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.kt index 574bbacc9f..f68b2cef57 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/GetHistoryPageCarelinkMessageBody.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.message -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil +import info.nightscout.pump.core.utils.ByteUtil import kotlin.experimental.and /** diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.kt index 45bfdcf5de..a3f8c72aef 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/MessageBody.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.message -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil +import info.nightscout.pump.core.utils.ByteUtil /** * Created by geoff on 5/29/16. diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt index 9445ecda75..8f72780450 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/message/PumpMessage.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.message import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandType +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import kotlin.math.min @@ -62,7 +62,7 @@ class PumpMessage : RLMessage { } if (rxData.size > 5) { messageBody = MedtronicCommandType.constructMessageBody(commandType, - ByteUtil.substring(rxData, 5, rxData.size - 5)) + ByteUtil.substring(rxData, 5, rxData.size - 5)) } } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt index 348d6acbf0..95dd6aadc0 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/ui/MedtronicUITask.kt @@ -1,7 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.ui import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry @@ -12,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicUIRespons import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -155,10 +155,12 @@ class MedtronicUITask { postprocessor.postProcessData(this) } if (responseType === MedtronicUIResponseType.Invalid) { - rxBus.send(EventRileyLinkDeviceStatusChange(PumpDeviceState.ErrorWhenCommunicating, + rxBus.send(EventRileyLinkDeviceStatusChange( + PumpDeviceState.ErrorWhenCommunicating, "Unsupported command in MedtronicUITask")) } else if (responseType === MedtronicUIResponseType.Error) { - rxBus.send(EventRileyLinkDeviceStatusChange(PumpDeviceState.ErrorWhenCommunicating, + rxBus.send(EventRileyLinkDeviceStatusChange( + PumpDeviceState.ErrorWhenCommunicating, errorDescription)) } else { rxBus.send(EventMedtronicPumpValuesChanged()) diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index 48909583e5..6dae0651c7 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -6,16 +6,13 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper 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.common.sync.PumpDbEntry import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryBolus import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryTBR import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil import info.nightscout.androidaps.plugins.pump.medtronic.R import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry @@ -33,9 +30,12 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpBolusType import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.pump.core.utils.StringUtil import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.apache.commons.lang3.StringUtils import org.joda.time.LocalDateTime diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt index dc22e76484..ccfb09aadb 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto import com.google.gson.annotations.Expose import info.nightscout.androidaps.plugins.pump.common.defs.PumpType -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import org.joda.time.Instant diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.kt index 2b738c34f0..2d051326b6 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BolusDTO.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto import com.google.gson.annotations.Expose -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil import info.nightscout.androidaps.plugins.pump.medtronic.defs.PumpBolusType +import info.nightscout.pump.core.utils.StringUtil /** * Application: GGC - GNU Gluco Control @@ -73,7 +73,7 @@ class BolusDTO constructor(atechDateTime: Long, } override fun getFormattedDecimal(value: Double): String { - return StringUtil.getFormatedValueUS(value, 2) + return StringUtil.getFormattedValueUS(value, 2) } val bolusKey: String diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.kt index a295c76aff..68a5e14b89 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/DailyTotalsDTO.kt @@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto //import info.nightscout.androidaps.db.TDD import com.google.gson.annotations.Expose -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType +import info.nightscout.pump.core.utils.ByteUtil +import info.nightscout.pump.core.utils.StringUtil import org.apache.commons.lang3.builder.ToStringBuilder -import java.util.* +import java.util.Locale /** * Created by andy on 11/3/18. @@ -56,16 +56,16 @@ class DailyTotalsDTO(var entry: PumpHistoryEntry) { private var bolusCountCorr: Int? = null private fun setDisplayable() { if (insulinBasal == 0.0) { - entry.displayableValue = "Total Insulin: " + StringUtil.getFormatedValueUS(insulinTotal, 2) + entry.displayableValue = "Total Insulin: " + StringUtil.getFormattedValueUS(insulinTotal, 2) } else { - entry.displayableValue = ("Basal Insulin: " + StringUtil.getFormatedValueUS(insulinBasal, 2) - + ", Total Insulin: " + StringUtil.getFormatedValueUS(insulinTotal, 2)) + entry.displayableValue = ("Basal Insulin: " + StringUtil.getFormattedValueUS(insulinBasal, 2) + + ", Total Insulin: " + StringUtil.getFormattedValueUS(insulinTotal, 2)) } } private fun decodeEndResultsTotals(entry: PumpHistoryEntry) { val totals = ByteUtil.toInt(entry.head[0].toInt(), entry.head[1].toInt(), entry.head[2].toInt(), - entry.head[3].toInt(), ByteUtil.BitConversion.BIG_ENDIAN) * 0.025 + entry.head[3].toInt(), ByteUtil.BitConversion.BIG_ENDIAN) * 0.025 insulinTotal = totals entry.addDecodedData("Totals", totals) } @@ -80,8 +80,8 @@ class DailyTotalsDTO(var entry: PumpHistoryEntry) { val j1 = ByteUtil.toInt(data[i + 1], data[i]) val k1: Int = ByteUtil.toInt(data[i + 2], data[i + 1], data[i]) println(String.format(Locale.ENGLISH, - "index: %d, number=%d, del/40=%.3f, del/10=%.3f, singular=%d, sing_hex=%s", i, j, j / 40.0, j / 10.0, - data[i], ByteUtil.shortHexString(data[i]))) + "index: %d, number=%d, del/40=%.3f, del/10=%.3f, singular=%d, sing_hex=%s", i, j, j / 40.0, j / 10.0, + data[i], ByteUtil.shortHexString(data[i]))) println(String.format(Locale.ENGLISH, " number[k,j1,k1]=%d / %d /%d, del/40=%.3f, del/40=%.3f, del/40=%.3f", k, j1, k1, k / 40.0, j1 / 40.0, k1 / 40.0)) } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.kt index 1f5cf7db0a..b62a5771fb 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/PumpTimeStampedRecord.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil +import info.nightscout.pump.core.utils.StringUtil /** * Created by andy on 6/2/18. @@ -11,6 +11,6 @@ open class PumpTimeStampedRecord constructor(var atechDateTime: Long = 0) { // var atechDateTime: Long = 0 open fun getFormattedDecimal(value: Double): String? { - return StringUtil.getFormatedValueUS(value, decimalPrecission) + return StringUtil.getFormattedValueUS(value, decimalPrecission) } } \ No newline at end of file diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt index 902e4f410e..5c96e90983 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/TempBasalPair.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import java.util.Locale diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/di/MedtronicModule.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/di/MedtronicModule.kt index 0eebc3bd81..be41dacc47 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/di/MedtronicModule.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/di/MedtronicModule.kt @@ -3,13 +3,13 @@ package info.nightscout.androidaps.plugins.pump.medtronic.di import dagger.Module import dagger.Provides import dagger.android.ContributesAndroidInjector -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicFragment import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUIComm import info.nightscout.androidaps.plugins.pump.medtronic.comm.ui.MedtronicUITask import info.nightscout.androidaps.plugins.pump.medtronic.dialog.MedtronicHistoryActivity import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtronicService +import info.nightscout.pump.core.utils.ByteUtil @Module @Suppress("unused") diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt index 02de0e041f..8f0e046829 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt @@ -1,7 +1,5 @@ package info.nightscout.androidaps.plugins.pump.medtronic.driver -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil @@ -12,7 +10,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.BasalProfileStatus import info.nightscout.androidaps.plugins.pump.medtronic.defs.BatteryType import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst +import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import java.util.Calendar import java.util.GregorianCalendar diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt index 3e8b7024ba..121585fbff 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/service/RileyLinkMedtronicService.kt @@ -4,13 +4,11 @@ import android.content.Intent import android.content.res.Configuration import android.os.Binder import android.os.IBinder -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkTargetFrequency import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.MedtronicPumpPlugin import info.nightscout.androidaps.plugins.pump.medtronic.R import info.nightscout.androidaps.plugins.pump.medtronic.comm.MedtronicCommunicationManager @@ -19,8 +17,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceTyp import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.defs.PumpDeviceState +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.LTag - import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt index 140de43b9f..fd6fea5981 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicUtil.kt @@ -1,14 +1,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.util import com.google.gson.GsonBuilder -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.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.ClockDTO import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.RLHistoryItemMedtronic @@ -16,9 +13,12 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicCommandTy import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicNotificationType import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.pump.core.utils.ByteUtil 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 org.joda.time.LocalTime import java.nio.ByteBuffer import java.nio.ByteOrder diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt index eb308c26f6..914b874bd9 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt @@ -4,18 +4,18 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.TestAapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLoggerTest +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Before import org.junit.Rule diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt index 9a3975647a..1e624a3cbc 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm import android.util.Log import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry @@ -13,6 +12,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceTyp import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.utils.serialisation.SealedClassHelper.gson +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.TestAapsSchedulers import info.nightscout.rx.bus.RxBus import org.junit.Before diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt index dea31405f6..b71a165e9d 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/pump/MedtronicPumpHistoryDecoderUTest.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump //import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.RawHistoryPage import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.pump.core.utils.ByteUtil import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/pump/omnipod-eros/build.gradle b/pump/omnipod-eros/build.gradle index 7b36bb3f18..46fba25214 100644 --- a/pump/omnipod-eros/build.gradle +++ b/pump/omnipod-eros/build.gradle @@ -32,6 +32,7 @@ dependencies { implementation project(':libraries') implementation project(':core') implementation project(':pump:pump-common') + implementation project(':pump:pump-core') implementation project(':pump:rileylink') implementation project(':pump:omnipod-common') implementation project(':interfaces') diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java index d8437851b3..e8993c6611 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodMessage.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.EnumSet; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.CancelDeliveryCommand; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command.GetStatusCommand; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType; @@ -15,6 +14,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Po import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.CrcMismatchException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.MessageDecodingException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.NotEnoughDataException; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java index 4d4d6d7d77..2dd6d61ac3 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/OmnipodPacket.java @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.RLMessage; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodCrc; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PacketType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.CrcMismatchException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.IllegalPacketTypeException; +import info.nightscout.pump.core.utils.ByteUtil; /** * Created by andy on 6/1/18. diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/AcknowledgeAlertsCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/AcknowledgeAlertsCommand.java index 9661957f6d..927401de21 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/AcknowledgeAlertsCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/AcknowledgeAlertsCommand.java @@ -4,11 +4,11 @@ import androidx.annotation.NonNull; import java.util.Collections; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; +import info.nightscout.pump.core.utils.ByteUtil; public class AcknowledgeAlertsCommand extends NonceResyncableMessageBlock { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommand.java index dd6f1f965a..9dc2b574ba 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommand.java @@ -1,17 +1,18 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; import androidx.annotation.NonNull; + import org.joda.time.Duration; import java.util.ArrayList; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.RateEntry; +import info.nightscout.pump.core.utils.ByteUtil; public class BasalScheduleExtraCommand extends MessageBlock { private final boolean acknowledgementBeep; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommand.java index fd94fad4fc..d77d9d4801 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommand.java @@ -4,10 +4,10 @@ import androidx.annotation.NonNull; import org.joda.time.Duration; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; +import info.nightscout.pump.core.utils.ByteUtil; public class BeepConfigCommand extends MessageBlock { private final BeepConfigType beepType; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommand.java index 18fcd7b740..394b943d5e 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommand.java @@ -2,10 +2,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio import org.joda.time.Duration; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; +import info.nightscout.pump.core.utils.ByteUtil; public class BolusExtraCommand extends MessageBlock { private final boolean acknowledgementBeep; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommand.java index 82066bf4b7..4991083fbd 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommand.java @@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio import java.util.EnumSet; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; +import info.nightscout.pump.core.utils.ByteUtil; public class CancelDeliveryCommand extends NonceResyncableMessageBlock { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommand.java index 82daa20180..27284a11a4 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommand.java @@ -4,10 +4,10 @@ import androidx.annotation.NonNull; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertConfiguration; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; +import info.nightscout.pump.core.utils.ByteUtil; public class ConfigureAlertsCommand extends NonceResyncableMessageBlock { private final List configurations; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/DeactivatePodCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/DeactivatePodCommand.java index c811970321..1c6427fd49 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/DeactivatePodCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/DeactivatePodCommand.java @@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio import androidx.annotation.NonNull; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; +import info.nightscout.pump.core.utils.ByteUtil; public class DeactivatePodCommand extends NonceResyncableMessageBlock { private int nonce; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/FaultConfigCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/FaultConfigCommand.java index dc8fcec55a..0cf2c6bde3 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/FaultConfigCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/FaultConfigCommand.java @@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio import androidx.annotation.NonNull; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; +import info.nightscout.pump.core.utils.ByteUtil; public class FaultConfigCommand extends NonceResyncableMessageBlock { private final byte tab5sub16; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommand.java index 68195c839e..44b8f46609 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommand.java @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio import org.joda.time.Duration; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.NonceResyncableMessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; @@ -12,6 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.sc import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BolusDeliverySchedule; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.DeliverySchedule; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.TempBasalDeliverySchedule; +import info.nightscout.pump.core.utils.ByteUtil; public class SetInsulinScheduleCommand extends NonceResyncableMessageBlock { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommand.java index 689e7be301..43a82f4a2f 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommand.java @@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio import org.joda.time.DateTime; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; +import info.nightscout.pump.core.utils.ByteUtil; public class SetupPodCommand extends MessageBlock { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommand.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommand.java index 0a25712e56..c493100607 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommand.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommand.java @@ -5,11 +5,11 @@ import org.joda.time.Duration; import java.util.ArrayList; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.RateEntry; +import info.nightscout.pump.core.utils.ByteUtil; public class TempBasalExtraCommand extends MessageBlock { private final boolean acknowledgementBeep; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponse.java index ebdab8f912..823646ec34 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponse.java @@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio import androidx.annotation.NonNull; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; +import info.nightscout.pump.core.utils.ByteUtil; public class ErrorResponse extends MessageBlock { public static final byte ERROR_RESPONSE_CODE_BAD_NONCE = (byte) 0x14; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponse.java index a844b52862..e922ef45b4 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponse.java @@ -5,13 +5,13 @@ import org.joda.time.Duration; import java.io.ByteArrayOutputStream; import java.io.IOException; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; +import info.nightscout.pump.core.utils.ByteUtil; public class StatusResponse extends MessageBlock implements StatusUpdatableResponse { private static final int MESSAGE_LENGTH = 10; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java index 374f69d0cb..08ca3e393e 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponse.java @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FirmwareVersion; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; +import info.nightscout.pump.core.utils.ByteUtil; public class VersionResponse extends MessageBlock { private static final int ASSIGN_ADDRESS_VERSION_RESPONSE_LENGTH = 0x15; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlerts.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlerts.java index 8ac03aa1a9..f2dac2d9a7 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlerts.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlerts.java @@ -5,10 +5,10 @@ import org.joda.time.Duration; import java.util.ArrayList; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoActiveAlerts extends PodInfo { private static final int MINIMUM_MESSAGE_LENGTH = 11; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLog.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLog.java index aa2353df6f..2650b4bdf7 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLog.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLog.java @@ -6,9 +6,9 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoDataLog extends PodInfo { private static final int MINIMUM_MESSAGE_LENGTH = 8; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatus.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatus.java index 3a9dea9178..2fb56f6044 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatus.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatus.java @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communicatio import org.joda.time.Duration; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusUpdatableResponse; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus; @@ -11,6 +10,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Fa import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoDetailedStatus extends PodInfo implements StatusUpdatableResponse { private static final int MINIMUM_MESSAGE_LENGTH = 21; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoOlderPulseLog.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoOlderPulseLog.java index b104fbc69d..84e632e0d9 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoOlderPulseLog.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoOlderPulseLog.java @@ -6,8 +6,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoOlderPulseLog extends PodInfo { private static final int MINIMUM_MESSAGE_LENGTH = 3; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLog.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLog.java index 8ca80ffe22..a5036c7d4c 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLog.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLog.java @@ -6,8 +6,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoRecentPulseLog extends PodInfo { private static final int MINIMUM_MESSAGE_LENGTH = 3; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponse.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponse.java index 20c2155477..1480d43f9a 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponse.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponse.java @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.MessageBlockType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoResponse extends MessageBlock { private final PodInfoType subType; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/AlertConfiguration.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/AlertConfiguration.java index c9518b0608..5451a18fd0 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/AlertConfiguration.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/AlertConfiguration.java @@ -1,9 +1,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition; import androidx.annotation.NonNull; + import org.joda.time.Duration; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; public class AlertConfiguration { private final AlertType alertType; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/ErrorEventInfo.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/ErrorEventInfo.java index 2e4c4f9957..dd54d1b090 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/ErrorEventInfo.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/ErrorEventInfo.java @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; public final class ErrorEventInfo { private final boolean insulinStateTableCorruption; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalDeliverySchedule.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalDeliverySchedule.java index 56ee29c546..5103f8858e 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalDeliverySchedule.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalDeliverySchedule.java @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.s import androidx.annotation.NonNull; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable; +import info.nightscout.pump.core.utils.ByteUtil; public class BasalDeliverySchedule extends DeliverySchedule implements IRawRepresentable { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalTableEntry.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalTableEntry.java index 5fbb5a20b1..4b9ef1588d 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalTableEntry.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BasalTableEntry.java @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.s import androidx.annotation.NonNull; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable; +import info.nightscout.pump.core.utils.ByteUtil; public class BasalTableEntry implements IRawRepresentable { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BolusDeliverySchedule.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BolusDeliverySchedule.java index a4c98cae00..e5bbf29634 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BolusDeliverySchedule.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/BolusDeliverySchedule.java @@ -4,9 +4,9 @@ import androidx.annotation.NonNull; import org.joda.time.Duration; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; +import info.nightscout.pump.core.utils.ByteUtil; public class BolusDeliverySchedule extends DeliverySchedule implements IRawRepresentable { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/RateEntry.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/RateEntry.java index 150e32470d..24798e229b 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/RateEntry.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/RateEntry.java @@ -1,15 +1,15 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule; +import static info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants.BASAL_STEP_DURATION; + import org.joda.time.Duration; import java.util.ArrayList; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; - -import static info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants.BASAL_STEP_DURATION; +import info.nightscout.pump.core.utils.ByteUtil; public class RateEntry implements IRawRepresentable { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/TempBasalDeliverySchedule.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/TempBasalDeliverySchedule.java index 5fbf4b43b1..ca699991a2 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/TempBasalDeliverySchedule.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/definition/schedule/TempBasalDeliverySchedule.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.IRawRepresentable; +import info.nightscout.pump.core.utils.ByteUtil; public class TempBasalDeliverySchedule extends DeliverySchedule implements IRawRepresentable { diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/exception/NotEnoughDataException.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/exception/NotEnoughDataException.java index f656c706bc..bb3cb6ea8d 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/exception/NotEnoughDataException.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/exception/NotEnoughDataException.java @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; public class NotEnoughDataException extends OmnipodException { private final byte[] data; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index f9e9c28bd0..27f947f3ac 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -15,20 +15,14 @@ import javax.inject.Singleton; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.data.DetailedBolusInfo; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; -import info.nightscout.interfaces.ActivityNames; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -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.rx.events.EventOverviewBolusProgress; -import info.nightscout.interfaces.notifications.Notification; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys; @@ -75,14 +69,20 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.Ero import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; -import info.nightscout.shared.utils.T; +import info.nightscout.interfaces.ActivityNames; +import info.nightscout.interfaces.data.PumpEnactResult; +import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.Event; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventRefreshOverview; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.T; import io.reactivex.rxjava3.subjects.SingleSubject; @Singleton diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java index 676a9626bc..3e53b9da90 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/manager/OmnipodRileyLinkCommunicationManager.java @@ -8,12 +8,10 @@ import java.util.List; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RLMessageType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkBLEError; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action.OmnipodAction; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.MessageBlock; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.OmnipodMessage; @@ -43,6 +41,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Ril import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnexpectedException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnreachableException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.ErosPodStateManager; +import info.nightscout.pump.core.defs.PumpDeviceState; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.LTag; /** diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java index 8f7f9d3183..ccc51ca0fb 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/rileylink/service/RileyLinkOmnipodService.java @@ -9,7 +9,6 @@ import org.apache.commons.lang3.StringUtils; import javax.inject.Inject; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType; @@ -20,6 +19,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugi import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; +import info.nightscout.pump.core.defs.PumpDeviceState; import info.nightscout.rx.logging.LTag; diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java index 947df39bde..60733e458f 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BasalScheduleExtraCommandTest.java @@ -1,5 +1,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import org.joda.time.Duration; import org.junit.Test; @@ -7,15 +12,10 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalScheduleEntry; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.RateEntry; - -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import info.nightscout.pump.core.utils.ByteUtil; public class BasalScheduleExtraCommandTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommandTest.java index a777c5d082..995301fe6c 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BeepConfigCommandTest.java @@ -1,12 +1,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; + import org.joda.time.Duration; import org.junit.Test; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType; - -import static org.junit.Assert.assertArrayEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class BeepConfigCommandTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommandTest.java index f37f6f09c7..7faacf7797 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/BolusExtraCommandTest.java @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; + import org.joda.time.Duration; import org.junit.Test; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; - -import static org.junit.Assert.assertArrayEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class BolusExtraCommandTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommandTest.java index c97a199340..1d00d152df 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/CancelDeliveryCommandTest.java @@ -1,14 +1,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; + import org.junit.Test; import java.util.EnumSet; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryType; - -import static org.junit.Assert.assertArrayEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class CancelDeliveryCommandTest { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommandTest.java index 8937911a03..7ad4116172 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/ConfigureAlertsCommandTest.java @@ -1,12 +1,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; + import org.joda.time.Duration; import org.junit.Test; import java.util.Arrays; import java.util.Collections; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertConfiguration; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertType; @@ -14,8 +15,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Be import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.TimerAlertTrigger; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.UnitsRemainingAlertTrigger; - -import static org.junit.Assert.assertArrayEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class ConfigureAlertsCommandTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/GetStatusCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/GetStatusCommandTest.java index 2a92300f1a..b1074bc967 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/GetStatusCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/GetStatusCommandTest.java @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; + import org.junit.Test; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; - -import static org.junit.Assert.assertArrayEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class GetStatusCommandTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommandTest.java index 03a0e3175e..c24f6822b2 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetInsulinScheduleCommandTest.java @@ -1,5 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; + import org.joda.time.Duration; import org.junit.Test; @@ -7,12 +9,10 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalScheduleEntry; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BolusDeliverySchedule; - -import static org.junit.Assert.assertArrayEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class SetInsulinScheduleCommandTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommandTest.java index 07f91df881..439c7c2384 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/SetupPodCommandTest.java @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; + import org.joda.time.DateTime; import org.junit.Test; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; - -import static org.junit.Assert.assertArrayEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class SetupPodCommandTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommandTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommandTest.java index 69da4a64fc..6cc543ec9b 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommandTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/command/TempBasalExtraCommandTest.java @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.command; +import static org.junit.Assert.assertArrayEquals; + import org.joda.time.Duration; import org.junit.Test; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; - -import static org.junit.Assert.assertArrayEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class TempBasalExtraCommandTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponseTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponseTest.java index c61e7fded3..94eed25065 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponseTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/ErrorResponseTest.java @@ -1,15 +1,15 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response; -import org.junit.Test; - -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; - import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import org.junit.Test; + +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; +import info.nightscout.pump.core.utils.ByteUtil; + public class ErrorResponseTest { @Test public void testGetRawData() { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponseTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponseTest.java index bbbc4d0a12..ac78f56da4 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponseTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/StatusResponseTest.java @@ -1,19 +1,19 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response; -import org.joda.time.Duration; -import org.junit.Test; - -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; - import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import org.joda.time.Duration; +import org.junit.Test; + +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSlot; +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus; +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants; +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; +import info.nightscout.pump.core.utils.ByteUtil; + public class StatusResponseTest { // TODO add /extend tests diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponseTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponseTest.java index 0114d14fd6..d0bcb5b833 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponseTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/VersionResponseTest.java @@ -1,10 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response; -import org.junit.Test; - -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; - import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -12,6 +7,11 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import org.junit.Test; + +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; +import info.nightscout.pump.core.utils.ByteUtil; + public class VersionResponseTest { @Test public void testRawDataAssignAddressVersionResponse() { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlertsTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlertsTest.java index 21468200e1..617824448f 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlertsTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoActiveAlertsTest.java @@ -1,14 +1,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import org.joda.time.Duration; import org.junit.Test; import java.util.List; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoActiveAlertsTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java index b3b0dec638..91656418d6 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDataLogTest.java @@ -1,13 +1,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import org.joda.time.Duration; import org.junit.Test; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoDataLogTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatusTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatusTest.java index fc451eda07..17f9f8c3aa 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatusTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoDetailedStatusTest.java @@ -1,19 +1,19 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo; -import org.joda.time.Duration; -import org.junit.Test; - -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ErrorEventInfo; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; - import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import org.joda.time.Duration; +import org.junit.Test; + +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.DeliveryStatus; +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ErrorEventInfo; +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus; +import info.nightscout.pump.core.utils.ByteUtil; + // From https://github.com/ps2/rileylink_ios/blob/omnipod-testing/OmniKitTests/PodInfoTests.swift public class PodInfoDetailedStatusTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java index 3cd87634f7..fe8a8a7c77 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoFaultAndInitializationTimeTest.java @@ -1,15 +1,15 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import org.joda.time.DateTime; import org.joda.time.Duration; import org.junit.Assert; import org.junit.Test; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.FaultEventCode; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoFaultAndInitializationTimeTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLogTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLogTest.java index d499a4b4b0..b782385dea 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLogTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoRecentPulseLogTest.java @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo; +import static org.junit.Assert.assertEquals; + import org.junit.Test; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; - -import static org.junit.Assert.assertEquals; +import info.nightscout.pump.core.utils.ByteUtil; public class PodInfoRecentPulseLogTest { @Test diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponseTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponseTest.java index df85b00d83..c420084fdb 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponseTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/message/response/podinfo/PodInfoResponseTest.java @@ -1,17 +1,15 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; - -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; - import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import org.junit.Assert; +import org.junit.Test; + +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodInfoType; +import info.nightscout.pump.core.utils.ByteUtil; + public class PodInfoResponseTest { @Test public void testRawData() { diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDriverState.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDriverState.kt index 6f6124005d..02cdfe1d32 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDriverState.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDriverState.kt @@ -15,11 +15,9 @@ enum class PumpDriverState(var resourceId: Int) { Ready(R.string.pump_status_ready), Busy(R.string.pump_status_busy), // Suspended(R.string.pump_status_suspended), // - Sleeping(R.string.pump_status_sleeping), ExecutingCommand(R.string.pump_status_executing_command), Disconnecting(R.string.disconnecting), - Disconnected(R.string.disconnected), - ErrorCommunicatingWithPump(R.string.pump_status_error_comm); + Disconnected(R.string.disconnected); fun isConnected(): Boolean = this == Connected || this == Initialized || this == Busy || this == Suspended fun isInitialized(): Boolean = this == Initialized || this == Busy || this == Suspended diff --git a/pump/pump-common/src/main/res/values/strings.xml b/pump/pump-common/src/main/res/values/strings.xml index d51c9755f6..e705e33005 100644 --- a/pump/pump-common/src/main/res/values/strings.xml +++ b/pump/pump-common/src/main/res/values/strings.xml @@ -11,14 +11,6 @@ - Never contacted - Waking up - Error with communication - Timeout on communication - Pump unreachable - Invalid configuration - Active - Sleeping Not initialized Initialized Encrypting communication diff --git a/pump/pump-core/.gitignore b/pump/pump-core/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/pump/pump-core/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/pump/pump-core/build.gradle b/pump/pump-core/build.gradle new file mode 100644 index 0000000000..eb744c9963 --- /dev/null +++ b/pump/pump-core/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} + +apply from: "${project.rootDir}/core/android_dependencies.gradle" +apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/test_dependencies.gradle" +apply from: "${project.rootDir}/core/jacoco_global.gradle" +android { + namespace 'info.nightscout.pump.core' +} + +dependencies { + api "net.danlew:android.joda:$joda_version" +} diff --git a/pump/pump-core/consumer-rules.pro b/pump/pump-core/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pump/pump-core/proguard-rules.pro b/pump/pump-core/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/pump/pump-core/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/pump/pump-core/src/main/AndroidManifest.xml b/pump/pump-core/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..44008a4332 --- /dev/null +++ b/pump/pump-core/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.kt b/pump/pump-core/src/main/java/info/nightscout/pump/core/defs/PumpDeviceState.kt similarity index 83% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.kt rename to pump/pump-core/src/main/java/info/nightscout/pump/core/defs/PumpDeviceState.kt index 803d1a8902..9ebe3463e3 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpDeviceState.kt +++ b/pump/pump-core/src/main/java/info/nightscout/pump/core/defs/PumpDeviceState.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.plugins.pump.common.defs +package info.nightscout.pump.core.defs -import info.nightscout.androidaps.plugins.pump.common.R +import info.nightscout.pump.core.R enum class PumpDeviceState(var resourceId: Int) { diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ByteUtil.java similarity index 99% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java rename to pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ByteUtil.java index ac4f6d24af..fef889df2e 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ByteUtil.java +++ b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ByteUtil.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.common.utils; +package info.nightscout.pump.core.utils; import java.nio.ByteBuffer; import java.util.ArrayList; diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/StringUtil.java similarity index 79% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java rename to pump/pump-core/src/main/java/info/nightscout/pump/core/utils/StringUtil.java index a2050a7273..73e12d8d17 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/StringUtil.java +++ b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/StringUtil.java @@ -1,22 +1,19 @@ -package info.nightscout.androidaps.plugins.pump.common.utils; +package info.nightscout.pump.core.utils; import org.joda.time.LocalDateTime; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; -import info.nightscout.shared.utils.DateUtil; - /** * Created by geoff on 4/28/15. * modified by Andy */ public class StringUtil { - public static DecimalFormat[] DecimalFormaters = { + public static DecimalFormat[] DecimalFormatters = { new DecimalFormat("#0"), new DecimalFormat("#0.0"), new DecimalFormat("#0.00"), new DecimalFormat("#0.000")}; @@ -44,7 +41,7 @@ public class StringUtil { public static String testJoin() { - ArrayList ra = new ArrayList(); + ArrayList ra = new ArrayList<>(); ra.add("one"); ra.add("two"); ra.add("three"); @@ -69,8 +66,8 @@ public class StringUtil { } - public static String getFormatedValueUS(Number value, int decimals) { - return DecimalFormaters[decimals].format(value).replace(",", "."); + public static String getFormattedValueUS(Number value, int decimals) { + return DecimalFormatters[decimals].format(value).replace(",", "."); } @@ -85,9 +82,8 @@ public class StringUtil { } - public static String toDateTimeString(DateUtil dateUtil, LocalDateTime localDateTime) { - return dateUtil.dateAndTimeAndSecondsString(localDateTime.toDateTime().getMillis()); - //return localDateTime.toString("dd.MM.yyyy HH:mm:ss"); + public static String toDateTimeString(LocalDateTime localDateTime) { + return localDateTime.toString("dd.MM.yyyy HH:mm:ss"); } diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ThreadUtil.java similarity index 86% rename from pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java rename to pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ThreadUtil.java index d1781da72a..66484701a9 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ThreadUtil.java +++ b/pump/pump-core/src/main/java/info/nightscout/pump/core/utils/ThreadUtil.java @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.pump.common.utils; +package info.nightscout.pump.core.utils; /** * Created by geoff on 5/27/16. diff --git a/pump/pump-core/src/main/res/values/strings.xml b/pump/pump-core/src/main/res/values/strings.xml new file mode 100644 index 0000000000..d1ffb7471e --- /dev/null +++ b/pump/pump-core/src/main/res/values/strings.xml @@ -0,0 +1,14 @@ + + + + + Never contacted + Sleeping + Waking up + Active + Error with communication + Timeout on communication + Pump unreachable + Invalid configuration + + diff --git a/pump/rileylink/build.gradle b/pump/rileylink/build.gradle index eb5621dc5a..5d7e629096 100644 --- a/pump/rileylink/build.gradle +++ b/pump/rileylink/build.gradle @@ -20,5 +20,6 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':core') implementation project(':pump:pump-common') + implementation project(':pump:pump-core') implementation project(':interfaces') } diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt index 1e6cf11a25..efabc75863 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/events/EventRileyLinkDeviceStatusChange.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.common.events import info.nightscout.androidaps.events.EventStatus -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice +import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.shared.interfaces.ResourceHelper open class EventRileyLinkDeviceStatusChange : EventStatus { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java index 6bcc3dd689..341348d971 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/RileyLinkCommunicationManager.java @@ -6,7 +6,6 @@ import javax.inject.Inject; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.interfaces.ActivePlugin; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.FrequencyScanResults; @@ -21,8 +20,9 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.ServiceTaskExecutor; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.tasks.WakeAndTuneTask; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.interfaces.utils.Round; +import info.nightscout.pump.core.defs.PumpDeviceState; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; import info.nightscout.shared.sharedPreferences.SP; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java index 1350d03aab..388378d254 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpy.java @@ -12,7 +12,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; @@ -32,13 +31,14 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.Rile import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkTargetFrequency; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operations.BLECommOperationResult; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil; -import info.nightscout.androidaps.plugins.pump.common.utils.ThreadUtil; +import info.nightscout.pump.core.utils.ByteUtil; +import info.nightscout.pump.core.utils.StringUtil; +import info.nightscout.pump.core.utils.ThreadUtil; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventRefreshOverview; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; /** diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt index c064653472..b56774e985 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFSpyReader.kt @@ -4,8 +4,8 @@ import android.os.SystemClock import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operations.BLECommOperationResult -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil -import info.nightscout.androidaps.plugins.pump.common.utils.ThreadUtil +import info.nightscout.pump.core.utils.ByteUtil +import info.nightscout.pump.core.utils.ThreadUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import java.util.UUID diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt index 5e1103458f..d56184dc6a 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RileyLinkBLE.kt @@ -15,7 +15,6 @@ import android.content.pm.PackageManager import android.os.Build import android.os.SystemClock import androidx.core.content.ContextCompat -import info.nightscout.interfaces.Config import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes @@ -28,8 +27,9 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operation import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil -import info.nightscout.androidaps.plugins.pump.common.utils.ThreadUtil +import info.nightscout.interfaces.Config +import info.nightscout.pump.core.utils.ByteUtil +import info.nightscout.pump.core.utils.ThreadUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java index d0e4e6de74..159b792c0e 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/command/SendAndListen.java @@ -10,7 +10,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.Radi import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkCommandType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; public class SendAndListen extends RileyLinkCommand { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java index ab7b5d6400..6486dd85ba 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioPacket.java @@ -6,8 +6,8 @@ import javax.inject.Inject; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.CRC; +import info.nightscout.pump.core.utils.ByteUtil; /** * Created by geoff on 5/22/16. diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java index c04163dcec..1fbbc319cb 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/RadioResponse.java @@ -12,8 +12,8 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.Rile import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkCommandType; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkFirmwareVersion; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; import info.nightscout.androidaps.plugins.pump.common.utils.CRC; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java index ddde11e6b5..199120c9a3 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bAbstract.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.encoding; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.AAPSLogger; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java index 0b89d85a34..2def87cc09 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/data/encoding/Encoding4b6bGeoff.java @@ -6,7 +6,7 @@ import java.util.Locale; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkBLEError; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.logging.AAPSLogger; /** diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt index fd4aa416cb..25d9f91c78 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/device/OrangeLinkImpl.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLink import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.operations.BLECommOperationResult import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil +import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java index 74defd7a00..d916723cdf 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/data/RLHistoryItem.java @@ -2,10 +2,10 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data; import org.joda.time.LocalDateTime; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; +import info.nightscout.pump.core.defs.PumpDeviceState; import info.nightscout.shared.interfaces.ResourceHelper; diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt index e82d3cec56..beebdeed8f 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusGeneralFragment.kt @@ -6,16 +6,16 @@ import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusGeneralBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData -import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil -import info.nightscout.shared.utils.DateUtil +import info.nightscout.pump.core.utils.StringUtil import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.joda.time.LocalDateTime import javax.inject.Inject @@ -85,7 +85,7 @@ class RileyLinkStatusGeneralFragment : DaggerFragment() { } val lastConnectionTimeMillis = rileyLinkPumpDevice.lastConnectionTimeMillis if (lastConnectionTimeMillis == 0L) binding.lastDeviceContact.text = rh.gs(R.string.riley_link_ble_config_connected_never) - else binding.lastDeviceContact.text = StringUtil.toDateTimeString(dateUtil, LocalDateTime(lastConnectionTimeMillis)) + else binding.lastDeviceContact.text = StringUtil.toDateTimeString(LocalDateTime(lastConnectionTimeMillis)) } companion object { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt index 6925a1783c..8e66321068 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/dialog/RileyLinkStatusHistoryFragment.kt @@ -7,14 +7,14 @@ import android.view.ViewGroup import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusHistoryBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileylinkStatusHistoryItemBinding -import info.nightscout.shared.utils.DateUtil +import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject class RileyLinkStatusHistoryFragment : DaggerFragment() { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt index 88293787e1..758b1686a3 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt @@ -7,8 +7,6 @@ import android.content.Intent import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil @@ -17,9 +15,11 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLink import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState +import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import java.util.Locale import javax.inject.Inject diff --git a/pump/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFToolsParametrizedUTest.java b/pump/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFToolsParametrizedUTest.java index 42ed577d43..5f7393d6bd 100644 --- a/pump/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFToolsParametrizedUTest.java +++ b/pump/rileylink/src/test/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/ble/RFToolsParametrizedUTest.java @@ -11,7 +11,7 @@ import java.util.Arrays; import java.util.Collection; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.encoding.Encoding4b6bGeoff; -import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil; +import info.nightscout.pump.core.utils.ByteUtil; /** * Created by andy on 11/21/18. diff --git a/settings.gradle b/settings.gradle index df262404ac..3ab7a61408 100644 --- a/settings.gradle +++ b/settings.gradle @@ -24,6 +24,7 @@ include ':pump:omnipod-common' include ':pump:omnipod-eros' include ':pump:omnipod-dash' include ':pump:pump-common' +include ':pump:pump-core' include ':pump:rileylink' include ':openhumans' include ':automation' From 34320ad8ca10d791852176343d42ee87dd21116a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Nov 2022 17:34:47 +0100 Subject: [PATCH 13/42] 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: From f43e0902966cfcde02e6179ee1711652ed278363 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 8 Nov 2022 21:17:46 +0100 Subject: [PATCH 14/42] move more to interfaces module --- .../nightscout/androidaps/MainActivity.kt | 4 +- .../info/nightscout/androidaps/MainApp.kt | 4 +- .../activities/MyPreferenceFragment.kt | 2 +- .../activities/SingleFragmentActivity.kt | 2 +- .../nightscout/androidaps/di/AppModule.kt | 8 +- .../androidaps/di/PluginsListModule.kt | 2 +- .../androidaps/dialogs/ExtendedBolusDialog.kt | 2 +- .../androidaps/dialogs/FillDialog.kt | 2 +- .../androidaps/dialogs/InsulinDialog.kt | 4 +- .../androidaps/dialogs/LoopDialog.kt | 10 +- .../androidaps/dialogs/TempBasalDialog.kt | 4 +- .../androidaps/dialogs/TempTargetDialog.kt | 2 +- .../androidaps/dialogs/TreatmentDialog.kt | 2 +- .../androidaps/dialogs/WizardDialog.kt | 4 +- .../plugins/aps/loop/LoopFragment.kt | 2 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 6 +- .../openAPSAMA/DetermineBasalAdapterAMAJS.kt | 2 +- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 4 +- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 2 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 4 +- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 2 +- .../configBuilder/ConfigBuilderFragment.kt | 5 +- .../configBuilder/ConfigBuilderPlugin.kt | 6 +- .../plugins/configBuilder/PluginStore.kt | 8 +- .../configBuilder/ProfileFunctionImpl.kt | 2 +- .../objectives/ObjectivesPlugin.kt | 4 +- .../objectives/objectives/Objective0.kt | 2 +- .../objectives/objectives/Objective5.kt | 2 +- .../constraints/safety/SafetyPlugin.kt | 6 +- .../plugins/general/actions/ActionsPlugin.kt | 2 +- .../dataBroadcaster/DataBroadcastPlugin.kt | 2 +- .../maintenance/ImportExportPrefsImpl.kt | 2 +- .../maintenance/MaintenanceFragment.kt | 2 +- .../general/maintenance/MaintenancePlugin.kt | 2 +- .../general/overview/OverviewFragment.kt | 8 +- .../general/overview/OverviewPlugin.kt | 4 +- .../general/overview/StatusLightHandler.kt | 2 +- .../general/overview/graphData/GraphData.kt | 2 +- .../PersistentNotificationPlugin.kt | 4 +- .../plugins/general/wear/WearPlugin.kt | 2 +- .../wear/wearintegration/DataHandlerMobile.kt | 6 +- .../IobCobCalculatorPlugin.kt | 2 +- .../sensitivity/AbstractSensitivityPlugin.kt | 2 +- .../androidaps/plugins/source/AidexPlugin.kt | 2 +- .../androidaps/plugins/source/DexcomPlugin.kt | 2 +- .../plugins/source/EversensePlugin.kt | 2 +- .../androidaps/plugins/source/GlimpPlugin.kt | 2 +- .../plugins/source/GlunovoPlugin.kt | 2 +- .../plugins/source/IntelligoPlugin.kt | 2 +- .../androidaps/plugins/source/MM640gPlugin.kt | 2 +- .../plugins/source/PoctechPlugin.kt | 2 +- .../plugins/source/RandomBgPlugin.kt | 2 +- .../androidaps/plugins/source/TomatoPlugin.kt | 2 +- .../androidaps/plugins/source/XdripPlugin.kt | 2 +- .../androidaps/receivers/KeepAliveWorker.kt | 2 +- .../androidaps/setupwizard/SWDefinition.kt | 4 +- .../elements/SWEditNumberWithUnits.kt | 2 +- .../setupwizard/elements/SWPlugin.kt | 2 +- .../NotificationHolderImpl.kt | 2 +- .../resources/IconsProviderImplementation.kt | 2 +- .../androidaps/utils/tabs/TabPageAdapter.kt | 4 +- .../androidaps/utils/wizard/BolusWizard.kt | 6 +- .../utils/wizard/QuickWizardEntry.kt | 2 +- .../workflow/PrepareBgDataWorker.kt | 2 +- .../workflow/PrepareTreatmentsDataWorker.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 4 +- .../interfaces/ConstraintsCheckerTest.kt | 3 + .../plugins/aps/loop/LoopPluginTest.kt | 2 +- .../objectives/ObjectivesPluginTest.kt | 2 +- .../constraints/safety/SafetyPluginTest.kt | 4 +- .../utils/wizard/BolusWizardTest.kt | 6 +- .../nightscout/automation/AutomationPlugin.kt | 2 +- .../automation/actions/ActionLoopDisable.kt | 4 +- .../automation/actions/ActionLoopEnable.kt | 4 +- .../automation/actions/ActionLoopResume.kt | 2 +- .../actions/ActionStartTempTarget.kt | 2 +- .../nightscout/automation/elements/InputBg.kt | 2 +- .../automation/elements/InputTempTarget.kt | 2 +- .../automation/triggers/TriggerBg.kt | 2 +- .../automation/triggers/TriggerDelta.kt | 2 +- .../triggers/TriggerTempTargetValue.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +- .../automation/AutomationEventTest.kt | 2 +- .../actions/ActionCarePortalEventTest.kt | 2 +- .../actions/ActionStartTempTargetTest.kt | 2 +- .../automation/actions/ActionsTestBase.kt | 8 +- .../automation/elements/InputBgTest.kt | 2 +- .../elements/InputTempTargetTest.kt | 2 +- .../automation/triggers/TriggerBgTest.kt | 2 +- .../automation/triggers/TriggerDeltaTest.kt | 2 +- .../triggers/TriggerTempTargetValueTest.kt | 2 +- .../DaggerAppCompatActivityWithResult.kt | 2 +- .../androidaps/data/DetailedBolusInfo.kt | 2 +- .../androidaps/data/ProfileSealed.kt | 2 +- .../nightscout/androidaps/data/PureProfile.kt | 2 +- .../extensions/GlucoseValueExtension.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 2 +- .../extensions/PumpTypeExtension.kt | 121 ++++++++++++ .../extensions/TemporaryTargetExtension.kt | 2 +- .../extensions/TherapyEventExtension.kt | 2 +- .../androidaps/interfaces/ActivePlugin.kt | 4 + .../androidaps/interfaces/Constraints.kt | 1 + .../nightscout/androidaps/interfaces/Loop.kt | 1 + .../androidaps/interfaces/Profile.kt | 1 + .../androidaps/interfaces/ProfileFunction.kt | 1 + .../nightscout/androidaps/interfaces/Pump.kt | 5 +- .../androidaps/interfaces/PumpPluginBase.kt | 1 + .../androidaps/interfaces/PumpSync.kt | 2 +- .../androidaps/plugins/aps/loop/APSResult.kt | 4 +- .../versionChecker/VersionCheckerUtils.kt | 1 + .../graphExtensions/GlucoseValueDataPoint.kt | 2 +- .../InMemoryGlucoseValueDataPoint.kt | 2 +- .../androidaps/utils/DefaultValueHelper.kt | 2 +- .../utils/ui/TargetBgProfileGraph.kt | 2 +- .../userEntry/UserEntryPresentationHelper.kt | 36 ++-- core/src/main/res/values/strings.xml | 3 - .../nightscout/androidaps/TestPumpPlugin.kt | 4 +- .../androidaps/data/ConstraintTest.kt | 2 +- .../nightscout/androidaps/data/ProfileTest.kt | 2 +- .../interfaces/PumpDescriptionTest.kt | 3 +- .../plugins/aps/loop/APSResultTest.kt | 4 +- .../implementation/AndroidPermissionImpl.kt | 2 +- .../implementation/BolusTimerImpl.kt | 2 +- .../implementation/CarbTimerImpl.kt | 2 +- .../implementation/XDripBroadcastImpl.kt | 2 +- .../constraints/ConstraintsImpl.kt | 2 +- .../pump/PumpSyncImplementation.kt | 7 +- .../queue/CommandQueueImplementation.kt | 2 +- .../queue/commands/CommandLoadEvents.kt | 2 +- .../queue/commands/CommandLoadHistory.kt | 2 +- .../queue/commands/CommandSetProfile.kt | 2 +- .../queue/commands/CommandSetUserSettings.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 4 +- .../implementation/BolusTimerImplTest.kt | 2 +- .../implementation/CarbTimerImplTest.kt | 2 +- .../queue/CommandQueueImplementationTest.kt | 2 +- .../implementation/queue/QueueThreadTest.kt | 4 +- .../pump/insight/LocalInsightPlugin.java | 6 +- interfaces/build.gradle | 3 +- .../nightscout}/interfaces/ConfigBuilder.kt | 4 +- .../info/nightscout}/interfaces/Constraint.kt | 2 +- .../java/info/nightscout}/interfaces/Dana.kt | 2 +- .../nightscout}/interfaces/GlucoseUnit.kt | 4 +- .../nightscout}/interfaces/IconsProvider.kt | 2 +- .../interfaces/ImportExportPrefs.kt | 2 +- .../info/nightscout}/interfaces/NsClient.kt | 2 +- .../info/nightscout}/interfaces/Overview.kt | 3 +- .../info/nightscout}/interfaces/PluginBase.kt | 4 +- .../nightscout}/interfaces/PluginFragment.kt | 2 +- .../info/nightscout/interfaces/PluginType.kt | 2 +- .../java/info/nightscout}/interfaces/Sync.kt | 2 +- .../versionChecker/AllowedVersions.kt | 2 +- .../interfaces/pump}/PumpDescription.kt | 6 +- .../nightscout/interfaces/pump}/PumpType.kt | 177 ++++++------------ interfaces/src/main/res/values/strings.xml | 3 + .../general/openhumans/OpenHumansUploader.kt | 2 +- .../configBuilder/RunningConfiguration.kt | 6 +- .../bgQualityCheck/BgQualityCheckPlugin.kt | 4 +- .../constraints/dstHelper/DstHelperPlugin.kt | 4 +- .../phoneChecker/PhoneCheckerPlugin.kt | 2 +- .../SignatureVerifierPlugin.kt | 4 +- .../storage/StorageConstraintPlugin.kt | 4 +- .../versionChecker/VersionCheckerPlugin.kt | 4 +- .../general/autotune/AutotuneFragment.kt | 2 +- .../general/autotune/AutotunePlugin.kt | 2 +- .../general/autotune/data/ATProfile.kt | 2 +- .../plugins/general/food/FoodPlugin.kt | 2 +- .../notifications/NotificationStore.kt | 2 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 6 +- .../general/themes/ThemeSwitcherPlugin.kt | 2 +- .../xdripStatusline/StatusLinePlugin.kt | 2 +- .../plugins/insulin/InsulinOrefBasePlugin.kt | 2 +- .../plugins/profile/ProfileFragment.kt | 2 +- .../plugins/profile/ProfilePlugin.kt | 4 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 4 +- .../plugins/source/BGSourceFragment.kt | 2 +- .../plugins/source/NSClientSourcePlugin.kt | 2 +- .../plugins/sync/nsShared/NSClientFragment.kt | 6 +- .../plugins/sync/nsShared/StoreDataForDb.kt | 2 +- .../nsShared/events/EventNSClientNewLog.kt | 2 +- .../nsShared/events/EventNSClientStatus.kt | 2 +- .../plugins/sync/nsclient/NSClientPlugin.kt | 6 +- .../nsclient/data/NSDeviceStatusHandler.kt | 2 +- .../EffectiveProfileSwitchExtension.kt | 2 +- .../extensions/TemporaryTargetExtension.kt | 2 +- .../extensions/TherapyEventExtension.kt | 2 +- .../sync/nsclient/services/NSClientService.kt | 2 +- .../nsclient/workers/NSClientAddAckWorker.kt | 2 +- .../workers/NSClientUpdateRemoveAckWorker.kt | 2 +- .../sync/nsclientV3/NSClientV3Plugin.kt | 6 +- .../sync/nsclientV3/workers/LoadBgWorker.kt | 2 +- .../workers/LoadDeviceStatusWorker.kt | 2 +- .../workers/LoadTreatmentsWorker.kt | 2 +- .../plugins/sync/tidepool/TidepoolPlugin.kt | 4 +- .../nightscout/androidaps/TestPumpPlugin.kt | 4 +- .../BgQualityCheckPluginTest.kt | 2 +- .../storage/StorageConstraintPluginTest.kt | 2 +- .../versionChecker/AllowedVersionsTest.kt | 2 +- .../general/autotune/AutotuneCoreTest.kt | 2 +- .../general/autotune/AutotunePrepTest.kt | 2 +- .../SmsCommunicatorPluginTest.kt | 8 +- .../pump/virtual/VirtualPumpPluginUTest.kt | 2 +- .../plugins/pump/combo/ComboPlugin.java | 6 +- .../plugins/pump/combo/ComboPluginTest.kt | 2 +- .../androidaps/dana/DanaFragment.kt | 4 +- .../nightscout/androidaps/dana/DanaPump.kt | 2 +- .../dana/activities/DanaHistoryActivity.kt | 2 +- .../activities/DanaUserOptionsActivity.kt | 2 +- .../danaRKorean/DanaRKoreanPlugin.kt | 4 +- .../services/DanaRKoreanExecutionService.java | 2 +- .../androidaps/danaRv2/DanaRv2Plugin.java | 4 +- .../danaRv2/comm/MsgHistoryEventsV2.kt | 2 +- .../services/DanaRv2ExecutionService.java | 2 +- .../androidaps/danar/AbstractDanaRPlugin.java | 6 +- .../androidaps/danar/DanaRPlugin.java | 5 +- .../androidaps/danar/comm/MessageBase.kt | 2 +- .../androidaps/danar/comm/MsgBolusStart.kt | 2 +- .../danar/comm/MsgBolusStartWithSpeed.kt | 2 +- .../danar/comm/MsgSetExtendedBolusStart.kt | 2 +- .../danar/services/DanaRExecutionService.java | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 4 +- .../plugins/pump/danaR/DanaRPluginTest.kt | 2 +- .../plugins/pump/danaR/comm/DanaRTestBase.kt | 2 +- .../pump/danaR/comm/MessageHashTableRTest.kt | 2 +- .../pump/danaR/comm/MsgBolusStartTest.kt | 2 +- .../danaR/comm/MsgBolusStartWithSpeedTest.kt | 2 +- .../comm/MsgSetExtendedBolusStartTest.kt | 2 +- .../pump/danaR/comm/MsgSettingBasalTest.kt | 2 +- .../pump/danaRKorean/DanaRKoreanPluginTest.kt | 2 +- .../comm/MessageHashTableRKoreanTest.kt | 2 +- .../plugins/pump/danaRv2/DanaRv2PluginTest.kt | 2 +- .../danaRv2/comm/MessageHashTableRv2Test.kt | 2 +- .../androidaps/danars/DanaRSPlugin.kt | 8 +- .../comm/DanaRSPacketBolusSet24CIRCFArray.kt | 2 +- .../DanaRSPacketBolusSetStepBolusStart.kt | 2 +- .../androidaps/danars/DanaRSPluginTest.kt | 2 +- .../danars/comm/DanaRsMessageHashTableTest.kt | 2 +- .../DanaRsPacketBolusSetStepBolusStartTest.kt | 2 +- .../androidaps/diaconn/DiaconnG8Plugin.kt | 6 +- .../packet/BigLogInquireResponsePacket.kt | 4 +- .../BigMainInfoInquireResponsePacket.kt | 4 +- .../diaconn/service/DiaconnG8Service.kt | 2 +- .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 4 +- .../pump/eopatch/alarm/AlarmManager.kt | 2 +- .../pump/eopatch/ble/PatchManager.java | 2 +- .../pump/eopatch/ble/PatchManagerImpl.java | 2 +- .../ui/viewmodel/EopatchOverviewViewModel.kt | 2 +- .../pump/medtronic/MedtronicPumpPlugin.kt | 2 +- .../comm/MedtronicCommunicationManager.kt | 2 +- .../pump/medtronic/comm/MedtronicConverter.kt | 2 +- .../medtronic/data/MedtronicHistoryData.kt | 2 +- .../pump/medtronic/data/dto/BasalProfile.kt | 2 +- .../medtronic/driver/MedtronicPumpStatus.kt | 2 +- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 4 +- .../omnipod/dash/ui/DashPodHistoryActivity.kt | 2 +- .../action/DashInsertCannulaViewModel.kt | 2 +- .../pump/omnipod/dash/util/Functions.kt | 2 +- .../omnipod/eros/OmnipodErosPumpPlugin.java | 4 +- .../eros/manager/AapsOmnipodErosManager.java | 2 +- .../eros/ui/ErosPodHistoryActivity.java | 2 +- .../omnipod/eros/OmnipodErosPumpPluginTest.kt | 2 +- .../plugins/pump/common/PumpPluginAbstract.kt | 4 +- .../plugins/pump/common/data/PumpStatus.kt | 2 +- .../plugins/pump/common/sync/PumpDbEntry.kt | 10 +- .../common/sync/PumpSyncEntriesCreator.java | 2 +- .../plugins/pump/common/utils/ProfileUtil.kt | 2 +- .../ui/activities/TDDStatsActivity.kt | 2 +- .../fragments/TreatmentsUserEntryFragment.kt | 2 +- .../ui/defaultProfile/DefaultProfile.kt | 2 +- .../ui/defaultProfile/DefaultProfileDPV.kt | 2 +- .../ui/dialogs/CalibrationDialog.kt | 2 +- .../info/nightscout/ui/dialogs/CarbsDialog.kt | 4 +- .../info/nightscout/ui/dialogs/CareDialog.kt | 2 +- .../java/info/nightscout/ui/widget/Widget.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 4 +- .../ui/defaultProfile/DefaultProfileTest.kt | 2 +- 276 files changed, 589 insertions(+), 517 deletions(-) create mode 100644 core/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/ConfigBuilder.kt (65%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/Constraint.kt (98%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/Dana.kt (89%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/GlucoseUnit.kt (70%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/IconsProvider.kt (65%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/ImportExportPrefs.kt (92%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/NsClient.kt (94%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/Overview.kt (91%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/PluginBase.kt (96%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/PluginFragment.kt (55%) rename {core/src/main/java/info/nightscout/androidaps => interfaces/src/main/java/info/nightscout}/interfaces/Sync.kt (69%) rename {core/src/main/java/info/nightscout/androidaps/plugins => interfaces/src/main/java/info/nightscout/interfaces}/constraints/versionChecker/AllowedVersions.kt (95%) rename {core/src/main/java/info/nightscout/androidaps/interfaces => interfaces/src/main/java/info/nightscout/interfaces/pump}/PumpDescription.kt (95%) rename {core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs => interfaces/src/main/java/info/nightscout/interfaces/pump}/PumpType.kt (73%) diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index c32028af81..d7a3b07112 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -41,9 +41,9 @@ import info.nightscout.androidaps.databinding.ActivityMainBinding import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.IconsProvider +import info.nightscout.interfaces.IconsProvider import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 0b49cf7551..7999cebb51 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -23,8 +23,8 @@ 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.androidaps.interfaces.ConfigBuilder -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.PluginStore import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils 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 2ad9bdb92a..375a4db0d6 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -23,7 +23,7 @@ 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.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploader diff --git a/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt index 404e9c2aa9..29a3d92568 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt @@ -6,7 +6,7 @@ import android.os.Bundle import android.view.Menu import android.view.MenuItem import info.nightscout.androidaps.R -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.plugins.configBuilder.PluginStore import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.androidaps.utils.protection.ProtectionCheck 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 b0f83d2931..9ee673a0f0 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -11,14 +11,14 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.implementations.ActivityNamesImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.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.interfaces.IconsProvider +import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.TrendCalculator 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 cd1083e8e2..a879517549 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.diaconn.DiaconnG8Plugin -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploader import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt index fac792c765..45d260c25c 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index a92d423bb0..9896c9612b 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index a4920b99eb..a16c9cf0ef 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -24,9 +24,9 @@ import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BolusTimer import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt index bc1bc5cb42..af9a28ce5f 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -26,14 +26,14 @@ import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ConfigBuilder -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin @@ -191,7 +191,7 @@ class LoopDialog : DaggerDialogFragment() { binding.overviewReconnect.visibility = View.VISIBLE } - !(loop as PluginBase).isEnabled() -> { + !(loop as PluginBase).isEnabled() -> { binding.overviewLoop.visibility = View.VISIBLE binding.overviewEnable.visibility = View.VISIBLE binding.overviewDisable.visibility = View.GONE diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index d7db5e0fee..30babfb9fa 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -15,10 +15,10 @@ import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index 769fb7ed12..cf5a27bff2 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTa import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogTemptargetBinding import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index aa0d2b94ba..3dce3b467d 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -20,7 +20,7 @@ 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.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index 2cf3e9cb6e..4848fdf97f 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -29,9 +29,9 @@ import info.nightscout.shared.extensions.runOnUiThread import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt index 7eac530a47..ace1bb1bca 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt @@ -14,7 +14,7 @@ import androidx.lifecycle.Lifecycle import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.LoopFragmentBinding -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Loop import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui 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 f8378616b5..b92011ad2d 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 @@ -31,15 +31,15 @@ import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Loop.LastRun -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt index 22b462ee1f..2ab1bad396 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index d09b6c367f..cb2dee0959 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -9,11 +9,11 @@ import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index 3f2f6ff8f3..506fe73044 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index fe6bae54a5..18c28bbf39 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -11,11 +11,11 @@ import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index 54be09e70a..87acf2fde3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt index 23335b1531..6592622cc3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt @@ -23,7 +23,7 @@ import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui @@ -135,7 +135,8 @@ class ConfigBuilderFragment : DaggerFragment() { inner class PluginViewHolder internal constructor(private val fragment: ConfigBuilderFragment, private val pluginType: PluginType, - private val plugin: PluginBase) { + private val plugin: PluginBase + ) { @Suppress("InflateParams") val baseView: LinearLayout = fragment.layoutInflater.inflate(R.layout.configbuilder_single_plugin, null) as LinearLayout 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 792c462992..494903f745 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 @@ -9,10 +9,10 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpSync diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt index a800d7e8b1..6c8c218555 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt @@ -5,13 +5,13 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.interfaces.Overview -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.Overview +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.Sensitivity -import info.nightscout.androidaps.interfaces.Sync +import info.nightscout.interfaces.Sync import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.Safety 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 26604d33ed..4602046b05 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 @@ -8,7 +8,7 @@ import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.database.transactions.InsertOrUpdateProfileSwitch import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore 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 ab7f7ac337..4dcb5e0308 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 @@ -3,9 +3,9 @@ package info.nightscout.androidaps.plugins.constraints.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase 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 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 f14f96218b..8adfac1242 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 @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.ValueWrapper 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.interfaces.PluginBase import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt index e570952c4a..5d2ef6aa1e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin import info.nightscout.shared.utils.T import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt index 58aea81850..f1f0da7ed2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt @@ -11,14 +11,14 @@ import info.nightscout.androidaps.extensions.storeString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.Safety import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt index 62a3d26dd8..900e6745c0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.general.actions import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper 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 71665179bf..6c92c637f0 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 @@ -11,7 +11,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt index c4d7ed5539..aa32565319 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt @@ -32,7 +32,7 @@ import info.nightscout.androidaps.diaconn.events.EventDiaconnG8PumpLogReset import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.ImportExportPrefs +import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index b4688b4ec8..a16f2ff3bb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.insight.database.InsightDatabase import info.nightscout.androidaps.interfaces.DataSyncSelector -import info.nightscout.androidaps.interfaces.ImportExportPrefs +import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper 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 e1c3107515..4d4f1ba2e4 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,7 +7,7 @@ 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.PluginBase import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginDescription 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 6e2bbfe85e..13a468702b 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 @@ -49,12 +49,12 @@ import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.TrendCalculator @@ -68,7 +68,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOve import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewSensitivity import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin import info.nightscout.androidaps.plugins.source.DexcomPlugin import info.nightscout.androidaps.plugins.source.XdripPlugin 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 a7b175c6a3..cc9f7f862b 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,8 +13,8 @@ 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.androidaps.interfaces.Overview -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.Overview +import info.nightscout.interfaces.PluginBase 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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt index c1ad2d89b3..1f05372d6e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.plugins.sync.nsclient.extensions.age import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt index 35e58e4ff0..76708ccbae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.kt @@ -9,7 +9,7 @@ import com.jjoe64.graphview.series.LineGraphSeries import com.jjoe64.graphview.series.Series import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index 84476757f5..e9ef441e86 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -13,10 +13,10 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.IconsProvider +import info.nightscout.interfaces.IconsProvider import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.interfaces.NotificationHolder -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt index f0ebe5f9b7..1c6f577901 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt @@ -4,7 +4,7 @@ import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper 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 5e339bb987..efde04f06b 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 @@ -25,12 +25,12 @@ import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.TrendCalculator diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index fb9f250a26..a22318da4f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -22,7 +22,7 @@ import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt index 27233787dd..f513893abd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity 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 5e8c7282d3..0d16097b67 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 @@ -10,7 +10,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents import info.nightscout.interfaces.BuildHelper 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 de50f72961..fcc9ba66a7 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 @@ -19,7 +19,7 @@ import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger 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 aff6747a98..48bf1c7e09 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 @@ -12,7 +12,7 @@ import info.nightscout.androidaps.database.entities.TherapyEvent 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.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.interfaces.PluginDescription 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 76395f2cb3..a7563fd1b4 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 @@ -11,7 +11,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType 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 c1ed4e18d4..e23d50ac7b 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 @@ -13,7 +13,7 @@ import info.nightscout.androidaps.database.entities.UserEntry 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.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.FabricPrivacy 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 e937ddb23a..cf7c7c6c9c 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 @@ -15,7 +15,7 @@ import info.nightscout.androidaps.database.entities.UserEntry 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.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.FabricPrivacy 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 a63d38d541..08b9a9cafc 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 @@ -10,7 +10,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.interfaces.PluginDescription 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 36460da7f6..474ac21e5c 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 @@ -10,7 +10,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription 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 559c1a14e6..462fed8b35 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 @@ -9,7 +9,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.utils.extensions.isRunningTest import info.nightscout.interfaces.BuildHelper 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 50399cad2a..d49f2f9c95 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 @@ -10,7 +10,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType 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 410b1266e7..787ab8bec8 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 @@ -10,7 +10,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents import info.nightscout.interfaces.PluginDescription 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 7619e086bc..0282023c88 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin import info.nightscout.androidaps.queue.commands.Command 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 823e98c983..3d3c4e1980 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -13,8 +13,8 @@ import info.nightscout.androidaps.dialogs.ProfileSwitchDialog import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ConfigBuilder -import info.nightscout.androidaps.interfaces.ImportExportPrefs +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt index b8a1520bda..249617102f 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt @@ -7,7 +7,7 @@ import android.view.View import android.widget.LinearLayout import android.widget.TextView import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.setupwizard.SWNumberValidator diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt index 0f9afd9240..5083051cc7 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt @@ -9,7 +9,7 @@ import android.widget.RadioGroup import android.widget.TextView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.MyPreferenceFragment -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.plugins.configBuilder.PluginStore diff --git a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt index 2ec4057baf..9ca879b894 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt @@ -10,7 +10,7 @@ import androidx.core.app.NotificationCompat import androidx.core.app.TaskStackBuilder import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.IconsProvider +import info.nightscout.interfaces.IconsProvider import info.nightscout.interfaces.NotificationHolder import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/utils/resources/IconsProviderImplementation.kt b/app/src/main/java/info/nightscout/androidaps/utils/resources/IconsProviderImplementation.kt index fac0b48c0e..e8e72dc8cf 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/resources/IconsProviderImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/resources/IconsProviderImplementation.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils.resources import info.nightscout.androidaps.R import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.IconsProvider +import info.nightscout.interfaces.IconsProvider import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt b/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt index 90d3bd65bd..eb3c6239cc 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.utils.tabs import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.viewpager2.adapter.FragmentStateAdapter -import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.androidaps.interfaces.PluginFragment +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.PluginFragment import java.util.* class TabPageAdapter(private val activity: AppCompatActivity) : FragmentStateAdapter(activity) { diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index 437c732f7e..27c4e76709 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -23,14 +23,14 @@ import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.CarbTimer import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt index e47af141cf..d0ef9fb08c 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt index e801c228c8..4754c975d3 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt @@ -6,7 +6,7 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt index 91ba8bcf23..fb4d069430 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 526446dbf4..6d317c2037 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -6,10 +6,10 @@ import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject 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 944f21674a..534c4c313c 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -32,7 +32,10 @@ import info.nightscout.androidaps.utils.Profiler import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.implementation.constraints.ConstraintsImpl import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert 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 1fda3795e0..f5987cef9f 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 @@ -12,7 +12,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.FabricPrivacy diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt index 68e78b4bc4..6ac486a489 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective 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 4f60958f7c..bcbaa1a06b 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 @@ -6,9 +6,9 @@ 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.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.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 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 e483228007..0e83d9f605 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 @@ -7,14 +7,14 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator 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.interfaces.pump.PumpDescription import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin diff --git a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt index e4974b0eae..bec9e6395c 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt index 9c92ee2893..e8b4121028 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt @@ -6,9 +6,9 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt index 43ffb38316..fb691a50fa 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt @@ -5,9 +5,9 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt index d7cf38427f..4a98b8105c 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt index ffc9af51db..012941df62 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt @@ -13,7 +13,7 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.extensions.friendlyDescription import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt b/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt index ec3057b453..6a161e14f2 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputBg.kt @@ -2,7 +2,7 @@ package info.nightscout.automation.elements import android.view.Gravity import android.widget.LinearLayout -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.ui.NumberPicker import info.nightscout.automation.R diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt b/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt index c6bb945bee..391a54812e 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputTempTarget.kt @@ -3,7 +3,7 @@ package info.nightscout.automation.elements import android.view.Gravity import android.widget.LinearLayout import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.ui.NumberPicker import info.nightscout.automation.R diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt index 2e6e2a9b04..6b18739c2e 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt @@ -4,7 +4,7 @@ import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt index b06ba2d997..9b3ab2402e 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt @@ -4,7 +4,7 @@ import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt index 9bff4e0834..cf8ec87ac6 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt @@ -5,7 +5,7 @@ import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Constants import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R diff --git a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 1680787d1b..deebd4bb08 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -4,15 +4,15 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.logging.AAPSLogger import org.json.JSONObject diff --git a/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt b/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt index 091c95c61e..529094192f 100644 --- a/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt +++ b/automation/src/test/java/info/nightscout/automation/AutomationEventTest.kt @@ -3,7 +3,7 @@ package info.nightscout.automation import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Loop import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.actions.Action diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt index fe60db4f81..39cef728f3 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt @@ -2,7 +2,7 @@ package info.nightscout.automation.actions import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.database.transactions.Transaction -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.elements.InputCarePortalMenu import info.nightscout.automation.elements.InputDuration diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt index 7973d30ed6..2232f77f26 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt @@ -3,7 +3,7 @@ package info.nightscout.automation.actions import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.database.transactions.Transaction -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index 8be9dca969..f0f8b5a72c 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -8,11 +8,11 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.database.entities.OfflineEvent import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ConfigBuilder -import info.nightscout.androidaps.interfaces.Constraint -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileSource diff --git a/automation/src/test/java/info/nightscout/automation/elements/InputBgTest.kt b/automation/src/test/java/info/nightscout/automation/elements/InputBgTest.kt index c30f473d11..785a0d9d60 100644 --- a/automation/src/test/java/info/nightscout/automation/elements/InputBgTest.kt +++ b/automation/src/test/java/info/nightscout/automation/elements/InputBgTest.kt @@ -1,6 +1,6 @@ package info.nightscout.automation.elements -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.automation.triggers.TriggerTestBase import org.junit.Assert import org.junit.Before diff --git a/automation/src/test/java/info/nightscout/automation/elements/InputTempTargetTest.kt b/automation/src/test/java/info/nightscout/automation/elements/InputTempTargetTest.kt index 569a23d4b6..76c0b544da 100644 --- a/automation/src/test/java/info/nightscout/automation/elements/InputTempTargetTest.kt +++ b/automation/src/test/java/info/nightscout/automation/elements/InputTempTargetTest.kt @@ -1,6 +1,6 @@ package info.nightscout.automation.elements -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.automation.triggers.TriggerTestBase import org.junit.Assert import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt index 3e2565f11b..98296a35c1 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt @@ -2,7 +2,7 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.automation.elements.Comparator import org.json.JSONObject import org.junit.Assert diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt index cd09279d92..13ad7c396b 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt @@ -2,7 +2,7 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputDelta.DeltaType diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt index fe75e777a1..bbff8ede27 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt @@ -3,7 +3,7 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import io.reactivex.rxjava3.core.Single diff --git a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt b/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt index 6e1c050b97..90e2fe706f 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt @@ -6,7 +6,7 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.core.app.ActivityCompat import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.ImportExportPrefs +import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract import info.nightscout.androidaps.utils.alertDialogs.OKDialog diff --git a/core/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt b/core/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt index 361278a03d..8fd8fcfaab 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt +++ b/core/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.database.transactions.InsertOrUpdateBolusTransaction import info.nightscout.androidaps.database.transactions.InsertOrUpdateCarbsTransaction -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType class DetailedBolusInfo { diff --git a/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt b/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt index 3aaaee0120..07b27916c1 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt +++ b/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.extensions.shiftBlock import info.nightscout.androidaps.extensions.shiftTargetBlock import info.nightscout.androidaps.extensions.targetBlockValueBySeconds import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Profile.Companion.secondsFromMidnight import info.nightscout.androidaps.interfaces.Profile.Companion.toMgdl diff --git a/core/src/main/java/info/nightscout/androidaps/data/PureProfile.kt b/core/src/main/java/info/nightscout/androidaps/data/PureProfile.kt index bda738327c..cad67c56e7 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/PureProfile.kt +++ b/core/src/main/java/info/nightscout/androidaps/data/PureProfile.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.data import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import org.json.JSONObject import java.util.* diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt index d5c3be00b7..808ae79d6f 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.extensions import info.nightscout.interfaces.Constants import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt index fd5b58556f..8c41a81e4f 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.extensions.targetBlockFromJsonArray -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.interfaces.utils.JsonHelper diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt new file mode 100644 index 0000000000..d6b4c13d3b --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt @@ -0,0 +1,121 @@ +package info.nightscout.androidaps.extensions + +import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.androidaps.database.entities.UserEntry +import info.nightscout.interfaces.pump.PumpType + +fun PumpType.Companion.fromDbSource(s: UserEntry.Sources): PumpType.Source = + when (s) { + UserEntry.Sources.Dana -> PumpType.Source.Dana + UserEntry.Sources.DanaR -> PumpType.Source.DanaR + UserEntry.Sources.DanaRC -> PumpType.Source.DanaRC + UserEntry.Sources.DanaRv2 -> PumpType.Source.DanaRv2 + UserEntry.Sources.DanaRS -> PumpType.Source.DanaRS + UserEntry.Sources.DanaI -> PumpType.Source.DanaI + UserEntry.Sources.DiaconnG8 -> PumpType.Source.DiaconnG8 + UserEntry.Sources.Insight -> PumpType.Source.Insight + UserEntry.Sources.Combo -> PumpType.Source.Combo + UserEntry.Sources.Medtronic -> PumpType.Source.Medtronic + UserEntry.Sources.Omnipod -> PumpType.Source.Omnipod + UserEntry.Sources.OmnipodEros -> PumpType.Source.OmnipodEros + UserEntry.Sources.OmnipodDash -> PumpType.Source.OmnipodDash + UserEntry.Sources.EOPatch2 -> PumpType.Source.EOPatch2 + UserEntry.Sources.MDI -> PumpType.Source.MDI + UserEntry.Sources.VirtualPump -> PumpType.Source.VirtualPump + else -> PumpType.Source.Unknown + } + +fun PumpType.Companion.fromDbPumpType(pt: InterfaceIDs.PumpType): PumpType = + when (pt) { + InterfaceIDs.PumpType.GENERIC_AAPS -> PumpType.GENERIC_AAPS + InterfaceIDs.PumpType.CELLNOVO -> PumpType.CELLNOVO + InterfaceIDs.PumpType.ACCU_CHEK_COMBO -> PumpType.ACCU_CHEK_COMBO + InterfaceIDs.PumpType.ACCU_CHEK_SPIRIT -> PumpType.ACCU_CHEK_SPIRIT + InterfaceIDs.PumpType.ACCU_CHEK_INSIGHT -> PumpType.ACCU_CHEK_INSIGHT_VIRTUAL + InterfaceIDs.PumpType.ACCU_CHEK_INSIGHT_BLUETOOTH -> PumpType.ACCU_CHEK_INSIGHT + InterfaceIDs.PumpType.ACCU_CHEK_SOLO -> PumpType.ACCU_CHEK_SOLO + InterfaceIDs.PumpType.ANIMAS_VIBE -> PumpType.ANIMAS_VIBE + InterfaceIDs.PumpType.ANIMAS_PING -> PumpType.ANIMAS_PING + InterfaceIDs.PumpType.DANA_R -> PumpType.DANA_R + InterfaceIDs.PumpType.DANA_R_KOREAN -> PumpType.DANA_R_KOREAN + InterfaceIDs.PumpType.DANA_RS -> PumpType.DANA_RS + InterfaceIDs.PumpType.DANA_RS_KOREAN -> PumpType.DANA_RS_KOREAN + InterfaceIDs.PumpType.DANA_RV2 -> PumpType.DANA_RV2 + InterfaceIDs.PumpType.DANA_I -> PumpType.DANA_I + InterfaceIDs.PumpType.OMNIPOD_EROS -> PumpType.OMNIPOD_EROS + InterfaceIDs.PumpType.OMNIPOD_DASH -> PumpType.OMNIPOD_DASH + InterfaceIDs.PumpType.MEDTRONIC_512_517 -> PumpType.MEDTRONIC_512_712 + InterfaceIDs.PumpType.MEDTRONIC_515_715 -> PumpType.MEDTRONIC_515_715 + InterfaceIDs.PumpType.MEDTRONIC_522_722 -> PumpType.MEDTRONIC_522_722 + InterfaceIDs.PumpType.MEDTRONIC_523_723_REVEL -> PumpType.MEDTRONIC_523_723_REVEL + InterfaceIDs.PumpType.MEDTRONIC_554_754_VEO -> PumpType.MEDTRONIC_554_754_VEO + InterfaceIDs.PumpType.MEDTRONIC_640G -> PumpType.MEDTRONIC_640G + InterfaceIDs.PumpType.TANDEM_T_SLIM -> PumpType.TANDEM_T_SLIM + InterfaceIDs.PumpType.TANDEM_T_SLIM_G4 -> PumpType.TANDEM_T_SLIM_G4 + InterfaceIDs.PumpType.TANDEM_T_FLEX -> PumpType.TANDEM_T_FLEX + InterfaceIDs.PumpType.TANDEM_T_SLIM_X2 -> PumpType.TANDEM_T_SLIM_X2 + InterfaceIDs.PumpType.YPSOPUMP -> PumpType.YPSOPUMP + InterfaceIDs.PumpType.MDI -> PumpType.MDI + InterfaceIDs.PumpType.USER -> PumpType.USER + InterfaceIDs.PumpType.DIACONN_G8 -> PumpType.DIACONN_G8 + InterfaceIDs.PumpType.EOPATCH2 -> PumpType.EOFLOW_EOPATCH2 + InterfaceIDs.PumpType.CACHE -> PumpType.CACHE + } + +fun PumpType.Source.toDbSource(): UserEntry.Sources = + when (this) { + PumpType.Source.Dana -> UserEntry.Sources.Dana + PumpType.Source.DanaR -> UserEntry.Sources.DanaR + PumpType.Source.DanaRC -> UserEntry.Sources.DanaRC + PumpType.Source.DanaRv2 -> UserEntry.Sources.DanaRv2 + PumpType.Source.DanaRS -> UserEntry.Sources.DanaRS + PumpType.Source.DanaI -> UserEntry.Sources.DanaI + PumpType.Source.DiaconnG8 -> UserEntry.Sources.DiaconnG8 + PumpType.Source.Insight -> UserEntry.Sources.Insight + PumpType.Source.Combo -> UserEntry.Sources.Combo + PumpType.Source.Medtronic -> UserEntry.Sources.Medtronic + PumpType.Source.Omnipod -> UserEntry.Sources.Omnipod + PumpType.Source.OmnipodEros -> UserEntry.Sources.OmnipodEros + PumpType.Source.OmnipodDash -> UserEntry.Sources.OmnipodDash + PumpType.Source.EOPatch2 -> UserEntry.Sources.EOPatch2 + PumpType.Source.MDI -> UserEntry.Sources.MDI + PumpType.Source.VirtualPump -> UserEntry.Sources.VirtualPump + else -> UserEntry.Sources.Unknown + } + +fun PumpType.toDbPumpType(): InterfaceIDs.PumpType = + when (this) { + PumpType.GENERIC_AAPS -> InterfaceIDs.PumpType.GENERIC_AAPS + PumpType.CELLNOVO -> InterfaceIDs.PumpType.CELLNOVO + PumpType.ACCU_CHEK_COMBO -> InterfaceIDs.PumpType.ACCU_CHEK_COMBO + PumpType.ACCU_CHEK_SPIRIT -> InterfaceIDs.PumpType.ACCU_CHEK_SPIRIT + PumpType.ACCU_CHEK_INSIGHT_VIRTUAL -> InterfaceIDs.PumpType.ACCU_CHEK_INSIGHT + PumpType.ACCU_CHEK_INSIGHT -> InterfaceIDs.PumpType.ACCU_CHEK_INSIGHT_BLUETOOTH + PumpType.ACCU_CHEK_SOLO -> InterfaceIDs.PumpType.ACCU_CHEK_SOLO + PumpType.ANIMAS_VIBE -> InterfaceIDs.PumpType.ANIMAS_VIBE + PumpType.ANIMAS_PING -> InterfaceIDs.PumpType.ANIMAS_PING + PumpType.DANA_R -> InterfaceIDs.PumpType.DANA_R + PumpType.DANA_R_KOREAN -> InterfaceIDs.PumpType.DANA_R_KOREAN + PumpType.DANA_RS -> InterfaceIDs.PumpType.DANA_RS + PumpType.DANA_RS_KOREAN -> InterfaceIDs.PumpType.DANA_RS_KOREAN + PumpType.DANA_RV2 -> InterfaceIDs.PumpType.DANA_RV2 + PumpType.DANA_I -> InterfaceIDs.PumpType.DANA_I + PumpType.OMNIPOD_EROS -> InterfaceIDs.PumpType.OMNIPOD_EROS + PumpType.OMNIPOD_DASH -> InterfaceIDs.PumpType.OMNIPOD_DASH + PumpType.MEDTRONIC_512_712 -> InterfaceIDs.PumpType.MEDTRONIC_512_517 + PumpType.MEDTRONIC_515_715 -> InterfaceIDs.PumpType.MEDTRONIC_515_715 + PumpType.MEDTRONIC_522_722 -> InterfaceIDs.PumpType.MEDTRONIC_522_722 + PumpType.MEDTRONIC_523_723_REVEL -> InterfaceIDs.PumpType.MEDTRONIC_523_723_REVEL + PumpType.MEDTRONIC_554_754_VEO -> InterfaceIDs.PumpType.MEDTRONIC_554_754_VEO + PumpType.MEDTRONIC_640G -> InterfaceIDs.PumpType.MEDTRONIC_640G + PumpType.TANDEM_T_SLIM -> InterfaceIDs.PumpType.TANDEM_T_SLIM + PumpType.TANDEM_T_SLIM_G4 -> InterfaceIDs.PumpType.TANDEM_T_SLIM_G4 + PumpType.TANDEM_T_FLEX -> InterfaceIDs.PumpType.TANDEM_T_FLEX + PumpType.TANDEM_T_SLIM_X2 -> InterfaceIDs.PumpType.TANDEM_T_SLIM_X2 + PumpType.YPSOPUMP -> InterfaceIDs.PumpType.YPSOPUMP + PumpType.MDI -> InterfaceIDs.PumpType.MDI + PumpType.USER -> InterfaceIDs.PumpType.USER + PumpType.DIACONN_G8 -> InterfaceIDs.PumpType.DIACONN_G8 + PumpType.EOFLOW_EOPATCH2 -> InterfaceIDs.PumpType.EOPATCH2 + PumpType.CACHE -> InterfaceIDs.PumpType.CACHE + } diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt index fac501c109..8e4e3f8998 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt b/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt index 18350b849d..66330481a8 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit fun TherapyEvent.isOlderThan(hours: Double): Boolean { return getHoursFromStart() > hours diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt index 5165d90c2d..7a05ba6088 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt @@ -1,7 +1,11 @@ package info.nightscout.androidaps.interfaces +import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.Overview +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.Safety +import info.nightscout.interfaces.Sync import java.util.* interface ActivePlugin { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt index 0084721142..d799b40c82 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt @@ -1,6 +1,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.Constraint /** * Constraints interface diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt index 732d53b856..3523c8a16b 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt @@ -3,6 +3,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.database.entities.OfflineEvent import info.nightscout.androidaps.plugins.aps.loop.APSResult +import info.nightscout.interfaces.Constraint interface Loop { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt index 2b08583a0a..2fba1bfdae 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt @@ -8,6 +8,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter.to1Decimal import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.utils.Round import info.nightscout.interfaces.Config +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.DateTime diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt index b28dd06f3d..e0d3dd46e2 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt @@ -1,6 +1,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.interfaces.GlucoseUnit interface ProfileFunction { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt index 8d0758340c..c1f06346e8 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt @@ -1,13 +1,14 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.pump.ManufacturerType +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.interfaces.queue.CustomCommand import info.nightscout.interfaces.utils.TimeChangeType -import info.nightscout.interfaces.pump.ManufacturerType import org.json.JSONObject /** diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt index acf64b8d6c..32d42efefd 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt @@ -3,6 +3,7 @@ package info.nightscout.androidaps.interfaces import android.os.SystemClock import dagger.android.HasAndroidInjector import info.nightscout.androidaps.core.R +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.rx.logging.AAPSLogger diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt index a81d3fda36..a137bb5ec8 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType /** * This interface allows pump drivers to push data changes (creation and update of treatments, temporary basals and extended boluses) back to AAPS-core. diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt b/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt index 837b39ca8f..f8414ac217 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt @@ -8,11 +8,11 @@ import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt b/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt index f25cb683a0..c0b656bed7 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt @@ -7,6 +7,7 @@ import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.receivers.ReceiverStatusStore +import info.nightscout.interfaces.constraints.versionChecker.AllowedVersions import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt index ea5283a816..e6e6968ef6 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt @@ -4,7 +4,7 @@ import android.content.Context import info.nightscout.interfaces.Constants import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt index cb507c5585..59b26025e7 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt @@ -4,7 +4,7 @@ import android.content.Context import info.nightscout.interfaces.Constants import info.nightscout.androidaps.core.R import info.nightscout.androidaps.data.InMemoryGlucoseValue -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt b/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt index 9bd8a63849..27c49d87a8 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.utils import info.nightscout.interfaces.Constants import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.sharedPreferences.SP diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt b/core/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt index def0b4809e..c10ead7998 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt @@ -5,7 +5,7 @@ import android.util.AttributeSet import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.general.overview.graphExtensions.AreaGraphSeries import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DoubleDataPoint diff --git a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt index 7f76025588..ed075845d1 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.ColorGroup import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.utils.DateUtil @@ -153,23 +153,23 @@ class UserEntryPresentationHelper @Inject constructor( } private fun getCsvHeader() = rh.gs(R.string.ue_csv_header, - csvString(R.string.ue_timestamp), - csvString(R.string.date), - csvString(R.string.ue_utc_offset), - csvString(R.string.ue_action), - csvString(R.string.eventtype), - csvString(R.string.ue_source), - csvString(R.string.careportal_note), - csvString(R.string.ue_string), - csvString(R.string.event_time_label), - csvString(if (profileFunction.getUnits() == GlucoseUnit.MGDL) R.string.mgdl else R.string.mmol), - csvString(R.string.shortgram), - csvString(R.string.insulin_unit_shortname), - csvString(R.string.profile_ins_units_per_hour), - csvString(R.string.shortpercent), - csvString(R.string.shorthour), - csvString(R.string.shortminute), - csvString(R.string.ue_none) + csvString(R.string.ue_timestamp), + csvString(R.string.date), + csvString(R.string.ue_utc_offset), + csvString(R.string.ue_action), + csvString(R.string.eventtype), + csvString(R.string.ue_source), + csvString(R.string.careportal_note), + csvString(R.string.ue_string), + csvString(R.string.event_time_label), + csvString(if (profileFunction.getUnits() == GlucoseUnit.MGDL) R.string.mgdl else R.string.mmol), + csvString(R.string.shortgram), + csvString(R.string.insulin_unit_shortname), + csvString(R.string.profile_ins_units_per_hour), + csvString(R.string.shortpercent), + csvString(R.string.shorthour), + csvString(R.string.shortminute), + csvString(R.string.ue_none) ) + "\n" private fun getCsvEntry(entry: UserEntry): String { diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index ddb8ad89fb..44760211ae 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -295,9 +295,6 @@ Start profile %1$d%% for %2$d min - - * Only discrete values no ranges are supported as granularity for basal/bolus in virtual pump. - Cancel temp basal Let temp basal run diff --git a/core/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/core/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 526446dbf4..6d317c2037 100644 --- a/core/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/core/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -6,10 +6,10 @@ import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/core/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt b/core/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt index b702ea05bd..e427d91bd9 100644 --- a/core/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.data import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt b/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt index 15e14ff6ec..9a37dfbe8e 100644 --- a/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil diff --git a/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt b/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt index c99b0b2c55..f46f2e0daa 100644 --- a/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt @@ -1,8 +1,9 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.pump.PumpCapability +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.interfaces.pump.PumpTempBasalType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import org.junit.Assert import org.junit.Test diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt b/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt index 3393d68436..2b03644c96 100644 --- a/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt @@ -4,10 +4,10 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble import org.junit.Assert import org.junit.Before diff --git a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt index 331cb2748a..0aac8b3ccc 100644 --- a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt @@ -17,7 +17,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.AndroidPermission -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.notifications.Notification diff --git a/implementation/src/main/java/info/nightscout/implementation/BolusTimerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/BolusTimerImpl.kt index 291e3f8179..315fee99a9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/BolusTimerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/BolusTimerImpl.kt @@ -2,7 +2,7 @@ package info.nightscout.implementation import dagger.android.HasAndroidInjector import info.nightscout.interfaces.BolusTimer -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.AutomationEvent import info.nightscout.automation.AutomationPlugin diff --git a/implementation/src/main/java/info/nightscout/implementation/CarbTimerImpl.kt b/implementation/src/main/java/info/nightscout/implementation/CarbTimerImpl.kt index a86d7388f4..c30797a6b9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/CarbTimerImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/CarbTimerImpl.kt @@ -2,7 +2,7 @@ package info.nightscout.implementation import dagger.android.HasAndroidInjector import info.nightscout.interfaces.CarbTimer -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.utils.TimerUtil import info.nightscout.automation.AutomationEvent diff --git a/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt b/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt index 1612da81f4..6bfb75ed6c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt @@ -6,7 +6,7 @@ import android.os.Bundle import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.shared.extensions.safeQueryBroadcastReceivers -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast diff --git a/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt index 5d0557798d..4d1edd7c7a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt @@ -1,7 +1,7 @@ package info.nightscout.implementation.constraints import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 7da5c0e0ef..403d1469c7 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -29,12 +29,15 @@ import info.nightscout.androidaps.database.transactions.SyncPumpExtendedBolusTra import info.nightscout.androidaps.database.transactions.SyncPumpTemporaryBasalTransaction import info.nightscout.androidaps.database.transactions.SyncPumpTotalDailyDoseTransaction import info.nightscout.androidaps.database.transactions.SyncTemporaryBasalWithTempIdTransaction +import info.nightscout.androidaps.extensions.fromDbPumpType +import info.nightscout.androidaps.extensions.toDbPumpType +import info.nightscout.androidaps.extensions.toDbSource import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.VirtualPump import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.bus.RxBus @@ -271,7 +274,7 @@ class PumpSyncImplementation @Inject constructor( pumpSerial = pumpSerial ) ) - uel.log(UserEntry.Action.CAREPORTAL, pumpType.source, note, ValueWithUnit.Timestamp(timestamp), ValueWithUnit.TherapyEventType(type.toDBbEventType())) + uel.log(UserEntry.Action.CAREPORTAL, pumpType.source.toDbSource(), note, ValueWithUnit.Timestamp(timestamp), ValueWithUnit.TherapyEventType(type.toDBbEventType())) repository.runTransactionForResult(InsertIfNewByTimestampTherapyEventTransaction(therapyEvent)) .doOnError { aapsLogger.error(LTag.DATABASE, "Error while saving TherapyEvent", it) diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index fbc7dc8b4e..b0393e8115 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt index 59240eb6c4..9d7150c09e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt @@ -2,7 +2,7 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Dana +import info.nightscout.interfaces.Dana import info.nightscout.interfaces.Diaconn import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt index bbbd3b270b..fb804b716e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt @@ -2,7 +2,7 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Dana +import info.nightscout.interfaces.Dana import info.nightscout.interfaces.Diaconn import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt index 3753ee0798..d0169bb2db 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.queue.Callback diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt index 437fdb8cca..a027b01d3f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt @@ -2,7 +2,7 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Dana +import info.nightscout.interfaces.Dana import info.nightscout.interfaces.Diaconn import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 526446dbf4..6d317c2037 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -6,10 +6,10 @@ import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt index 77fa152724..acfd1d5a8c 100644 --- a/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt index f266e3cdbe..861d0b9a59 100644 --- a/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index dac7df5859..09de233ff3 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.AndroidPermission -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt index aa40f998c1..4a57c089d5 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt @@ -11,8 +11,8 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper -import info.nightscout.androidaps.interfaces.Constraint -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.queue.commands.Command diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 2520ae7c0a..01d07e6819 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -40,14 +40,14 @@ import info.nightscout.androidaps.insight.database.InsightHistoryOffset; import info.nightscout.androidaps.insight.database.InsightPumpID; import info.nightscout.androidaps.insight.database.InsightPumpID.EventType; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.Constraint; +import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.interfaces.Insight; import info.nightscout.interfaces.PluginDescription; 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.interfaces.pump.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.interfaces.PumpSync.PumpState.TemporaryBasal; @@ -57,7 +57,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNo 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.interfaces.pump.PumpType; import info.nightscout.androidaps.plugins.pump.insight.app_layer.Service; import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.HistoryReadingDirection; import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.ReadHistoryEventsMessage; diff --git a/interfaces/build.gradle b/interfaces/build.gradle index 52c31537eb..59108b8319 100644 --- a/interfaces/build.gradle +++ b/interfaces/build.gradle @@ -20,8 +20,9 @@ dependencies { // I don't like this low level dependency but it helps // to move more code to interface module // database module is compiled longer anyway - // (ResourceHelper interface) + // (ResourceHelper, AAPSLogger interface) implementation project(':app-wear-shared:shared') + implementation project(':app-wear-shared:rx') api "androidx.appcompat:appcompat:$appcompat_version" api "androidx.preference:preference-ktx:$preferencektx_version" diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ConfigBuilder.kt b/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt similarity index 65% rename from core/src/main/java/info/nightscout/androidaps/interfaces/ConfigBuilder.kt rename to interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt index 107fbf3e93..352b657ac8 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ConfigBuilder.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt @@ -1,6 +1,4 @@ -package info.nightscout.androidaps.interfaces - -import info.nightscout.interfaces.PluginType +package info.nightscout.interfaces interface ConfigBuilder { fun initialize() diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Constraint.kt b/interfaces/src/main/java/info/nightscout/interfaces/Constraint.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Constraint.kt rename to interfaces/src/main/java/info/nightscout/interfaces/Constraint.kt index 9fa1c8091f..a030b41874 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Constraint.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/Constraint.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Dana.kt b/interfaces/src/main/java/info/nightscout/interfaces/Dana.kt similarity index 89% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Dana.kt rename to interfaces/src/main/java/info/nightscout/interfaces/Dana.kt index 3d8e9f0ef4..0e1fe8db35 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Dana.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/Dana.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces import info.nightscout.interfaces.data.PumpEnactResult diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/GlucoseUnit.kt b/interfaces/src/main/java/info/nightscout/interfaces/GlucoseUnit.kt similarity index 70% rename from core/src/main/java/info/nightscout/androidaps/interfaces/GlucoseUnit.kt rename to interfaces/src/main/java/info/nightscout/interfaces/GlucoseUnit.kt index 016ddd5553..9ecfbc6ad2 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/GlucoseUnit.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/GlucoseUnit.kt @@ -1,6 +1,4 @@ -package info.nightscout.androidaps.interfaces - -import info.nightscout.interfaces.Constants +package info.nightscout.interfaces enum class GlucoseUnit(val asText: String) { MGDL(Constants.MGDL), diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/IconsProvider.kt b/interfaces/src/main/java/info/nightscout/interfaces/IconsProvider.kt similarity index 65% rename from core/src/main/java/info/nightscout/androidaps/interfaces/IconsProvider.kt rename to interfaces/src/main/java/info/nightscout/interfaces/IconsProvider.kt index a80fecee2c..8bb8b4b2a0 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/IconsProvider.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/IconsProvider.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces interface IconsProvider { fun getIcon(): Int diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt b/interfaces/src/main/java/info/nightscout/interfaces/ImportExportPrefs.kt similarity index 92% rename from core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt rename to interfaces/src/main/java/info/nightscout/interfaces/ImportExportPrefs.kt index aabfda8524..19996bd1b6 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/ImportExportPrefs.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/NsClient.kt b/interfaces/src/main/java/info/nightscout/interfaces/NsClient.kt similarity index 94% rename from core/src/main/java/info/nightscout/androidaps/interfaces/NsClient.kt rename to interfaces/src/main/java/info/nightscout/interfaces/NsClient.kt index 4380940eb0..d24ee84c66 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/NsClient.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/NsClient.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces import android.text.Spanned import org.json.JSONObject diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Overview.kt b/interfaces/src/main/java/info/nightscout/interfaces/Overview.kt similarity index 91% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Overview.kt rename to interfaces/src/main/java/info/nightscout/interfaces/Overview.kt index e69ede6122..47c33a3f89 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Overview.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/Overview.kt @@ -1,7 +1,6 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces import androidx.annotation.StringRes -import info.nightscout.interfaces.ConfigExportImport import info.nightscout.rx.bus.RxBus interface Overview : ConfigExportImport { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.kt b/interfaces/src/main/java/info/nightscout/interfaces/PluginBase.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.kt rename to interfaces/src/main/java/info/nightscout/interfaces/PluginBase.kt index 37487cbca0..f0534edb8a 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/PluginBase.kt @@ -1,10 +1,8 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PluginFragment.kt b/interfaces/src/main/java/info/nightscout/interfaces/PluginFragment.kt similarity index 55% rename from core/src/main/java/info/nightscout/androidaps/interfaces/PluginFragment.kt rename to interfaces/src/main/java/info/nightscout/interfaces/PluginFragment.kt index 9bb570850e..1bd0bb628d 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PluginFragment.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/PluginFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces interface PluginFragment { var plugin: PluginBase? diff --git a/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt b/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt index f57b33b863..7060741f00 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt @@ -3,7 +3,7 @@ package info.nightscout.interfaces /** * Main plugin type * - * set by [info.nightscout.androidaps.interfaces.PluginDescription.mainType] + * set by [info.nightscout.interfaces.PluginDescription.mainType] */ enum class PluginType { GENERAL, SENSITIVITY, PROFILE, APS, PUMP, CONSTRAINTS, LOOP, BGSOURCE, INSULIN, SYNC diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Sync.kt b/interfaces/src/main/java/info/nightscout/interfaces/Sync.kt similarity index 69% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Sync.kt rename to interfaces/src/main/java/info/nightscout/interfaces/Sync.kt index 8139182f52..6cb0ba3233 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/Sync.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/Sync.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces interface Sync { diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/AllowedVersions.kt b/interfaces/src/main/java/info/nightscout/interfaces/constraints/versionChecker/AllowedVersions.kt similarity index 95% rename from core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/AllowedVersions.kt rename to interfaces/src/main/java/info/nightscout/interfaces/constraints/versionChecker/AllowedVersions.kt index 9cf779cfe2..9f4010f86c 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/AllowedVersions.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/constraints/versionChecker/AllowedVersions.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.plugins.constraints.versionChecker +package info.nightscout.interfaces.constraints.versionChecker import org.joda.time.LocalDate import org.json.JSONArray diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpDescription.kt similarity index 95% rename from core/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/PumpDescription.kt index 6e703a11cf..093cfa6756 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpDescription.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpDescription.kt @@ -1,8 +1,4 @@ -package info.nightscout.androidaps.interfaces - -import info.nightscout.interfaces.pump.PumpCapability -import info.nightscout.interfaces.pump.PumpTempBasalType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +package info.nightscout.interfaces.pump class PumpDescription() { diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpType.kt similarity index 73% rename from core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/PumpType.kt index 251bc8930a..047bbbdcd0 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/defs/PumpType.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpType.kt @@ -1,15 +1,8 @@ -package info.nightscout.androidaps.plugins.pump.common.defs +package info.nightscout.interfaces.pump -import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.interfaces.R import info.nightscout.interfaces.utils.Round -import info.nightscout.interfaces.pump.DoseSettings -import info.nightscout.interfaces.pump.DoseStepSize -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpCapability -import info.nightscout.interfaces.pump.PumpTempBasalType +import info.nightscout.shared.interfaces.ResourceHelper import kotlin.math.min @Suppress("unused") @@ -61,7 +54,7 @@ enum class PumpType { baseBasalStep = 0.01, baseBasalSpecialSteps = DoseStepSize.ComboBasal, pumpCapability = PumpCapability.ComboCapabilities, - source = Sources.Combo, + source = Source.Combo, supportBatteryLevel = false ), ACCU_CHEK_SPIRIT( @@ -109,7 +102,7 @@ enum class PumpType { baseBasalStep = 0.01, baseBasalSpecialSteps = DoseStepSize.InsightBasal, pumpCapability = PumpCapability.InsightCapabilities, - source = Sources.Insight + source = Source.Insight ), ACCU_CHEK_SOLO( description = "Accu-Chek Solo", @@ -159,7 +152,7 @@ enum class PumpType { baseBasalStep = 0.01, baseBasalSpecialSteps = null, pumpCapability = PumpCapability.DanaCapabilities, - source = Sources.DanaR + source = Source.DanaR ), DANA_R_KOREAN( description = "DanaR Korean", @@ -175,7 +168,7 @@ enum class PumpType { baseBasalStep = 0.01, baseBasalSpecialSteps = null, pumpCapability = PumpCapability.DanaCapabilities, - source = Sources.DanaRC + source = Source.DanaRC ), DANA_RS( description = "DanaRS", @@ -191,11 +184,11 @@ enum class PumpType { baseBasalStep = 0.01, baseBasalSpecialSteps = null, pumpCapability = PumpCapability.DanaWithHistoryCapabilities, - source = Sources.DanaRS + source = Source.DanaRS ), DANA_RS_KOREAN(description = "DanaRSKorean", model = "DanaRSKorean", parent = DANA_RS), - DANA_I(description = "DanaI", model = "DanaI", parent = DANA_RS, source = Sources.DanaI), - DANA_RV2(description = "DanaRv2", model = "DanaRv2", parent = DANA_RS, source = Sources.DanaRv2), + DANA_I(description = "DanaI", model = "DanaI", parent = DANA_RS, source = Source.DanaI), + DANA_RV2(description = "DanaRv2", model = "DanaRv2", parent = DANA_RS, source = Source.DanaRv2), OMNIPOD_EROS( description = "Omnipod Eros", manufacturer = ManufacturerType.Insulet, @@ -216,7 +209,7 @@ enum class PumpType { maxReservoirReading = 50, useHardwareLink = true, supportBatteryLevel = false, - source = Sources.OmnipodEros + source = Source.OmnipodEros ), OMNIPOD_DASH( description = "Omnipod Dash", @@ -252,7 +245,7 @@ enum class PumpType { baseBasalStep = 0.05, baseBasalSpecialSteps = null, pumpCapability = PumpCapability.MedtronicCapabilities, - source = Sources.Medtronic + source = Source.Medtronic ), MEDTRONIC_515_715( description = "Medtronic 515/715", @@ -278,7 +271,7 @@ enum class PumpType { baseBasalStep = 0.025, baseBasalSpecialSteps = DoseStepSize.MedtronicVeoBasal, pumpCapability = PumpCapability.MedtronicCapabilities, - source = Sources.Medtronic + source = Source.Medtronic ), MEDTRONIC_554_754_VEO(description = "Medtronic 554/754 (Veo)", model = "554/754 (Veo)", parent = MEDTRONIC_523_723_REVEL), MEDTRONIC_640G( @@ -350,7 +343,7 @@ enum class PumpType { tbrSettings = DoseSettings(1.0, 15, 24 * 60, 0.0, 500.0), extendedBolusSettings = DoseSettings(0.1, 15, 12 * 60, 0.1), pumpCapability = PumpCapability.MDI, - source = Sources.MDI + source = Source.MDI ), // Not real, cached value @@ -376,26 +369,29 @@ enum class PumpType { baseBasalStep = 0.01, baseBasalSpecialSteps = null, pumpCapability = PumpCapability.DiaconnCapabilities, - source = Sources.DiaconnG8), - + source = Source.DiaconnG8 + ), + //EOPatch Pump - EOFLOW_EOPATCH2(description = "Eoflow Eopatch2", - manufacturer = ManufacturerType.Eoflow, - model = "Eopatch", - bolusSize = 0.05, - specialBolusSize = null, - extendedBolusSettings = DoseSettings(0.05, 30, 8 * 60, 0.05, 25.0), - pumpTempBasalType = PumpTempBasalType.Absolute, - tbrSettings = DoseSettings(0.05, 30, 12 * 60, 0.0, 15.0), - specialBasalDurations = PumpCapability.BasalRate_Duration30minAllowed, - baseBasalMinValue = 0.05, - baseBasalMaxValue = 15.0, - baseBasalStep = 0.05, - baseBasalSpecialSteps = null, - pumpCapability = PumpCapability.EopatchCapabilities, - isPatchPump = true, - maxReservoirReading = 50, - source = Sources.EOPatch2); + EOFLOW_EOPATCH2( + description = "Eoflow Eopatch2", + manufacturer = ManufacturerType.Eoflow, + model = "Eopatch", + bolusSize = 0.05, + specialBolusSize = null, + extendedBolusSettings = DoseSettings(0.05, 30, 8 * 60, 0.05, 25.0), + pumpTempBasalType = PumpTempBasalType.Absolute, + tbrSettings = DoseSettings(0.05, 30, 12 * 60, 0.0, 15.0), + specialBasalDurations = PumpCapability.BasalRate_Duration30minAllowed, + baseBasalMinValue = 0.05, + baseBasalMaxValue = 15.0, + baseBasalStep = 0.05, + baseBasalSpecialSteps = null, + pumpCapability = PumpCapability.EopatchCapabilities, + isPatchPump = true, + maxReservoirReading = 50, + source = Source.EOPatch2 + ); val description: String var manufacturer: ManufacturerType? = null @@ -445,52 +441,36 @@ enum class PumpType { var useHardwareLink = false private set private var parent: PumpType? = null - val source: Sources + val source: Source + + enum class Source { + Dana, + DanaR, + DanaRC, + DanaRv2, + DanaRS, + DanaI, + DiaconnG8, + Insight, + Combo, + Medtronic, + Omnipod, + OmnipodEros, + OmnipodDash, + EOPatch2, + MDI, + VirtualPump, + Unknown + } companion object { fun getByDescription(desc: String): PumpType = values().firstOrNull { it.description == desc } ?: GENERIC_AAPS - fun fromDbPumpType(pt: InterfaceIDs.PumpType): PumpType = - when (pt) { - InterfaceIDs.PumpType.GENERIC_AAPS -> GENERIC_AAPS - InterfaceIDs.PumpType.CELLNOVO -> CELLNOVO - InterfaceIDs.PumpType.ACCU_CHEK_COMBO -> ACCU_CHEK_COMBO - InterfaceIDs.PumpType.ACCU_CHEK_SPIRIT -> ACCU_CHEK_SPIRIT - InterfaceIDs.PumpType.ACCU_CHEK_INSIGHT -> ACCU_CHEK_INSIGHT_VIRTUAL - InterfaceIDs.PumpType.ACCU_CHEK_INSIGHT_BLUETOOTH -> ACCU_CHEK_INSIGHT - InterfaceIDs.PumpType.ACCU_CHEK_SOLO -> ACCU_CHEK_SOLO - InterfaceIDs.PumpType.ANIMAS_VIBE -> ANIMAS_VIBE - InterfaceIDs.PumpType.ANIMAS_PING -> ANIMAS_PING - InterfaceIDs.PumpType.DANA_R -> DANA_R - InterfaceIDs.PumpType.DANA_R_KOREAN -> DANA_R_KOREAN - InterfaceIDs.PumpType.DANA_RS -> DANA_RS - InterfaceIDs.PumpType.DANA_RS_KOREAN -> DANA_RS_KOREAN - InterfaceIDs.PumpType.DANA_RV2 -> DANA_RV2 - InterfaceIDs.PumpType.DANA_I -> DANA_I - InterfaceIDs.PumpType.OMNIPOD_EROS -> OMNIPOD_EROS - InterfaceIDs.PumpType.OMNIPOD_DASH -> OMNIPOD_DASH - InterfaceIDs.PumpType.MEDTRONIC_512_517 -> MEDTRONIC_512_712 - InterfaceIDs.PumpType.MEDTRONIC_515_715 -> MEDTRONIC_515_715 - InterfaceIDs.PumpType.MEDTRONIC_522_722 -> MEDTRONIC_522_722 - InterfaceIDs.PumpType.MEDTRONIC_523_723_REVEL -> MEDTRONIC_523_723_REVEL - InterfaceIDs.PumpType.MEDTRONIC_554_754_VEO -> MEDTRONIC_554_754_VEO - InterfaceIDs.PumpType.MEDTRONIC_640G -> MEDTRONIC_640G - InterfaceIDs.PumpType.TANDEM_T_SLIM -> TANDEM_T_SLIM - InterfaceIDs.PumpType.TANDEM_T_SLIM_G4 -> TANDEM_T_SLIM_G4 - InterfaceIDs.PumpType.TANDEM_T_FLEX -> TANDEM_T_FLEX - InterfaceIDs.PumpType.TANDEM_T_SLIM_X2 -> TANDEM_T_SLIM_X2 - InterfaceIDs.PumpType.YPSOPUMP -> YPSOPUMP - InterfaceIDs.PumpType.MDI -> MDI - InterfaceIDs.PumpType.USER -> USER - InterfaceIDs.PumpType.DIACONN_G8 -> DIACONN_G8 - InterfaceIDs.PumpType.EOPATCH2 -> EOFLOW_EOPATCH2 - InterfaceIDs.PumpType.CACHE -> CACHE - } } - constructor(description: String, model: String, parent: PumpType, pumpCapability: PumpCapability? = null, source: Sources? = null) { + constructor(description: String, model: String, parent: PumpType, pumpCapability: PumpCapability? = null, source: Source? = null) { this.description = description this.parent = parent this.source = source ?: parent.source @@ -518,7 +498,7 @@ enum class PumpType { maxReservoirReading: Int = 50, supportBatteryLevel: Boolean = true, useHardwareLink: Boolean = false, - source: Sources = Sources.VirtualPump + source: Source = Source.VirtualPump ) { this.description = description this.manufacturer = manufacturer @@ -585,41 +565,4 @@ enum class PumpType { ?: baseBasalStep ) } - - fun toDbPumpType(): InterfaceIDs.PumpType = - when (this) { - GENERIC_AAPS -> InterfaceIDs.PumpType.GENERIC_AAPS - CELLNOVO -> InterfaceIDs.PumpType.CELLNOVO - ACCU_CHEK_COMBO -> InterfaceIDs.PumpType.ACCU_CHEK_COMBO - ACCU_CHEK_SPIRIT -> InterfaceIDs.PumpType.ACCU_CHEK_SPIRIT - ACCU_CHEK_INSIGHT_VIRTUAL -> InterfaceIDs.PumpType.ACCU_CHEK_INSIGHT - ACCU_CHEK_INSIGHT -> InterfaceIDs.PumpType.ACCU_CHEK_INSIGHT_BLUETOOTH - ACCU_CHEK_SOLO -> InterfaceIDs.PumpType.ACCU_CHEK_SOLO - ANIMAS_VIBE -> InterfaceIDs.PumpType.ANIMAS_VIBE - ANIMAS_PING -> InterfaceIDs.PumpType.ANIMAS_PING - DANA_R -> InterfaceIDs.PumpType.DANA_R - DANA_R_KOREAN -> InterfaceIDs.PumpType.DANA_R_KOREAN - DANA_RS -> InterfaceIDs.PumpType.DANA_RS - DANA_RS_KOREAN -> InterfaceIDs.PumpType.DANA_RS_KOREAN - DANA_RV2 -> InterfaceIDs.PumpType.DANA_RV2 - DANA_I -> InterfaceIDs.PumpType.DANA_I - OMNIPOD_EROS -> InterfaceIDs.PumpType.OMNIPOD_EROS - OMNIPOD_DASH -> InterfaceIDs.PumpType.OMNIPOD_DASH - MEDTRONIC_512_712 -> InterfaceIDs.PumpType.MEDTRONIC_512_517 - MEDTRONIC_515_715 -> InterfaceIDs.PumpType.MEDTRONIC_515_715 - MEDTRONIC_522_722 -> InterfaceIDs.PumpType.MEDTRONIC_522_722 - MEDTRONIC_523_723_REVEL -> InterfaceIDs.PumpType.MEDTRONIC_523_723_REVEL - MEDTRONIC_554_754_VEO -> InterfaceIDs.PumpType.MEDTRONIC_554_754_VEO - MEDTRONIC_640G -> InterfaceIDs.PumpType.MEDTRONIC_640G - TANDEM_T_SLIM -> InterfaceIDs.PumpType.TANDEM_T_SLIM - TANDEM_T_SLIM_G4 -> InterfaceIDs.PumpType.TANDEM_T_SLIM_G4 - TANDEM_T_FLEX -> InterfaceIDs.PumpType.TANDEM_T_FLEX - TANDEM_T_SLIM_X2 -> InterfaceIDs.PumpType.TANDEM_T_SLIM_X2 - YPSOPUMP -> InterfaceIDs.PumpType.YPSOPUMP - MDI -> InterfaceIDs.PumpType.MDI - USER -> InterfaceIDs.PumpType.USER - DIACONN_G8 -> InterfaceIDs.PumpType.DIACONN_G8 - EOFLOW_EOPATCH2 -> InterfaceIDs.PumpType.EOPATCH2 - CACHE -> InterfaceIDs.PumpType.CACHE - } -} +} \ No newline at end of file diff --git a/interfaces/src/main/res/values/strings.xml b/interfaces/src/main/res/values/strings.xml index aba75400d9..03219bda89 100644 --- a/interfaces/src/main/res/values/strings.xml +++ b/interfaces/src/main/res/values/strings.xml @@ -15,4 +15,7 @@ language + + * Only discrete values no ranges are supported as granularity for basal/bolus in virtual pump. + diff --git a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt index 9512189fdf..dc5788bee6 100644 --- a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt +++ b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.database.interfaces.TraceableDBEntry import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.rx.logging.AAPSLogger import info.nightscout.androidaps.plugin.general.openhumans.delegates.OHAppIDDelegate diff --git a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt index 55706a3a68..bb018bda28 100644 --- a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt +++ b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt @@ -2,13 +2,13 @@ package info.nightscout.plugins.configBuilder import info.nightscout.androidaps.core.R import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.interfaces.PumpSync 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.interfaces.pump.PumpType import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt index cd38ec6446..f3875cc2cd 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.constraints.bgQualityCheck import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt index a539bf15ec..53690ec3ae 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt @@ -2,10 +2,10 @@ package info.nightscout.plugins.constraints.dstHelper import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt index 6284ad631a..c5ee79edd8 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt @@ -5,7 +5,7 @@ import android.os.Build import com.scottyab.rootbeer.RootBeer import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt index 40f66c607c..258f248f3d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt @@ -5,9 +5,9 @@ import android.content.pm.PackageManager import android.os.Handler import android.os.HandlerThread import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt index c635cb094f..b71f025c06 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt @@ -5,9 +5,9 @@ import android.os.StatFs import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Constants import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt index c82e70556b..52a80549f3 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt @@ -2,9 +2,9 @@ package info.nightscout.plugins.constraints.versionChecker import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 1fe426eb60..07037437f9 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -28,7 +28,7 @@ import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.shared.extensions.runOnUiThread import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index cf1477b2c4..ffd4f5545f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Autotune import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index 5b6335cbc2..6b4e4b6594 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.extensions.blockValueBySeconds import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt index bc009d3b1d..1a154ef176 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.Food import info.nightscout.androidaps.database.transactions.SyncNsFoodTransaction import info.nightscout.androidaps.extensions.foodFromJson -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt index 105682c734..3caa3d3903 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt @@ -13,7 +13,7 @@ import android.view.ViewGroup import androidx.core.app.NotificationCompat import androidx.recyclerview.widget.RecyclerView import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.IconsProvider +import info.nightscout.interfaces.IconsProvider import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.notifications.Notification 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 46bcced601..e8f7c6acd6 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 @@ -27,12 +27,12 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync diff --git a/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt index e8d6b4f171..86e00294bf 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt @@ -6,7 +6,7 @@ import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt index 6b03ffee42..824c9dbc13 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt index b4a4b96399..8999ce4d78 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.database.embedments.InsulinConfiguration import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index 44eb25b9e4..e5c63c6df1 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index 4092d333ac..361914fc60 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -13,8 +13,8 @@ import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile diff --git a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt index 5dad72b728..016cf57de4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -15,11 +15,11 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator 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.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.InstanceId import info.nightscout.interfaces.Config diff --git a/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt index f4605abc85..77a3f3df4b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.PluginBase +import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt index 5cfd4cb35b..46658494b0 100644 --- a/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt @@ -10,7 +10,7 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.receivers.DataWorkerStorage diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index e2bb2515c3..64a76e27ca 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -16,9 +16,9 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.database.entities.UserEntry 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.interfaces.NsClient +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.PluginFragment import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt index f4f0059d98..a0161b55ff 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt @@ -32,7 +32,7 @@ import info.nightscout.androidaps.database.transactions.SyncNsTemporaryTargetTra import info.nightscout.androidaps.database.transactions.SyncNsTherapyEventTransaction import info.nightscout.androidaps.database.transactions.UserEntryTransaction import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt index a808d14a74..203531a68b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.sync.nsShared.events -import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.interfaces.NsClient import info.nightscout.rx.events.Event import java.text.SimpleDateFormat import java.util.Locale diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt index 0fb562e43e..68e0958394 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsShared.events import info.nightscout.androidaps.events.EventStatus -import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.interfaces.NsClient import info.nightscout.shared.interfaces.ResourceHelper class EventNSClientStatus(var text: String, val version: NsClient.Version) : EventStatus() { diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt index 0c230c2a7d..96dcdfbacd 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt @@ -14,9 +14,9 @@ import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector 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.androidaps.interfaces.Sync +import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.Sync import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.BuildHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt index a710996e2c..e0205828a6 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.sync.nsclient.data -import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.Config import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.JsonHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index 144be220ed..5c0c6929eb 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -4,7 +4,7 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.utils.JsonHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt index 071985691a..601edffeab 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -2,7 +2,7 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T 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 e7201d774c..edb2e4ab77 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 @@ -2,7 +2,7 @@ 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.GlucoseUnit import info.nightscout.interfaces.Constants import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.sync.nsclient.data.NSMbg diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt index c27ddd9b35..e5887e21e7 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt @@ -19,7 +19,7 @@ import dagger.android.HasAndroidInjector 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.interfaces.NsClient import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.receivers.DataWorkerStorage diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt index 8878129b16..aa9fcd4bed 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt @@ -35,7 +35,7 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairProfileSwitch 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.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt index 952d208407..056b0870c3 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairProfileSwitch 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.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 353676cf46..ceb462d5c1 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -13,9 +13,9 @@ import androidx.work.WorkInfo import androidx.work.WorkManager import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.interfaces.NsClient -import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.androidaps.interfaces.Sync +import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.Sync import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.interfaces.BuildHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt index f6f577767f..937f56a258 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt @@ -8,7 +8,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.plugins.R import info.nightscout.plugins.source.NSClientSourcePlugin diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt index d751339faf..265372776a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt @@ -5,7 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt index 44c3a658ef..997bd7bab5 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -8,7 +8,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.NsClient +import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.plugins.sync.nsShared.StoreDataForDb import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt index 8081ad492e..f42290a305 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt @@ -7,8 +7,8 @@ import androidx.preference.PreferenceFragmentCompat import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.interfaces.PluginBase -import info.nightscout.androidaps.interfaces.Sync +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.Sync import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 526446dbf4..6d317c2037 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -6,10 +6,10 @@ import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt index 718322e5ec..f883b67ba8 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt index 8118643c17..64cd79fa8d 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt @@ -3,7 +3,7 @@ package info.nightscout.plugins.constraints.storage import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/versionChecker/AllowedVersionsTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/versionChecker/AllowedVersionsTest.kt index df02799812..cffea50d55 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/versionChecker/AllowedVersionsTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/versionChecker/AllowedVersionsTest.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.constraints.versionChecker -import info.nightscout.androidaps.plugins.constraints.versionChecker.AllowedVersions +import info.nightscout.interfaces.constraints.versionChecker.AllowedVersions import org.joda.time.LocalDate import org.json.JSONArray import org.json.JSONObject diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt index 8c3e3b9721..a6ab41e52b 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.T diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt index 30fc5b19cb..8e2efcd58e 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt @@ -13,7 +13,7 @@ import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.extensions.shiftBlock -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper 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 32b55291b1..9b6ec2df22 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 @@ -16,18 +16,18 @@ import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTe import info.nightscout.androidaps.database.transactions.Transaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileSource -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt index 9d5eceb551..1c0fbcb153 100644 --- a/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.plugins.R diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 6864e05aa2..1a886cd10c 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -27,13 +27,13 @@ import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.Constraint; +import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.interfaces.PluginDescription; 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.interfaces.pump.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.shared.interfaces.ResourceHelper; @@ -55,7 +55,7 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistory; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistoryRequest; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Tdd; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; +import info.nightscout.interfaces.pump.PumpType; import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.InstanceId; import info.nightscout.shared.utils.T; diff --git a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt index 201bd5d29d..c70ea97120 100644 --- a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt +++ b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.combo.R import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt index 5b82966aaf..8fdd2a7429 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt @@ -20,11 +20,11 @@ import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Dana +import info.nightscout.interfaces.Dana import info.nightscout.androidaps.interfaces.Pump import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.rx.events.EventQueueChanged import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt index e45bcf669e..a8ab56ba04 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.shared.utils.T diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt index b16b364224..a6a1dc7531 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt @@ -21,7 +21,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt index 02afdb9609..0f187cae8e 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.dana.databinding.DanarUserOptionsActivityBindi import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index b44f7a0ff7..be0cde9827 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -15,13 +15,13 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.interfaces.data.PumpEnactResult diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java index 3e4cc125b7..b976c5516e 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java @@ -50,7 +50,7 @@ import info.nightscout.shared.interfaces.ResourceHelper; 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.interfaces.pump.PumpType; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.shared.utils.DateUtil; import info.nightscout.shared.utils.T; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index d7aabc0c80..737b5f6f53 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -21,7 +21,7 @@ import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.Constraint; +import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; @@ -29,7 +29,7 @@ import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; +import info.nightscout.interfaces.pump.PumpType; import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.interfaces.utils.Round; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt index 2ac150f815..692d81d004 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.danar.comm.MessageBase import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.shared.utils.T import info.nightscout.rx.logging.LTag import java.util.GregorianCalendar diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java index db3d566fe1..8f16467156 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java @@ -64,7 +64,7 @@ import info.nightscout.shared.interfaces.ResourceHelper; 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.interfaces.pump.PumpType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.shared.utils.DateUtil; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index 17bbd983a7..50037a8eb5 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -16,13 +16,13 @@ import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.Constraint; +import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.androidaps.interfaces.Dana; +import info.nightscout.interfaces.Dana; import info.nightscout.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.Pump; -import info.nightscout.androidaps.interfaces.PumpDescription; +import info.nightscout.interfaces.pump.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.shared.interfaces.ResourceHelper; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index 0304cfc9d5..a8968809ae 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -20,17 +20,16 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.Constraint; +import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; +import info.nightscout.interfaces.pump.PumpType; import info.nightscout.shared.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.interfaces.utils.Round; -import info.nightscout.interfaces.PluginType; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventAppExit; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt index e6e6b04a85..0475485fe9 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.comm.MessageOriginalNames.getName import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt index c58098684a..d920a16c19 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt index e5fefdc791..9c82f2682d 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt index ac9735ac6a..126bf34b9e 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java index e925c11fbb..da21a175c8 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java @@ -56,7 +56,7 @@ import info.nightscout.shared.interfaces.ResourceHelper; 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.interfaces.pump.PumpType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.rx.bus.RxBus; diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 2caee076ef..32d027eaff 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -6,10 +6,10 @@ import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt index d68a7e0db5..27db7e5408 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt index 3b57d248c8..1965551c0c 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.comm.MessageBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.ConfigBuilder +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MessageHashTableRTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MessageHashTableRTest.kt index 1a080a0d10..7f3557ca5d 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MessageHashTableRTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MessageHashTableRTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MessageHashTableR -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartTest.kt index 2b00d74b25..9a404ddf22 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgBolusStart -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito.`when` diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartWithSpeedTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartWithSpeedTest.kt index 0421e408b9..f3d7917092 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartWithSpeedTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartWithSpeedTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgBolusStartWithSpeed -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSetExtendedBolusStartTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSetExtendedBolusStartTest.kt index 8d0ff919d7..7ce268f28e 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSetExtendedBolusStartTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSetExtendedBolusStartTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgSetExtendedBolusStart -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito.`when` diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSettingBasalTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSettingBasalTest.kt index b4380177cb..00cbdcd754 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSettingBasalTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSettingBasalTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgSettingBasal -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import org.junit.Assert import org.junit.Test import org.mockito.Mockito.`when` diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt index 1f49efa241..e0f7cebf4c 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/comm/MessageHashTableRKoreanTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/comm/MessageHashTableRKoreanTest.kt index 3d23027a0e..9c053d2990 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/comm/MessageHashTableRKoreanTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/comm/MessageHashTableRKoreanTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm import info.nightscout.androidaps.danaRKorean.comm.MessageHashTableRKorean -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.plugins.pump.danaR.comm.DanaRTestBase import org.junit.Assert import org.junit.Test diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt index d059f24212..b8ea019892 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MessageHashTableRv2Test.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MessageHashTableRv2Test.kt index 2b5fa5d957..815fef0d08 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MessageHashTableRv2Test.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MessageHashTableRv2Test.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.danaRv2.comm import info.nightscout.androidaps.danaRv2.comm.MessageHashTableRv2 import info.nightscout.androidaps.danaRv2.comm.MsgStatusAPS_v2 import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.plugins.pump.danaR.comm.DanaRTestBase import org.junit.Assert import org.junit.Test diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index 7bf0b799b2..93b0d7a7e2 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -19,14 +19,14 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Dana +import info.nightscout.interfaces.Dana import info.nightscout.interfaces.PluginDescription 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.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper @@ -37,7 +37,7 @@ import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt index 847840582e..528c1cfb31 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.danars.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.rx.logging.LTag diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt index 38611f78d4..8821e375e4 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.danars.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt index 458976386f..7e7504cb76 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt @@ -4,7 +4,7 @@ import android.content.Context import dagger.android.AndroidInjector import info.nightscout.interfaces.Constants import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsMessageHashTableTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsMessageHashTableTest.kt index bf0e31b6a4..0d3147c3e1 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsMessageHashTableTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsMessageHashTableTest.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.DanaRSTestBase import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import org.junit.Assert import org.junit.Test diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt index cfdd79d1b2..2830b3f4fc 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt @@ -6,7 +6,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.danars.DanaRSTestBase import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index 2d6458daee..1fea57bb3a 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -17,14 +17,14 @@ import info.nightscout.androidaps.diaconn.service.DiaconnG8Service import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint +import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.interfaces.Diaconn import info.nightscout.interfaces.PluginDescription 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.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper @@ -37,7 +37,7 @@ import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt index 46fda8d2e8..1e3dbcdc15 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt @@ -42,12 +42,12 @@ import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.shared.extensions.safeGetPackageInfo import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt index 7ea91b38cb..0a13886f76 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt @@ -4,9 +4,9 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP import org.joda.time.DateTime diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index 00950b50cc..5b8abc171f 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -61,7 +61,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotifi import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.shared.utils.DateUtil diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index 8ba4400a02..30055959ab 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper @@ -20,7 +20,7 @@ import info.nightscout.interfaces.pump.actions.CustomActionType 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.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt index 963dacd15c..3521fc2489 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper 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.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.eopatch.EONotification import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus import info.nightscout.androidaps.plugins.pump.eopatch.R diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java index c642ccb059..c381fa1224 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java @@ -15,7 +15,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue; 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.interfaces.pump.PumpType; import info.nightscout.androidaps.plugins.pump.eopatch.R; import info.nightscout.androidaps.plugins.pump.eopatch.RxAction; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java index ce1f5bf130..3c3b93b119 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java @@ -35,7 +35,7 @@ import javax.inject.Singleton; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; +import info.nightscout.interfaces.pump.PumpType; import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.ble.task.ActivateTask; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt index 5ccecbeebc..166b261687 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt @@ -6,7 +6,7 @@ import androidx.lifecycle.Transformations 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.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index 3ddb56fb23..d7477803ad 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -27,7 +27,7 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.rx.events.EventRefreshButtonState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt index 0838bcda9d..703a2c5c16 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm import android.os.SystemClock -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt index acfe57893f..27dbf08dd2 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BasalProfile import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BatteryStatusDTO import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index 6dae0651c7..eb9b886bbc 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntry import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryBolus import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryTBR diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt index ccfb09aadb..b420030fde 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto import com.google.gson.annotations.Expose -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt index 8f0e046829..fb3dd00804 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.driver -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 21488681c3..6eff10b3eb 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -18,7 +18,7 @@ import info.nightscout.interfaces.PluginDescription 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.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper @@ -29,7 +29,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNo 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.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt index 140d36479b..893dd59b67 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt @@ -13,7 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index 89e39b1dae..c5f038025c 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.interfaces.notifications.Notification -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InsertCannulaViewModel import info.nightscout.androidaps.plugins.pump.omnipod.dash.R diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt index 1c2d69e41e..f4f95f7f03 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.util import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram import java.util.* import kotlin.math.roundToInt diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index be7b1de920..a627f4d4cc 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -45,7 +45,7 @@ import info.nightscout.interfaces.PluginDescription; 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.interfaces.pump.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.shared.interfaces.ResourceHelper; @@ -54,7 +54,7 @@ import info.nightscout.interfaces.pump.actions.CustomActionType; 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.plugins.pump.common.defs.PumpType; +import info.nightscout.interfaces.pump.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index 27f947f3ac..ac72260156 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -21,7 +21,7 @@ import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; +import info.nightscout.interfaces.pump.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java index 37d17be423..c50760d2e5 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java @@ -26,7 +26,7 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; +import info.nightscout.interfaces.pump.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt index 4c7cc4be21..8cf44d746e 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index 49506fb4f0..492827ab9a 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType @@ -27,7 +27,7 @@ import info.nightscout.interfaces.pump.ManufacturerType import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryCarbs import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage import info.nightscout.shared.utils.DateUtil diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.kt index 9c4ea272d9..d1b1f40fc9 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.data import info.nightscout.androidaps.plugins.pump.common.defs.PumpRunningState -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import java.util.* /** diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt index e208a22d6e..d2ae0a4616 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.sync import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType // data class PumpDbEntry constructor(var temporaryId: Long, // var date: Long, @@ -59,10 +59,10 @@ data class PumpDbEntryBolus(override var temporaryId: Long, var bolusType: DetailedBolusInfo.BolusType) : PumpDbEntry { constructor(temporaryId: Long, - date: Long, - pumpType: PumpType, - serialNumber: String, - detailedBolusInfo: DetailedBolusInfo) : this(temporaryId, date, pumpType, serialNumber, null, + date: Long, + pumpType: PumpType, + serialNumber: String, + detailedBolusInfo: DetailedBolusInfo) : this(temporaryId, date, pumpType, serialNumber, null, detailedBolusInfo.insulin, detailedBolusInfo.carbs, detailedBolusInfo.bolusType) diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncEntriesCreator.java b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncEntriesCreator.java index 1ba73df0bb..40d409938f 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncEntriesCreator.java +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncEntriesCreator.java @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.common.sync; -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; +import info.nightscout.interfaces.pump.PumpType; public interface PumpSyncEntriesCreator { diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt index f5100096dc..bf6f2f7045 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.utils import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Profile.ProfileValue -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import java.util.* object ProfileUtil { diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index 5dcc39a3ca..eef0a09e79 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.extensions.total import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.shared.utils.T diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index eab367c440..fbcc9eabbe 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.shared.extensions.toVisibility -import info.nightscout.androidaps.interfaces.ImportExportPrefs +import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt index 4c192e8a90..a3d4033636 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt @@ -2,7 +2,7 @@ package info.nightscout.ui.defaultProfile import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.utils.extensions.pureProfileFromJson -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.Round diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt index 7dd694b303..af3bf2b95c 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt @@ -3,7 +3,7 @@ package info.nightscout.ui.defaultProfile import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.utils.extensions.pureProfileFromJson -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.shared.utils.DateUtil import org.json.JSONArray diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt index b541f01211..072760124b 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt @@ -12,7 +12,7 @@ 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.dialogs.DialogFragmentWithDate -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index 8909f5caa8..6e468daacc 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -21,8 +21,8 @@ import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.CarbTimer import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Constraint -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt index 33eceee057..862d85184d 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.fromConstant -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt index cbf78ae4e9..6694f86066 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt @@ -23,7 +23,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile diff --git a/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 526446dbf4..6d317c2037 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -6,10 +6,10 @@ import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpDescription +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.androidaps.plugins.pump.common.defs.PumpType +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/ui/src/test/java/info/nightscout/ui/defaultProfile/DefaultProfileTest.kt b/ui/src/test/java/info/nightscout/ui/defaultProfile/DefaultProfileTest.kt index d24fcd4cbc..e84e0b4e77 100644 --- a/ui/src/test/java/info/nightscout/ui/defaultProfile/DefaultProfileTest.kt +++ b/ui/src/test/java/info/nightscout/ui/defaultProfile/DefaultProfileTest.kt @@ -2,7 +2,7 @@ package info.nightscout.ui.defaultProfile import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.interfaces.GlucoseUnit +import info.nightscout.interfaces.GlucoseUnit import org.junit.Assert.assertEquals import org.junit.Test From 14816fca504974ef4dd85242cb4a1583a83cc8e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 08:01:33 +0000 Subject: [PATCH 15/42] chore(deps): bump org.jetbrains.kotlin.android from 1.7.20 to 1.7.21 Bumps org.jetbrains.kotlin.android from 1.7.20 to 1.7.21. --- updated-dependencies: - dependency-name: org.jetbrains.kotlin.android dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c4af65575f..6b341ed50d 100644 --- a/build.gradle +++ b/build.gradle @@ -70,7 +70,7 @@ plugins { id "io.gitlab.arturbosch.detekt" version "1.21.0" id "org.jlleitschuh.gradle.ktlint" version "11.0.0" id 'org.barfuin.gradle.jacocolog' version '2.0.0' - id 'org.jetbrains.kotlin.android' version '1.7.20' apply false + id 'org.jetbrains.kotlin.android' version '1.7.21' apply false } allprojects { From 1c95cb107d66ce384d7e9aca961513a3d4d1c1d8 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 9 Nov 2022 10:48:59 +0100 Subject: [PATCH 16/42] WeekDayPicker -> automations --- automation/build.gradle | 3 +++ .../info/nightscout/automation/elements/InputWeekDay.kt | 2 +- .../java/info/nightscout/automation}/ui/WeekdayPicker.kt | 6 +++--- .../src/main/res/drawable/weekday_circle_brackground.xml | 0 .../src/main/res/drawable/weekend_circle_brackground.xml | 0 .../src/main/res/layout/weekday_picker.xml | 0 automation/src/main/res/values/strings.xml | 9 +++++++++ core/src/main/res/values/strings.xml | 9 --------- 8 files changed, 16 insertions(+), 13 deletions(-) rename {core/src/main/java/info/nightscout/androidaps/utils => automation/src/main/java/info/nightscout/automation}/ui/WeekdayPicker.kt (95%) rename {core => automation}/src/main/res/drawable/weekday_circle_brackground.xml (100%) rename {core => automation}/src/main/res/drawable/weekend_circle_brackground.xml (100%) rename {core => automation}/src/main/res/layout/weekday_picker.xml (100%) diff --git a/automation/build.gradle b/automation/build.gradle index 320fffc2b2..0b7f76f4f4 100644 --- a/automation/build.gradle +++ b/automation/build.gradle @@ -11,6 +11,7 @@ apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" + android { namespace 'info.nightscout.automation' } @@ -22,4 +23,6 @@ dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') + + api "androidx.constraintlayout:constraintlayout:$constraintlayout_version" } \ No newline at end of file diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputWeekDay.kt b/automation/src/main/java/info/nightscout/automation/elements/InputWeekDay.kt index 4f761687e5..e63e5acb21 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputWeekDay.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputWeekDay.kt @@ -2,7 +2,7 @@ package info.nightscout.automation.elements import android.widget.LinearLayout import androidx.annotation.StringRes -import info.nightscout.androidaps.utils.ui.WeekdayPicker +import info.nightscout.automation.ui.WeekdayPicker import info.nightscout.automation.R import java.util.Calendar diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/WeekdayPicker.kt b/automation/src/main/java/info/nightscout/automation/ui/WeekdayPicker.kt similarity index 95% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/WeekdayPicker.kt rename to automation/src/main/java/info/nightscout/automation/ui/WeekdayPicker.kt index c5eaa9986b..4b86c01ac5 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/WeekdayPicker.kt +++ b/automation/src/main/java/info/nightscout/automation/ui/WeekdayPicker.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.utils.ui +package info.nightscout.automation.ui import android.content.Context import android.util.AttributeSet @@ -6,9 +6,9 @@ import android.view.LayoutInflater import android.widget.Checkable import androidx.appcompat.widget.AppCompatCheckedTextView import androidx.constraintlayout.widget.ConstraintLayout -import info.nightscout.androidaps.core.databinding.WeekdayPickerBinding +import info.nightscout.automation.databinding.WeekdayPickerBinding import info.nightscout.shared.extensions.toVisibility -import java.util.* +import java.util.Calendar class WeekdayPicker constructor( context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 diff --git a/core/src/main/res/drawable/weekday_circle_brackground.xml b/automation/src/main/res/drawable/weekday_circle_brackground.xml similarity index 100% rename from core/src/main/res/drawable/weekday_circle_brackground.xml rename to automation/src/main/res/drawable/weekday_circle_brackground.xml diff --git a/core/src/main/res/drawable/weekend_circle_brackground.xml b/automation/src/main/res/drawable/weekend_circle_brackground.xml similarity index 100% rename from core/src/main/res/drawable/weekend_circle_brackground.xml rename to automation/src/main/res/drawable/weekend_circle_brackground.xml diff --git a/core/src/main/res/layout/weekday_picker.xml b/automation/src/main/res/layout/weekday_picker.xml similarity index 100% rename from core/src/main/res/layout/weekday_picker.xml rename to automation/src/main/res/layout/weekday_picker.xml diff --git a/automation/src/main/res/values/strings.xml b/automation/src/main/res/values/strings.xml index 62883c0dc6..73f6fa9b0d 100644 --- a/automation/src/main/res/values/strings.xml +++ b/automation/src/main/res/values/strings.xml @@ -126,4 +126,13 @@ Remove/sort Stop processing + + M + T + W + T + F + S + S + \ No newline at end of file diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 44760211ae..441a580345 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -434,15 +434,6 @@ Please reboot your phone or restart AAPS from the System Settings \notherwise Android APS will not have logging (important to track and verify that the algorithms are working correctly)! - - M - T - W - T - F - S - S - BOLUS BOLUS CALCULATOR From efd4d43a50d133ceff439176b3c1a0e9e993d2c7 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 9 Nov 2022 12:20:03 +0100 Subject: [PATCH 17/42] build.gradle optimization --- app-wear-shared/rx/build.gradle | 1 - app-wear-shared/shared-impl/build.gradle | 2 - app/build.gradle | 14 ++- .../utils/buildHelper/ConfigImpl.kt | 2 + .../automation/actions/ActionAlarm.kt | 4 +- core/android_module_dependencies.gradle | 2 - core/build.gradle | 71 +++++++++++++- core/core_dependencies.gradle | 96 ------------------- .../extensions/HexByteArrayConversion.kt | 2 +- .../maintenance/PrefFileListProvider.kt | 12 +-- .../implementation/AndroidPermissionImpl.kt | 22 ++--- .../implementation/queue/QueueThread.kt | 2 +- .../java/info/nightscout/interfaces/Config.kt | 1 + openhumans/build.gradle | 3 + plugins/build.gradle | 24 +++++ pump/danars/build.gradle | 6 ++ pump/diaconn/build.gradle | 8 +- .../cgms/MedtronicCGMSHistoryDecoder.kt | 6 +- pump/omnipod-common/build.gradle | 3 + .../ui/activities/SurveyActivity.kt | 9 +- wear/build.gradle | 2 - 21 files changed, 149 insertions(+), 143 deletions(-) delete mode 100644 core/core_dependencies.gradle diff --git a/app-wear-shared/rx/build.gradle b/app-wear-shared/rx/build.gradle index feff93f500..1b00eee9b4 100644 --- a/app-wear-shared/rx/build.gradle +++ b/app-wear-shared/rx/build.gradle @@ -9,7 +9,6 @@ plugins { apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/app-wear-shared/shared-impl/build.gradle b/app-wear-shared/shared-impl/build.gradle index ada8320490..04dcfe1d45 100644 --- a/app-wear-shared/shared-impl/build.gradle +++ b/app-wear-shared/shared-impl/build.gradle @@ -9,8 +9,6 @@ plugins { apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -//apply from: "${project.rootDir}/core/test_dependencies.gradle" -//apply from: "${project.rootDir}/core/jacoco_global.gradle" android { diff --git a/app/build.gradle b/app/build.gradle index 3c04647ee4..2107271ee5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -213,12 +213,18 @@ dependencies { /* Dagger2 - We are going to use dagger.android which includes * support for Activity and fragment injection so we need to include * the following dependencies */ - annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version" - annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version" kapt "com.google.dagger:dagger-android-processor:$dagger_version" - - /* Dagger2 - default dependency */ kapt "com.google.dagger:dagger-compiler:$dagger_version" + + // MainApp + api "com.uber.rxdogtag2:rxdogtag:2.0.1" + + // Overview + api 'com.google.android.flexbox:flexbox:3.0.0' + + // APS + api 'org.mozilla:rhino:1.7.14' + } apply from: "${project.rootDir}/core/test_dependencies.gradle" diff --git a/app/src/main/java/info/nightscout/androidaps/utils/buildHelper/ConfigImpl.kt b/app/src/main/java/info/nightscout/androidaps/utils/buildHelper/ConfigImpl.kt index 3e6df9efe7..cb78a6cbf4 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/buildHelper/ConfigImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/buildHelper/ConfigImpl.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.utils.buildHelper import android.os.Build import info.nightscout.androidaps.BuildConfig +import info.nightscout.androidaps.R import info.nightscout.interfaces.Config import javax.inject.Inject import javax.inject.Singleton @@ -20,4 +21,5 @@ class ConfigImpl @Inject constructor() : Config { override val currentDeviceModelString = Build.MANUFACTURER + " " + Build.MODEL + " (" + Build.DEVICE + ")" + override val appName: Int = R.string.app_name } \ No newline at end of file diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt index c16a3662e1..98932c95e4 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionAlarm.kt @@ -13,6 +13,7 @@ import info.nightscout.automation.R import info.nightscout.automation.elements.InputString import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder +import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import org.json.JSONObject import javax.inject.Inject @@ -23,6 +24,7 @@ class ActionAlarm(injector: HasAndroidInjector) : Action(injector) { @Inject lateinit var context: Context @Inject lateinit var dateUtil: DateUtil @Inject lateinit var timerUtil: TimerUtil + @Inject lateinit var config: Config var text = InputString() @@ -38,7 +40,7 @@ class ActionAlarm(injector: HasAndroidInjector) : Action(injector) { override fun doAction(callback: Callback) { timerUtil.scheduleReminder(10, text.value.takeIf { it.isNotBlank() } - ?: rh.gs(R.string.app_name)) + ?: rh.gs(config.appName)) callback.result(PumpEnactResultImpl(injector).success(true).comment(R.string.ok)).run() } diff --git a/core/android_module_dependencies.gradle b/core/android_module_dependencies.gradle index bcc7585a61..df27afb3fb 100644 --- a/core/android_module_dependencies.gradle +++ b/core/android_module_dependencies.gradle @@ -23,8 +23,6 @@ android { } dependencies { - annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version" - annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version" kapt "com.google.dagger:dagger-android-processor:$dagger_version" kapt "com.google.dagger:dagger-compiler:$dagger_version" diff --git a/core/build.gradle b/core/build.gradle index 9e6e9006c2..e1c2733b7a 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -7,7 +7,6 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: 'core_dependencies.gradle' apply from: "${project.rootDir}/core/android_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/allopen_dependencies.gradle" @@ -20,6 +19,76 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':database') implementation project(':interfaces') + + api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" + api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" + api "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version" + api "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutines_version" + + api "androidx.activity:activity-ktx:$activity_version" + api "androidx.appcompat:appcompat:$appcompat_version" + + api 'androidx.biometric:biometric:1.1.0' + + api "androidx.browser:browser:1.4.0" + api 'androidx.cardview:cardview:1.0.0' + api "androidx.constraintlayout:constraintlayout:$constraintlayout_version" + api "androidx.core:core-ktx:$core_version" + api "androidx.fragment:fragment-ktx:$fragmentktx_version" + api 'androidx.legacy:legacy-support-v13:1.0.0' + api 'androidx.legacy:legacy-support-v4:1.0.0' + api "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" + api "androidx.lifecycle:lifecycle-process:$lifecycle_version" + api "androidx.navigation:navigation-fragment-ktx:$nav_version" + api "androidx.navigation:navigation-runtime-ktx:$nav_version" + api "androidx.navigation:navigation-ui-ktx:$nav_version" + api 'androidx.percentlayout:percentlayout:1.0.0' + api "androidx.preference:preference-ktx:$preferencektx_version" + api 'androidx.recyclerview:recyclerview:1.2.1' + + api 'androidx.gridlayout:gridlayout:1.0.0' + + api "com.google.android.material:material:$material_version" + + api "com.google.dagger:dagger-android:$dagger_version" + api "com.google.dagger:dagger-android-support:$dagger_version" + + api "com.google.android.gms:play-services-wearable:$play_services_wearable_version" + api "com.google.android.gms:play-services-location:$play_services_location_version" + + api 'com.google.guava:guava:31.1-jre' + + api "androidx.work:work-rxjava3:$work_version" + + + //Firebase + api platform('com.google.firebase:firebase-bom:30.5.0') + api "com.google.firebase:firebase-analytics-ktx" + api "com.google.firebase:firebase-crashlytics-ktx" + // StatsActivity not in use now + // api "com.google.firebase:firebase-messaging-ktx" + // api 'com.google.firebase:firebase-auth-ktx' + // api 'com.google.firebase:firebase-database-ktx' + + + //CryptoUtil + api 'com.madgag.spongycastle:core:1.58.0.0' + api "com.google.crypto.tink:tink-android:$tink_version" + + // pumpCommon + api "com.google.code.gson:gson:$gson_version" + + //WorkManager + api "androidx.work:work-runtime:$work_version" + api "androidx.work:work-runtime-ktx:$work_version" +// api "androidx.work:work-rxjava3:$work_version" + api 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' + + + api "commons-codec:commons-codec:$commonscodec_version" + } android { diff --git a/core/core_dependencies.gradle b/core/core_dependencies.gradle deleted file mode 100644 index 60ef09a37d..0000000000 --- a/core/core_dependencies.gradle +++ /dev/null @@ -1,96 +0,0 @@ -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - - api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutines_version" - api "androidx.core:core-ktx:$core_version" - api 'androidx.legacy:legacy-support-v13:1.0.0' - api 'androidx.legacy:legacy-support-v4:1.0.0' - api "androidx.appcompat:appcompat:$appcompat_version" - api "androidx.preference:preference-ktx:$preferencektx_version" - api 'androidx.biometric:biometric:1.1.0' - api "androidx.browser:browser:1.4.0" - api "androidx.activity:activity-ktx:$activity_version" - api "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" - api "androidx.lifecycle:lifecycle-process:$lifecycle_version" - api 'androidx.cardview:cardview:1.0.0' - api 'androidx.recyclerview:recyclerview:1.2.1' - api 'androidx.gridlayout:gridlayout:1.0.0' - api 'androidx.percentlayout:percentlayout:1.0.0' - api "com.google.android.material:material:$material_version" - - api "com.google.dagger:dagger-android:$dagger_version" - api "com.google.dagger:dagger-android-support:$dagger_version" - - //Firebase - api platform('com.google.firebase:firebase-bom:30.5.0') - api "com.google.firebase:firebase-analytics-ktx" - api "com.google.firebase:firebase-crashlytics-ktx" - api "com.google.firebase:firebase-messaging-ktx" - api 'com.google.firebase:firebase-auth-ktx' - api 'com.google.firebase:firebase-database-ktx' - - //RxBus - api "io.reactivex.rxjava3:rxjava:$rxjava_version" - api "io.reactivex.rxjava3:rxkotlin:$rxkotlin_version" - api "io.reactivex.rxjava3:rxandroid:$rxandroid_version" - api "org.apache.commons:commons-lang3:$commonslang3_version" - api "commons-codec:commons-codec:$commonscodec_version" - api "com.uber.rxdogtag2:rxdogtag:2.0.1" - - //CryptoUtil - api 'com.madgag.spongycastle:core:1.58.0.0' - api "com.google.crypto.tink:tink-android:$tink_version" - - //db - api "com.j256.ormlite:ormlite-core:$ormLite_version" - api "com.j256.ormlite:ormlite-android:$ormLite_version" - - // pumpCommon - api "com.google.code.gson:gson:$gson_version" - - //WorkManager - api "androidx.work:work-runtime:$work_version" - api "androidx.work:work-runtime-ktx:$work_version" - api "androidx.work:work-rxjava3:$work_version" - api 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' - - // new for tidepool - api "com.squareup.okhttp3:okhttp:$okhttp3_version" - api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" - api "com.squareup.retrofit2:retrofit:$retrofit2_version" - api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version" - api "com.squareup.retrofit2:converter-gson:$retrofit2_version" - - api "androidx.fragment:fragment-ktx:$fragmentktx_version" - api "androidx.constraintlayout:constraintlayout:$constraintlayout_version" - api "androidx.navigation:navigation-runtime-ktx:$nav_version" - api "androidx.navigation:navigation-fragment-ktx:$nav_version" - api "androidx.navigation:navigation-ui-ktx:$nav_version" - - api "com.google.android.gms:play-services-wearable:$play_services_wearable_version" - api "com.google.android.gms:play-services-location:$play_services_location_version" - - api 'com.google.android.flexbox:flexbox:3.0.0' - api("io.socket:socket.io-client:1.0.0") { - // excluding org.json which is provided by Android - exclude group: "org.json", module: "json" - } - - api 'com.google.guava:guava:31.1-jre' - - api 'org.mozilla:rhino:1.7.14' - - api 'com.github.kenglxn.QRGen:android:2.6.0' - api 'com.eatthepath:java-otp:0.3.1' - - api "commons-codec:commons-codec:$commonscodec_version" - - // Phone checker - // updating to 0.0.9 prevents AAPS from build - api 'com.scottyab:rootbeer-lib:0.0.8' -} diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt b/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt index 5f846581ae..71f6c92835 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt @@ -23,7 +23,7 @@ fun String.hexStringToByteArray(): ByteArray { val result = ByteArray(length / 2) val lowerCased = this.lowercase(Locale.getDefault()) - for (i in 0 until length step 2) { + for (i in indices step 2) { val firstIndex = HEX_CHARS.indexOf(lowerCased[i]) val secondIndex = HEX_CHARS.indexOf(lowerCased[i + 1]) diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt index fd4ee5aef2..79aabc5acc 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt @@ -4,17 +4,17 @@ import android.content.Context import android.os.Environment import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.core.R -import info.nightscout.interfaces.Config import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils -import info.nightscout.androidaps.plugins.general.maintenance.formats.* -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.storage.Storage +import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat +import info.nightscout.interfaces.Config import info.nightscout.interfaces.data.maintenance.PrefMetadata import info.nightscout.interfaces.data.maintenance.PrefMetadataMap import info.nightscout.interfaces.data.maintenance.PrefsFile import info.nightscout.interfaces.data.maintenance.PrefsImportDir import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey import info.nightscout.interfaces.data.maintenance.PrefsStatus +import info.nightscout.interfaces.storage.Storage +import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.DateTime import org.joda.time.Days import org.joda.time.Hours @@ -94,10 +94,6 @@ class PrefFileListProvider @Inject constructor( return checkMetadata(encryptedPrefsFormat.loadMetadata(contents)) } - @Suppress("unused") fun legacyFile(): File { - return File(path, rh.gs(R.string.app_name) + "Preferences") - } - fun ensureExportDirExists(): File { if (!aapsPath.exists()) { aapsPath.mkdirs() diff --git a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt index 0aac8b3ccc..38d00cf57a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt @@ -13,26 +13,24 @@ import android.os.PowerManager import android.provider.Settings import androidx.core.content.ContextCompat import androidx.fragment.app.FragmentActivity -import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.PluginBase -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import info.nightscout.rx.bus.RxBus +import info.nightscout.interfaces.AndroidPermission +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.SmsCommunicator +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton @Singleton class AndroidPermissionImpl @Inject constructor( - val rh: ResourceHelper, - val rxBus: RxBus, - val injector: HasAndroidInjector, - val activePlugin: ActivePlugin + private val rh: ResourceHelper, + private val activePlugin: ActivePlugin, + private val config: Config ) : AndroidPermission { private var permissionBatteryOptimizationFailed = false @@ -129,7 +127,7 @@ class AndroidPermissionImpl @Inject constructor( if (permissionNotGranted(activity, Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)) activePlugin.activeOverview.addNotification( id = Notification.PERMISSION_BATTERY, - text = rh.gs(R.string.need_whitelisting, rh.gs(R.string.app_name)), + text = rh.gs(R.string.need_whitelisting, rh.gs(config.appName)), level = Notification.URGENT, actionButtonId = R.string.request ) { askForPermission(activity, arrayOf(Manifest.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS)) } diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt b/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt index 100506e39d..c6756137cd 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/QueueThread.kt @@ -40,7 +40,7 @@ class QueueThread internal constructor( private var mWakeLock: PowerManager.WakeLock? = null init { - mWakeLock = (context.getSystemService(Context.POWER_SERVICE) as PowerManager).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, rh.gs(R.string.app_name) + ":QueueThread") + mWakeLock = (context.getSystemService(Context.POWER_SERVICE) as PowerManager).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, rh.gs(config.appName) + ":QueueThread") } override fun run() { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Config.kt b/interfaces/src/main/java/info/nightscout/interfaces/Config.kt index a13b87991b..d21a2b8281 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/Config.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/Config.kt @@ -11,4 +11,5 @@ interface Config { val VERSION_NAME: String val DEBUG: Boolean val currentDeviceModelString : String + val appName: Int } \ No newline at end of file diff --git a/openhumans/build.gradle b/openhumans/build.gradle index 87b80dab73..797ea3d9d3 100644 --- a/openhumans/build.gradle +++ b/openhumans/build.gradle @@ -22,4 +22,7 @@ dependencies { implementation project(':interfaces') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') + + api "com.squareup.okhttp3:okhttp:$okhttp3_version" + api "com.squareup.retrofit2:retrofit:$retrofit2_version" } \ No newline at end of file diff --git a/plugins/build.gradle b/plugins/build.gradle index 7d421bcb4f..b14ffeda51 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -23,4 +23,28 @@ dependencies { implementation project(':core') implementation project(':interfaces') implementation project(':ns-sdk') + + // Actions + api 'androidx.gridlayout:gridlayout:1.0.0' + + // NSClient, Tidepool + api("io.socket:socket.io-client:1.0.0") { + // excluding org.json which is provided by Android + exclude group: "org.json", module: "json" + } + api "com.squareup.okhttp3:okhttp:$okhttp3_version" + api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" +// api "com.squareup.retrofit2:retrofit:$retrofit2_version" + api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version" + api "com.squareup.retrofit2:converter-gson:$retrofit2_version" + + + // Phone checker + // updating to 0.0.9 prevents AAPS from build + api 'com.scottyab:rootbeer-lib:0.0.8' + + //SmsCommunicator + api 'com.eatthepath:java-otp:0.3.1' + api 'com.github.kenglxn.QRGen:android:2.6.0' + } \ No newline at end of file diff --git a/pump/danars/build.gradle b/pump/danars/build.gradle index 746fc08c41..b2150687f9 100644 --- a/pump/danars/build.gradle +++ b/pump/danars/build.gradle @@ -22,6 +22,12 @@ android { moduleName "BleCommandUtil" } } + + sourceSets { + main { + jniLibs.srcDirs = ['src/main/jniLibs'] + } + } } dependencies { diff --git a/pump/diaconn/build.gradle b/pump/diaconn/build.gradle index 4aa1f76d4b..bb1b4ad234 100644 --- a/pump/diaconn/build.gradle +++ b/pump/diaconn/build.gradle @@ -26,14 +26,18 @@ android { } dependencies { - implementation project(':libraries') - implementation project(':core') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') + implementation project(':libraries') implementation project(':interfaces') + implementation project(':core') api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" api "androidx.room:room-rxjava3:$room_version" kapt "androidx.room:room-compiler:$room_version" + + api "com.squareup.okhttp3:okhttp:$okhttp3_version" + api "com.squareup.retrofit2:retrofit:$retrofit2_version" + api "com.squareup.retrofit2:converter-gson:$retrofit2_version" } \ No newline at end of file diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt index 00f3b89b89..4b59a5bc51 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/history/cgms/MedtronicCGMSHistoryDecoder.kt @@ -8,7 +8,6 @@ import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag -import okhttp3.internal.and import org.joda.time.LocalDateTime import java.util.Arrays @@ -190,10 +189,9 @@ class MedtronicCGMSHistoryDecoder constructor( } private fun decodeCalBGForGH(entry: CGMSHistoryEntry) { - val amount: Int = entry.getRawDataByIndex(3) and 32 shl 3 or entry.getRawDataByIndexInt(5) + val amount: Int = entry.getRawDataByIndex(3).toInt() and 32 shl 3 or entry.getRawDataByIndexInt(5) // - val originType: String - originType = when (entry.getRawDataByIndexInt(3) shr 5 and 3) { + val originType: String = when (entry.getRawDataByIndexInt(3) shr 5 and 3) { 0x00 -> "rf" else -> "unknown" } diff --git a/pump/omnipod-common/build.gradle b/pump/omnipod-common/build.gradle index 4c92c7eace..eb2d92e808 100644 --- a/pump/omnipod-common/build.gradle +++ b/pump/omnipod-common/build.gradle @@ -11,6 +11,7 @@ apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/allopen_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle" + android { namespace 'info.nightscout.androidaps.plugins.pump.omnipod.common' } @@ -21,4 +22,6 @@ dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') + + api "androidx.constraintlayout:constraintlayout:$constraintlayout_version" } \ No newline at end of file diff --git a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt index 93eb2f35cb..a2ba838417 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt @@ -2,19 +2,15 @@ package info.nightscout.ui.activities import android.os.Bundle import android.widget.ArrayAdapter -import com.google.firebase.auth.FirebaseAuth -import com.google.firebase.database.FirebaseDatabase import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.stats.TddCalculator -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.InstanceId import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.SafeParse -import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.utils.DateUtil import info.nightscout.ui.R import info.nightscout.ui.databinding.ActivitySurveyBinding import info.nightscout.ui.defaultProfile.DefaultProfile @@ -92,7 +88,7 @@ class SurveyActivity : NoSplashAppCompatActivity() { val specificProfile = profileStore.getSpecificProfile(profileName) r.profileJson = specificProfile.toString() - +/* val auth = FirebaseAuth.getInstance() auth.signInAnonymously() .addOnCompleteListener(this) { task -> @@ -110,6 +106,7 @@ class SurveyActivity : NoSplashAppCompatActivity() { // ... } + */ finish() } } diff --git a/wear/build.gradle b/wear/build.gradle index 4a0f6de6fa..f6545564b1 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -127,8 +127,6 @@ dependencies { implementation "com.google.dagger:dagger-android:$dagger_version" implementation "com.google.dagger:dagger-android-support:$dagger_version" - annotationProcessor "com.google.dagger:dagger-compiler:$dagger_version" - annotationProcessor "com.google.dagger:dagger-android-processor:$dagger_version" kapt "com.google.dagger:dagger-android-processor:$dagger_version" kapt "com.google.dagger:dagger-compiler:$dagger_version" } From 6cc67e52a45d9dbed77f2e21ebd504ef3b7b1fc4 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 9 Nov 2022 13:30:48 +0100 Subject: [PATCH 18/42] core -> core-main --- app-wear-shared/rx/build.gradle | 6 +- app-wear-shared/shared-impl/build.gradle | 4 +- app-wear-shared/shared/build.gradle | 10 +- app/build.gradle | 8 +- .../info/nightscout/androidaps/MainApp.kt | 2 +- .../androidaps/dialogs/NtpProgressDialog.kt | 4 +- .../configBuilder/ProfileFunctionImpl.kt | 2 +- .../NotificationHolderImpl.kt | 2 +- automation/build.gradle | 12 +- .../automation/actions/ActionAlarmTest.kt | 8 +- .../actions/ActionCarePortalEventTest.kt | 6 +- .../actions/ActionLoopDisableTest.kt | 4 +- .../actions/ActionLoopEnableTest.kt | 4 +- .../actions/ActionLoopResumeTest.kt | 4 +- .../actions/ActionLoopSuspendTest.kt | 4 +- .../actions/ActionNotificationTest.kt | 6 +- .../actions/ActionProfileSwitchPercentTest.kt | 4 +- .../actions/ActionProfileSwitchTest.kt | 8 +- .../actions/ActionStartTempTargetTest.kt | 2 +- .../automation/actions/ActionsTestBase.kt | 4 +- .../automation/elements/StaticLabelTest.kt | 4 +- .../triggers/TriggerAutosensValueTest.kt | 4 +- .../triggers/TriggerBTDeviceTest.kt | 2 +- .../automation/triggers/TriggerBgTest.kt | 2 +- .../triggers/TriggerBolusAgoTest.kt | 2 +- .../automation/triggers/TriggerCOBTest.kt | 2 +- .../triggers/TriggerProfilePercentTest.kt | 2 +- .../triggers/TriggerPumpLastConnectionTest.kt | 2 +- .../triggers/TriggerTimeRangeTest.kt | 2 +- .../automation/triggers/TriggerTimeTest.kt | 4 +- .../triggers/TriggerWifiSsidTest.kt | 2 +- core/{ => core-main}/.gitignore | 0 .../allopen_dependencies.gradle | 0 .../android_dependencies.gradle | 0 .../android_module_dependencies.gradle | 0 core/{ => core-main}/build.gradle | 12 +- core/{ => core-main}/consumer-rules.pro | 0 core/{ => core-main}/jacoco_global.gradle | 0 core/{ => core-main}/proguard-rules.pro | 0 .../src/main/AndroidManifest.xml | 0 .../DaggerAppCompatActivityWithResult.kt | 2 +- .../activities/DialogAppCompatActivity.kt | 0 .../activities/NoSplashAppCompatActivity.kt | 2 +- .../androidaps/data/DetailedBolusInfo.kt | 0 .../androidaps/data/InMemoryGlucoseValue.kt | 0 .../nightscout/androidaps/data/IobTotal.kt | 0 .../androidaps/data/LocalInsulin.kt | 0 .../androidaps/data/ProfileSealed.kt | 2 +- .../androidaps/data/PumpEnactResultImpl.kt | 2 +- .../nightscout/androidaps/data/PureProfile.kt | 0 .../info/nightscout/androidaps/data/Sms.kt | 0 .../androidaps/di/CoreDataClassesModule.kt | 0 .../androidaps/di/CoreFragmentsModule.kt | 0 .../nightscout/androidaps/di/CoreModule.kt | 0 .../androidaps/di/CoreReceiversModule.kt | 0 .../androidaps/di/StaticInjector.kt | 0 .../androidaps/di/ValidatorsModule.kt | 0 .../androidaps/dialogs/BolusProgressDialog.kt | 4 +- .../dialogs/DialogFragmentWithDate.kt | 2 +- .../androidaps/dialogs/ErrorDialog.kt | 4 +- .../androidaps/dialogs/ProfileViewerDialog.kt | 4 +- .../EventEffectiveProfileSwitchChanged.kt | 0 .../androidaps/events/EventNewBG.kt | 0 .../androidaps/events/EventNewHistoryData.kt | 0 .../events/EventPreferenceChange.kt | 0 .../events/EventPumpStatusChanged.kt | 2 +- .../androidaps/events/EventStatus.kt | 0 .../androidaps/extensions/BlockExtension.kt | 0 .../extensions/BluetoothAdapterExtension.kt | 0 .../BolusCalculatorResultExtension.kt | 0 .../androidaps/extensions/BolusExtension.kt | 0 .../androidaps/extensions/Concurrency.kt | 0 .../extensions/EmptyRecyclerView.kt | 182 ++--- .../extensions/ExtendedBolusExtension.kt | 0 .../androidaps/extensions/FoodExtension.kt | 0 .../extensions/GlucoseValueExtension.kt | 0 .../extensions/HexByteArrayConversion.kt | 0 .../androidaps/extensions/HtmlString.kt | 0 .../androidaps/extensions/IntentExtension.kt | 0 .../androidaps/extensions/JSONObjectExt.kt | 0 .../extensions/ProfileSwitchExtension.kt | 0 .../extensions/PumpStateExtension.kt | 0 .../extensions/PumpTypeExtension.kt | 0 .../extensions/TemporaryBasalExtension.kt | 0 .../extensions/TemporaryTargetExtension.kt | 2 +- .../extensions/TherapyEventExtension.kt | 0 .../extensions/TotalDailyDoseExtension.kt | 2 +- .../androidaps/extensions/TrendArrowIcon.kt | 2 +- .../androidaps/extensions/UserEntryExt.kt | 2 +- .../nightscout/androidaps/interfaces/APS.kt | 0 .../androidaps/interfaces/ActivePlugin.kt | 0 .../androidaps/interfaces/BgSource.kt | 0 .../androidaps/interfaces/CommandQueue.kt | 0 .../androidaps/interfaces/Constraints.kt | 0 .../androidaps/interfaces/DataSyncSelector.kt | 0 .../DetermineBasalAdapterInterface.kt | 0 .../androidaps/interfaces/Insulin.kt | 0 .../androidaps/interfaces/IobCobCalculator.kt | 0 .../nightscout/androidaps/interfaces/Loop.kt | 0 .../androidaps/interfaces/Profile.kt | 0 .../androidaps/interfaces/ProfileFunction.kt | 0 .../androidaps/interfaces/ProfileSource.kt | 0 .../androidaps/interfaces/ProfileStore.kt | 0 .../nightscout/androidaps/interfaces/Pump.kt | 0 .../androidaps/interfaces/PumpPluginBase.kt | 2 +- .../androidaps/interfaces/PumpSync.kt | 0 .../androidaps/interfaces/Sensitivity.kt | 0 .../androidaps/interfaces/TrendCalculator.kt | 0 .../androidaps/interfaces/XDripBroadcast.kt | 0 .../androidaps/interfaces/stats/DexcomTIR.kt | 0 .../interfaces/stats/DexcomTirCalculator.kt | 0 .../androidaps/interfaces/stats/TIR.kt | 0 .../interfaces/stats/TddCalculator.kt | 0 .../interfaces/stats/TirCalculator.kt | 0 .../androidaps/logging/UserEntryLogger.kt | 0 .../androidaps/plugins/aps/loop/APSResult.kt | 2 +- .../versionChecker/VersionCheckerUtils.kt | 2 +- .../maintenance/PrefFileListProvider.kt | 2 +- .../general/maintenance/PrefsFileContract.kt | 0 .../activities/PrefImportListActivity.kt | 6 +- .../formats/EncryptedPrefsFormat.kt | 2 +- .../plugins/general/overview/OverviewData.kt | 2 +- .../EventDismissBolusProgressIfRunning.kt | 0 .../events/EventDismissNotification.kt | 0 .../overview/events/EventNewNotification.kt | 0 .../graphExtensions/AreaGraphSeries.java | 0 .../graphExtensions/BolusDataPoint.kt | 2 +- .../graphExtensions/CarbsDataPoint.kt | 2 +- .../DataPointWithLabelInterface.kt | 0 .../graphExtensions/DeviationDataPoint.kt | 0 .../graphExtensions/DoubleDataPoint.kt | 0 .../EffectiveProfileSwitchDataPoint.kt | 2 +- .../graphExtensions/ExtendedBolusDataPoint.kt | 2 +- .../graphExtensions/FixedLineGraphSeries.java | 0 .../graphExtensions/GlucoseValueDataPoint.kt | 2 +- .../InMemoryGlucoseValueDataPoint.kt | 2 +- .../PointsWithLabelGraphSeries.java | 2 +- .../general/overview/graphExtensions/Scale.kt | 0 .../graphExtensions/ScaledDataPoint.kt | 0 .../graphExtensions/TherapyEventDataPoint.kt | 2 +- .../TimeAsXAxisLabelFormatter.java | 0 .../iob/iobCobCalculator/AutosensDataStore.kt | 0 .../iob/iobCobCalculator/AutosensResult.kt | 0 .../plugins/iob/iobCobCalculator/BasalData.kt | 0 .../plugins/iob/iobCobCalculator/CobInfo.kt | 2 +- .../iob/iobCobCalculator/GlucoseStatus.kt | 0 .../iobCobCalculator/GlucoseStatusProvider.kt | 0 .../iob/iobCobCalculator/data/AutosensData.kt | 2 +- .../events/EventBucketedDataCreated.kt | 0 .../plugins/pump/common/ble/BlePreCheck.kt | 2 +- .../bolusInfo/DetailedBolusInfoStorage.kt | 0 .../common/bolusInfo/TemporaryBasalStorage.kt | 0 .../pump/common/utils/DateTimeUtil.java | 0 .../androidaps/queue/commands/Command.kt | 2 +- .../androidaps/receivers/DataWorkerStorage.kt | 0 .../androidaps/receivers/Intents.kt | 0 .../receivers/NetworkChangeReceiver.kt | 0 .../receivers/ReceiverStatusStore.kt | 0 .../androidaps/services/AlarmSoundService.kt | 2 +- .../services/AlarmSoundServiceHelper.kt | 0 .../androidaps/utils/ActionModeHelper.kt | 370 +++++----- .../nightscout/androidaps/utils/CryptoUtil.kt | 252 +++---- .../androidaps/utils/DecimalFormatter.kt | 2 +- .../androidaps/utils/DefaultValueHelper.kt | 2 +- .../androidaps/utils/FabricPrivacy.kt | 2 +- .../nightscout/androidaps/utils/HardLimits.kt | 2 +- .../nightscout/androidaps/utils/InstanceId.kt | 0 .../nightscout/androidaps/utils/ToastUtils.kt | 2 +- .../nightscout/androidaps/utils/Translator.kt | 2 +- .../nightscout/androidaps/utils/WarnColors.kt | 2 +- .../utils/alertDialogs/AlertDialogHelper.kt | 2 +- .../androidaps/utils/alertDialogs/OKDialog.kt | 2 +- .../utils/alertDialogs/WarningDialog.kt | 2 +- .../utils/protection/BiometricCheck.kt | 2 +- .../utils/protection/PasswordCheck.kt | 2 +- .../utils/protection/ProtectionCheck.kt | 2 +- .../resources/ResourceHelperExtensions.kt | 0 .../resources/ResourceHelperImplementation.kt | 2 +- .../utils/serialisation/SealedClassHelper.kt | 0 .../serialisation/ValueWithUnitSerialiser.kt | 0 .../textValidator/DefaultEditTextValidator.kt | 2 +- .../utils/textValidator/EditTextValidator.kt | 0 .../ValidatingEditTextPreference.kt | 2 +- .../validators/AlphaNumericValidator.kt | 0 .../validators/AlphaValidator.kt | 0 .../textValidator/validators/AndValidator.kt | 0 .../validators/BgRangeValidator.kt | 0 .../validators/CreditCardValidator.kt | 0 .../textValidator/validators/DateValidator.kt | 0 .../validators/DigitLengthRangeValidator.kt | 0 .../validators/DomainValidator.kt | 0 .../validators/DummyValidator.kt | 0 .../validators/EmailValidator.kt | 0 .../validators/EmptyValidator.kt | 0 .../validators/FloatNumericRangeValidator.kt | 0 .../validators/HttpsUrlValidator.kt | 0 .../validators/IpAddressValidator.kt | 0 .../validators/MinDigitLengthValidator.kt | 0 .../validators/MultiPhoneValidator.kt | 0 .../validators/MultiValidator.kt | 0 .../textValidator/validators/NotValidator.kt | 0 .../validators/NumericRangeValidator.kt | 0 .../validators/NumericValidator.kt | 0 .../textValidator/validators/OrValidator.kt | 0 .../validators/PatternValidator.kt | 0 .../validators/PersonFullNameValidator.kt | 0 .../validators/PersonNameValidator.kt | 0 .../validators/PhoneValidator.kt | 0 .../validators/PinStrengthValidator.kt | 0 .../validators/RegexpValidator.kt | 0 .../validators/SameValueValidator.kt | 0 .../textValidator/validators/Validator.kt | 0 .../validators/WebUrlValidator.kt | 0 .../androidaps/utils/ui/BasalProfileGraph.kt | 2 +- .../utils/ui/BluetoothDevicePreference.kt | 2 +- .../utils/ui/DigitsKeyListenerWithComma.java | 0 .../androidaps/utils/ui/IcProfileGraph.kt | 2 +- .../androidaps/utils/ui/IsfProfileGraph.kt | 2 +- .../utils/ui/MinutesNumberPicker.kt | 2 +- .../androidaps/utils/ui/NumberPicker.kt | 4 +- .../utils/ui/NumberPickerVertical.kt | 2 +- .../utils/ui/NumberPickerViewAdapter.kt | 72 +- .../androidaps/utils/ui/SingleClickButton.kt | 2 +- .../utils/ui/TargetBgProfileGraph.kt | 2 +- .../androidaps/utils/ui/UIRunnable.kt | 0 .../androidaps/utils/ui/VerticalTextView.kt | 0 .../utils/userEntry/UserEntryMapper.kt | 0 .../userEntry/UserEntryPresentationHelper.kt | 2 +- .../utils/userEntry/ValueWithUnitMapper.kt | 0 .../res/color/day_selection_background.xml | 0 .../color/mtrl_btn_bg_color_selector_grey.xml | 0 .../drawable-hdpi/background_input_border.xml | 0 .../src/main/res/drawable-hdpi/dialog.xml | 0 .../main/res/drawable-hdpi/dialog_header.xml | 0 .../res/drawable-hdpi/toast_border_ok.xml | 0 .../main/res/drawable/alert_border_error.xml | 0 .../res/drawable/alert_border_warning.xml | 0 .../src/main/res/drawable/anim_carbs.xml | 0 .../src/main/res/drawable/ic_aaps.xml | 0 .../res/drawable/ic_access_alarm_24dp.xml | 0 .../src/main/res/drawable/ic_action.xml | 0 .../main/res/drawable/ic_actions_refill.xml | 0 .../ic_actions_start_extended_bolus.xml | 0 .../drawable/ic_actions_starttempbasal.xml | 0 .../src/main/res/drawable/ic_add.xml | 0 .../src/main/res/drawable/ic_automation.xml | 0 .../src/main/res/drawable/ic_autotune.xml | 0 .../src/main/res/drawable/ic_blooddrop_48.xml | 0 .../res/drawable/ic_bluetooth_white_48dp.xml | 0 .../src/main/res/drawable/ic_bolus.xml | 0 .../src/main/res/drawable/ic_calculator.xml | 0 .../src/main/res/drawable/ic_calibration.xml | 0 .../main/res/drawable/ic_check_while_48dp.xml | 0 .../src/main/res/drawable/ic_clone.xml | 0 .../src/main/res/drawable/ic_close.xml | 0 .../src/main/res/drawable/ic_cogs.xml | 0 .../src/main/res/drawable/ic_combo_128.xml | 0 .../main/res/drawable/ic_compare_profiles.xml | 0 .../main/res/drawable/ic_cp_announcement.xml | 0 .../main/res/drawable/ic_cp_basal_no_tbr.xml | 0 .../res/drawable/ic_cp_basal_tbr_high.xml | 0 .../main/res/drawable/ic_cp_basal_tbr_low.xml | 0 .../src/main/res/drawable/ic_cp_bgcheck.xml | 0 .../main/res/drawable/ic_cp_bolus_carbs.xml | 0 .../res/drawable/ic_cp_bolus_carbs_red.xml | 0 .../main/res/drawable/ic_cp_cgm_insert.xml | 0 .../src/main/res/drawable/ic_cp_exercise.xml | 0 .../src/main/res/drawable/ic_cp_note.xml | 0 .../main/res/drawable/ic_cp_pump_battery.xml | 0 .../main/res/drawable/ic_cp_pump_canula.xml | 0 .../src/main/res/drawable/ic_cp_question.xml | 0 .../src/main/res/drawable/ic_cp_stats.xml | 0 .../src/main/res/drawable/ic_danai_128.xml | 0 .../main/res/drawable/ic_danar_useropt.xml | 0 .../src/main/res/drawable/ic_danarprofile.xml | 0 .../src/main/res/drawable/ic_danars_128.xml | 0 .../src/main/res/drawable/ic_danarstats.xml | 0 .../src/main/res/drawable/ic_dexcom_g6.xml | 0 .../src/main/res/drawable/ic_diaconn_g8.xml | 0 .../src/main/res/drawable/ic_doubledown.xml | 0 .../src/main/res/drawable/ic_doubleup.xml | 0 .../src/main/res/drawable/ic_eopatch2_128.xml | 0 .../main/res/drawable/ic_error_red_48dp.xml | 0 .../src/main/res/drawable/ic_eversense.xml | 0 .../src/main/res/drawable/ic_flat.xml | 0 .../src/main/res/drawable/ic_food.xml | 0 .../main/res/drawable/ic_fortyfivedown.xml | 0 .../src/main/res/drawable/ic_fortyfiveup.xml | 0 .../src/main/res/drawable/ic_generic_cgm.xml | 0 .../src/main/res/drawable/ic_generic_icon.xml | 0 .../src/main/res/drawable/ic_glimp.xml | 0 .../src/main/res/drawable/ic_glunovo.xml | 0 .../src/main/res/drawable/ic_graduation.xml | 0 .../src/main/res/drawable/ic_header_key.xml | 0 .../main/res/drawable/ic_header_warning.xml | 0 .../src/main/res/drawable/ic_home.xml | 0 .../src/main/res/drawable/ic_home_profile.xml | 0 .../src/main/res/drawable/ic_ict.xml | 0 .../src/main/res/drawable/ic_insight_128.xml | 0 .../src/main/res/drawable/ic_insulin.xml | 0 .../src/main/res/drawable/ic_intelligo.xml | 0 .../src/main/res/drawable/ic_invalid.xml | 0 .../main/res/drawable/ic_local_profile.xml | 0 .../src/main/res/drawable/ic_local_save.xml | 0 .../src/main/res/drawable/ic_loop_closed.xml | 0 .../main/res/drawable/ic_loop_closed_off.xml | 0 .../res/drawable/ic_loop_closed_white.xml | 0 .../src/main/res/drawable/ic_maintenance.xml | 0 .../src/main/res/drawable/ic_minus.xml | 0 .../res/drawable/ic_nightscout_profile.xml | 0 .../main/res/drawable/ic_nightscout_syncs.xml | 0 .../src/main/res/drawable/ic_notif_aaps.xml | 0 .../src/main/res/drawable/ic_nsclient_bg.xml | 0 .../res/drawable/ic_patch_pump_outline.xml | 0 .../src/main/res/drawable/ic_plus.xml | 0 .../src/main/res/drawable/ic_poctech.xml | 0 .../src/main/res/drawable/ic_pod_128.xml | 0 .../src/main/res/drawable/ic_pump_history.xml | 0 .../src/main/res/drawable/ic_quick_wizard.xml | 0 .../src/main/res/drawable/ic_refresh.xml | 0 .../src/main/res/drawable/ic_remove.xml | 0 .../main/res/drawable/ic_ribbon_profile.xml | 0 .../src/main/res/drawable/ic_sensor.xml | 0 .../src/main/res/drawable/ic_singledown.xml | 0 .../src/main/res/drawable/ic_singleup.xml | 0 .../src/main/res/drawable/ic_smartphone.xml | 0 .../src/main/res/drawable/ic_sms.xml | 0 .../src/main/res/drawable/ic_sort.xml | 0 .../ic_swap_vert_black_48dp_green.xml | 0 .../main/res/drawable/ic_temptarget_high.xml | 0 .../src/main/res/drawable/ic_toast_check.xml | 0 .../res/drawable/ic_toast_delete_confirm.xml | 0 .../src/main/res/drawable/ic_toast_error.xml | 0 .../src/main/res/drawable/ic_toast_info.xml | 0 .../src/main/res/drawable/ic_toast_warn.xml | 0 .../src/main/res/drawable/ic_trash.xml | 0 .../main/res/drawable/ic_trash_outline.xml | 0 .../src/main/res/drawable/ic_treatments.xml | 0 .../drawable/ic_trending_flat_white_48dp.xml | 0 .../src/main/res/drawable/ic_veo.xml | 0 .../src/main/res/drawable/ic_veo_128.xml | 0 .../src/main/res/drawable/ic_virtual_pump.xml | 0 .../src/main/res/drawable/ic_watch.xml | 0 .../src/main/res/drawable/ic_x_swap_vert.xml | 0 .../main/res/drawable/icon_insulin_carbs.xml | 0 .../src/main/res/drawable/launch_screen.xml | 0 .../drawable/material_button_background.xml | 0 .../res/drawable/material_button_selected.xml | 0 .../src/main/res/drawable/pillborder.xml | 0 .../src/main/res/drawable/splash_icon.png | Bin .../src/main/res/layout/close.xml | 0 .../src/main/res/layout/datetime.xml | 0 .../res/layout/dialog_alert_custom_title.xml | 0 .../main/res/layout/dialog_bolusprogress.xml | 0 .../src/main/res/layout/dialog_error.xml | 0 .../main/res/layout/dialog_profileviewer.xml | 0 .../maintenance_import_list_activity.xml | 0 .../layout/maintenance_import_list_item.xml | 0 .../src/main/res/layout/notes.xml | 0 .../main/res/layout/number_picker_layout.xml | 0 .../layout/number_picker_layout_vertical.xml | 0 .../src/main/res/layout/okcancel.xml | 0 .../src/main/res/layout/passwordprompt.xml | 0 .../src/main/res/layout/spinner_centered.xml | 0 .../src/main/res/layout/toast.xml | 0 .../src/main/res/menu/menu_actions.xml | 38 +- .../main/res/menu/menu_delete_selection.xml | 0 .../src/main/res/raw/alarm.mp3 | Bin .../src/main/res/raw/boluserror.mp3 | Bin .../src/main/res/raw/error.mp3 | Bin .../src/main/res/values-af-rZA/protection.xml | 0 .../src/main/res/values-af-rZA/strings.xml | 0 .../src/main/res/values-af-rZA/validator.xml | 0 .../src/main/res/values-ar-rSA/protection.xml | 0 .../src/main/res/values-ar-rSA/strings.xml | 0 .../src/main/res/values-bg-rBG/protection.xml | 0 .../src/main/res/values-bg-rBG/strings.xml | 0 .../src/main/res/values-bg-rBG/validator.xml | 0 .../src/main/res/values-ca-rES/strings.xml | 0 .../src/main/res/values-ca-rES/validator.xml | 0 .../src/main/res/values-cs-rCZ/protection.xml | 0 .../src/main/res/values-cs-rCZ/strings.xml | 0 .../src/main/res/values-cs-rCZ/validator.xml | 0 .../src/main/res/values-cy-rGB/protection.xml | 0 .../src/main/res/values-cy-rGB/strings.xml | 0 .../src/main/res/values-da-rDK/strings.xml | 0 .../src/main/res/values-da-rDK/validator.xml | 0 .../src/main/res/values-de-rDE/protection.xml | 0 .../src/main/res/values-de-rDE/strings.xml | 0 .../src/main/res/values-de-rDE/validator.xml | 0 .../src/main/res/values-el-rGR/protection.xml | 0 .../src/main/res/values-el-rGR/strings.xml | 0 .../src/main/res/values-el-rGR/validator.xml | 0 .../src/main/res/values-es-rES/protection.xml | 0 .../src/main/res/values-es-rES/strings.xml | 0 .../src/main/res/values-es-rES/validator.xml | 0 .../src/main/res/values-fi-rFI/protection.xml | 0 .../src/main/res/values-fi-rFI/strings.xml | 0 .../src/main/res/values-fr-rFR/protection.xml | 0 .../src/main/res/values-fr-rFR/strings.xml | 0 .../src/main/res/values-fr-rFR/validator.xml | 0 .../src/main/res/values-ga-rIE/protection.xml | 0 .../src/main/res/values-ga-rIE/strings.xml | 0 .../src/main/res/values-ga-rIE/validator.xml | 0 .../src/main/res/values-hr-rHR/protection.xml | 0 .../src/main/res/values-hr-rHR/strings.xml | 0 .../src/main/res/values-hr-rHR/validator.xml | 0 .../src/main/res/values-hu-rHU/strings.xml | 0 .../src/main/res/values-hu-rHU/validator.xml | 0 .../src/main/res/values-it-rIT/protection.xml | 0 .../src/main/res/values-it-rIT/strings.xml | 0 .../src/main/res/values-it-rIT/validator.xml | 0 .../src/main/res/values-iw-rIL/protection.xml | 0 .../src/main/res/values-iw-rIL/strings.xml | 0 .../src/main/res/values-iw-rIL/validator.xml | 0 .../src/main/res/values-ja-rJP/protection.xml | 0 .../src/main/res/values-ja-rJP/strings.xml | 0 .../src/main/res/values-ko-rKR/protection.xml | 0 .../src/main/res/values-ko-rKR/strings.xml | 0 .../src/main/res/values-ko-rKR/validator.xml | 0 .../src/main/res/values-lt-rLT/protection.xml | 0 .../src/main/res/values-lt-rLT/strings.xml | 0 .../src/main/res/values-lt-rLT/validator.xml | 0 .../src/main/res/values-night/colors.xml | 0 .../src/main/res/values-night/styles.xml | 0 .../src/main/res/values-nl-rNL/protection.xml | 0 .../src/main/res/values-nl-rNL/strings.xml | 0 .../src/main/res/values-nl-rNL/validator.xml | 0 .../src/main/res/values-no-rNO/strings.xml | 0 .../src/main/res/values-no-rNO/validator.xml | 0 .../src/main/res/values-pl-rPL/protection.xml | 0 .../src/main/res/values-pl-rPL/strings.xml | 0 .../src/main/res/values-pl-rPL/validator.xml | 0 .../src/main/res/values-pt-rBR/protection.xml | 0 .../src/main/res/values-pt-rBR/strings.xml | 0 .../src/main/res/values-pt-rBR/validator.xml | 0 .../src/main/res/values-pt-rPT/protection.xml | 0 .../src/main/res/values-pt-rPT/strings.xml | 0 .../src/main/res/values-pt-rPT/validator.xml | 0 .../src/main/res/values-ro-rRO/protection.xml | 0 .../src/main/res/values-ro-rRO/strings.xml | 0 .../src/main/res/values-ro-rRO/validator.xml | 0 .../src/main/res/values-ru-rRU/protection.xml | 0 .../src/main/res/values-ru-rRU/strings.xml | 0 .../src/main/res/values-ru-rRU/validator.xml | 0 .../src/main/res/values-sk-rSK/protection.xml | 0 .../src/main/res/values-sk-rSK/strings.xml | 0 .../src/main/res/values-sk-rSK/validator.xml | 0 .../src/main/res/values-sl-rSI/protection.xml | 0 .../src/main/res/values-sl-rSI/strings.xml | 0 .../src/main/res/values-sl-rSI/validator.xml | 0 .../src/main/res/values-sr-rCS/strings.xml | 0 .../src/main/res/values-sr-rCS/validator.xml | 0 .../src/main/res/values-sv-rSE/protection.xml | 0 .../src/main/res/values-sv-rSE/strings.xml | 0 .../src/main/res/values-sv-rSE/validator.xml | 0 .../src/main/res/values-ta-rIN/strings.xml | 0 .../src/main/res/values-ta-rIN/validator.xml | 0 .../src/main/res/values-tr-rTR/protection.xml | 0 .../src/main/res/values-tr-rTR/strings.xml | 0 .../src/main/res/values-tr-rTR/validator.xml | 0 .../src/main/res/values-zh-rCN/protection.xml | 0 .../src/main/res/values-zh-rCN/strings.xml | 0 .../src/main/res/values-zh-rCN/validator.xml | 0 .../src/main/res/values/attrs.xml | 0 .../src/main/res/values/colors.xml | 0 .../src/main/res/values/dimens.xml | 0 .../src/main/res/values/fet_attrs.xml | 0 .../src/main/res/values/protection.xml | 49 ++ .../core-main/src/main/res/values/strings.xml | 673 ++++++++++++++++++ .../src/main/res/values/styles.xml | 0 .../src/main/res/values/validator.xml | 30 + .../info/nightscout/androidaps/TestBase.kt | 0 .../androidaps/TestBaseWithProfile.kt | 0 .../nightscout/androidaps/TestPumpPlugin.kt | 0 .../androidaps/data/ConstraintTest.kt | 0 .../androidaps/data/DetailedBolusInfoTest.kt | 0 .../nightscout/androidaps/data/IobTest.kt | 0 .../androidaps/data/IobTotalTest.kt | 0 .../androidaps/data/MealDataTest.kt | 0 .../nightscout/androidaps/data/ProfileTest.kt | 2 +- .../androidaps/data/PumpEnactResultTest.kt | 2 +- .../extensions/BlockExtensionKtTest.kt | 0 .../interfaces/PluginDescriptionTest.kt | 0 .../androidaps/interfaces/ProfileStoreTest.kt | 0 .../interfaces/PumpDescriptionTest.kt | 0 .../plugins/aps/loop/APSResultTest.kt | 0 .../VersionCheckerUtilsKtTest.kt | 0 .../formats/EncryptedPrefsFormatTest.kt | 0 .../formats/SingleStringStorage.kt | 0 .../iob/iobCalculator/GlucoseStatusTest.kt | 0 .../iobCobCalculator/AutosensDataStoreTest.kt | 0 .../bolusInfo/DetailedBolusInfoStorageTest.kt | 0 .../bolusInfo/TemporaryBasalStorageTest.kt | 0 .../pump/common/utils/DateTimeUtilUTest.java | 0 .../androidaps/utils/CryptoUtilTest.kt | 0 .../androidaps/utils/DateUtilTest.kt | 2 +- .../androidaps/utils/DecimalFormatterTest.kt | 0 .../androidaps/utils/JsonHelperTest.kt | 0 .../androidaps/utils/MidnightTimeTest.kt | 0 .../nightscout/androidaps/utils/RoundTest.kt | 0 .../androidaps/utils/StringUtilsTest.kt | 0 .../info/nightscout/androidaps/utils/TTest.kt | 0 .../ValueWithUnitSerialiserTest.kt | 0 core/{ => core-main}/test_dependencies.gradle | 0 core/src/main/res/values/protection.xml | 46 -- core/src/main/res/values/strings.xml | 670 ----------------- core/src/main/res/values/validator.xml | 27 - database/build.gradle | 4 +- graphview/build.gradle | 2 +- implementation/build.gradle | 12 +- .../implementation/TrendCalculatorImpl.kt | 2 +- .../pump/PumpSyncImplementation.kt | 2 +- insight/build.gradle | 12 +- interfaces/build.gradle | 4 +- ns-sdk/build.gradle | 6 +- openhumans/build.gradle | 12 +- plugins/build.gradle | 12 +- .../configBuilder/RunningConfiguration.kt | 2 +- .../general/autotune/data/ATProfile.kt | 2 +- .../extensions/TherapyEventExtension.kt | 2 +- pump/combo/build.gradle | 12 +- pump/dana/build.gradle | 12 +- pump/danar/build.gradle | 12 +- pump/danars/build.gradle | 12 +- .../danars/activities/BLEScanActivity.kt | 8 +- .../androidaps/danars/services/BLEComm.kt | 2 +- pump/diaconn/build.gradle | 12 +- .../activities/DiaconnG8BLEScanActivity.kt | 4 +- .../diaconn/service/BLECommonService.kt | 2 +- pump/eopatch/build.gradle | 10 +- .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 8 +- .../pump/eopatch/ui/AlarmHelperActivity.kt | 2 +- .../pump/eopatch/ui/DialogHelperActivity.kt | 2 +- .../plugins/pump/eopatch/ui/EoBaseActivity.kt | 2 +- .../pump/eopatch/ui/dialogs/AlarmDialog.kt | 2 +- pump/medtronic/build.gradle | 12 +- pump/omnipod-common/build.gradle | 12 +- pump/omnipod-dash/build.gradle | 12 +- pump/omnipod-eros/build.gradle | 12 +- pump/pump-common/build.gradle | 12 +- pump/pump-core/build.gradle | 10 +- pump/rileylink/build.gradle | 12 +- settings.gradle | 2 +- ui/build.gradle | 10 +- .../ui/activities/ErrorHelperActivity.kt | 2 +- .../ui/activities/TDDStatsActivity.kt | 2 +- wear/build.gradle | 6 +- 548 files changed, 1489 insertions(+), 1480 deletions(-) rename core/{ => core-main}/.gitignore (100%) rename core/{ => core-main}/allopen_dependencies.gradle (100%) rename core/{ => core-main}/android_dependencies.gradle (100%) rename core/{ => core-main}/android_module_dependencies.gradle (100%) rename core/{ => core-main}/build.gradle (89%) rename core/{ => core-main}/consumer-rules.pro (100%) rename core/{ => core-main}/jacoco_global.gradle (100%) rename core/{ => core-main}/proguard-rules.pro (100%) rename core/{ => core-main}/src/main/AndroidManifest.xml (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/activities/NoSplashAppCompatActivity.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/data/IobTotal.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/data/PureProfile.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/data/Sms.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/di/CoreModule.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/di/CoreReceiversModule.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/di/StaticInjector.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/di/ValidatorsModule.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/events/EventStatus.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/BluetoothAdapterExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/Concurrency.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/IntentExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt (95%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt (94%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/APS.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt (95%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTirCalculator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/interfaces/stats/TirCalculator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissNotification.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventNewNotification.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/AreaGraphSeries.java (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt (95%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DataPointWithLabelInterface.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DeviationDataPoint.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DoubleDataPoint.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt (95%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/FixedLineGraphSeries.java (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/Scale.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ScaledDataPoint.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TimeAsXAxisLabelFormatter.java (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensResult.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/BasalData.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/events/EventBucketedDataCreated.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/receivers/Intents.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/services/AlarmSoundServiceHelper.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/CryptoUtil.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/InstanceId.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/Translator.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/alertDialogs/AlertDialogHelper.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperExtensions.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/serialisation/SealedClassHelper.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiser.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt (97%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/DigitsKeyListenerWithComma.java (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt (98%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/MinutesNumberPicker.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerVertical.kt (85%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerViewAdapter.kt (88%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt (96%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/ui/VerticalTextView.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt (100%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt (99%) rename core/{ => core-main}/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt (100%) rename core/{ => core-main}/src/main/res/color/day_selection_background.xml (100%) rename core/{ => core-main}/src/main/res/color/mtrl_btn_bg_color_selector_grey.xml (100%) rename core/{ => core-main}/src/main/res/drawable-hdpi/background_input_border.xml (100%) rename core/{ => core-main}/src/main/res/drawable-hdpi/dialog.xml (100%) rename core/{ => core-main}/src/main/res/drawable-hdpi/dialog_header.xml (100%) rename core/{ => core-main}/src/main/res/drawable-hdpi/toast_border_ok.xml (100%) rename core/{ => core-main}/src/main/res/drawable/alert_border_error.xml (100%) rename core/{ => core-main}/src/main/res/drawable/alert_border_warning.xml (100%) rename core/{ => core-main}/src/main/res/drawable/anim_carbs.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_aaps.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_access_alarm_24dp.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_action.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_actions_refill.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_actions_start_extended_bolus.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_actions_starttempbasal.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_add.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_automation.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_autotune.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_blooddrop_48.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_bluetooth_white_48dp.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_bolus.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_calculator.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_calibration.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_check_while_48dp.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_clone.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_close.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cogs.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_combo_128.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_compare_profiles.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_announcement.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_basal_no_tbr.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_basal_tbr_high.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_basal_tbr_low.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_bgcheck.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_bolus_carbs.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_bolus_carbs_red.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_cgm_insert.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_exercise.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_note.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_pump_battery.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_pump_canula.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_question.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_cp_stats.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_danai_128.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_danar_useropt.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_danarprofile.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_danars_128.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_danarstats.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_dexcom_g6.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_diaconn_g8.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_doubledown.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_doubleup.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_eopatch2_128.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_error_red_48dp.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_eversense.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_flat.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_food.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_fortyfivedown.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_fortyfiveup.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_generic_cgm.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_generic_icon.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_glimp.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_glunovo.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_graduation.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_header_key.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_header_warning.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_home.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_home_profile.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_ict.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_insight_128.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_insulin.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_intelligo.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_invalid.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_local_profile.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_local_save.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_loop_closed.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_loop_closed_off.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_loop_closed_white.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_maintenance.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_minus.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_nightscout_profile.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_nightscout_syncs.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_notif_aaps.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_nsclient_bg.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_patch_pump_outline.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_plus.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_poctech.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_pod_128.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_pump_history.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_quick_wizard.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_refresh.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_remove.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_ribbon_profile.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_sensor.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_singledown.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_singleup.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_smartphone.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_sms.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_sort.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_swap_vert_black_48dp_green.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_temptarget_high.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_toast_check.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_toast_delete_confirm.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_toast_error.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_toast_info.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_toast_warn.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_trash.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_trash_outline.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_treatments.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_trending_flat_white_48dp.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_veo.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_veo_128.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_virtual_pump.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_watch.xml (100%) rename core/{ => core-main}/src/main/res/drawable/ic_x_swap_vert.xml (100%) rename core/{ => core-main}/src/main/res/drawable/icon_insulin_carbs.xml (100%) rename core/{ => core-main}/src/main/res/drawable/launch_screen.xml (100%) rename core/{ => core-main}/src/main/res/drawable/material_button_background.xml (100%) rename core/{ => core-main}/src/main/res/drawable/material_button_selected.xml (100%) rename core/{ => core-main}/src/main/res/drawable/pillborder.xml (100%) rename core/{ => core-main}/src/main/res/drawable/splash_icon.png (100%) rename core/{ => core-main}/src/main/res/layout/close.xml (100%) rename core/{ => core-main}/src/main/res/layout/datetime.xml (100%) rename core/{ => core-main}/src/main/res/layout/dialog_alert_custom_title.xml (100%) rename core/{ => core-main}/src/main/res/layout/dialog_bolusprogress.xml (100%) rename core/{ => core-main}/src/main/res/layout/dialog_error.xml (100%) rename core/{ => core-main}/src/main/res/layout/dialog_profileviewer.xml (100%) rename core/{ => core-main}/src/main/res/layout/maintenance_import_list_activity.xml (100%) rename core/{ => core-main}/src/main/res/layout/maintenance_import_list_item.xml (100%) rename core/{ => core-main}/src/main/res/layout/notes.xml (100%) rename core/{ => core-main}/src/main/res/layout/number_picker_layout.xml (100%) rename core/{ => core-main}/src/main/res/layout/number_picker_layout_vertical.xml (100%) rename core/{ => core-main}/src/main/res/layout/okcancel.xml (100%) rename core/{ => core-main}/src/main/res/layout/passwordprompt.xml (100%) rename core/{ => core-main}/src/main/res/layout/spinner_centered.xml (100%) rename core/{ => core-main}/src/main/res/layout/toast.xml (100%) rename core/{ => core-main}/src/main/res/menu/menu_actions.xml (96%) rename core/{ => core-main}/src/main/res/menu/menu_delete_selection.xml (100%) rename core/{ => core-main}/src/main/res/raw/alarm.mp3 (100%) rename core/{ => core-main}/src/main/res/raw/boluserror.mp3 (100%) rename core/{ => core-main}/src/main/res/raw/error.mp3 (100%) rename core/{ => core-main}/src/main/res/values-af-rZA/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-af-rZA/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-af-rZA/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-ar-rSA/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-ar-rSA/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-bg-rBG/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-bg-rBG/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-bg-rBG/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-ca-rES/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-ca-rES/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-cs-rCZ/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-cs-rCZ/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-cs-rCZ/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-cy-rGB/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-cy-rGB/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-da-rDK/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-da-rDK/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-de-rDE/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-de-rDE/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-de-rDE/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-el-rGR/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-el-rGR/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-el-rGR/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-es-rES/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-es-rES/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-es-rES/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-fi-rFI/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-fi-rFI/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-fr-rFR/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-fr-rFR/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-fr-rFR/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-ga-rIE/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-ga-rIE/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-ga-rIE/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-hr-rHR/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-hr-rHR/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-hr-rHR/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-hu-rHU/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-hu-rHU/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-it-rIT/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-it-rIT/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-it-rIT/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-iw-rIL/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-iw-rIL/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-iw-rIL/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-ja-rJP/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-ja-rJP/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-ko-rKR/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-ko-rKR/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-ko-rKR/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-lt-rLT/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-lt-rLT/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-lt-rLT/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-night/colors.xml (100%) rename core/{ => core-main}/src/main/res/values-night/styles.xml (100%) rename core/{ => core-main}/src/main/res/values-nl-rNL/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-nl-rNL/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-nl-rNL/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-no-rNO/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-no-rNO/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-pl-rPL/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-pl-rPL/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-pl-rPL/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-pt-rBR/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-pt-rBR/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-pt-rBR/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-pt-rPT/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-pt-rPT/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-pt-rPT/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-ro-rRO/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-ro-rRO/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-ro-rRO/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-ru-rRU/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-ru-rRU/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-ru-rRU/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-sk-rSK/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-sk-rSK/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-sk-rSK/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-sl-rSI/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-sl-rSI/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-sl-rSI/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-sr-rCS/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-sr-rCS/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-sv-rSE/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-sv-rSE/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-sv-rSE/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-ta-rIN/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-ta-rIN/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-tr-rTR/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-tr-rTR/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-tr-rTR/validator.xml (100%) rename core/{ => core-main}/src/main/res/values-zh-rCN/protection.xml (100%) rename core/{ => core-main}/src/main/res/values-zh-rCN/strings.xml (100%) rename core/{ => core-main}/src/main/res/values-zh-rCN/validator.xml (100%) rename core/{ => core-main}/src/main/res/values/attrs.xml (100%) rename core/{ => core-main}/src/main/res/values/colors.xml (100%) rename core/{ => core-main}/src/main/res/values/dimens.xml (100%) rename core/{ => core-main}/src/main/res/values/fet_attrs.xml (100%) create mode 100644 core/core-main/src/main/res/values/protection.xml create mode 100644 core/core-main/src/main/res/values/strings.xml rename core/{ => core-main}/src/main/res/values/styles.xml (100%) create mode 100644 core/core-main/src/main/res/values/validator.xml rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/TestBase.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/data/IobTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt (99%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt (99%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/SingleStringStorage.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/pump/common/utils/DateTimeUtilUTest.java (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/CryptoUtilTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt (98%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/DecimalFormatterTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/JsonHelperTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/MidnightTimeTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/RoundTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/StringUtilsTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/TTest.kt (100%) rename core/{ => core-main}/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiserTest.kt (100%) rename core/{ => core-main}/test_dependencies.gradle (100%) diff --git a/app-wear-shared/rx/build.gradle b/app-wear-shared/rx/build.gradle index 1b00eee9b4..6a22f8ff1f 100644 --- a/app-wear-shared/rx/build.gradle +++ b/app-wear-shared/rx/build.gradle @@ -7,9 +7,9 @@ plugins { id 'kotlinx-serialization' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { diff --git a/app-wear-shared/shared-impl/build.gradle b/app-wear-shared/shared-impl/build.gradle index 04dcfe1d45..8d49bea8d6 100644 --- a/app-wear-shared/shared-impl/build.gradle +++ b/app-wear-shared/shared-impl/build.gradle @@ -7,8 +7,8 @@ plugins { id 'kotlinx-serialization' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" android { diff --git a/app-wear-shared/shared/build.gradle b/app-wear-shared/shared/build.gradle index 8556ce1965..0c1a53de8a 100644 --- a/app-wear-shared/shared/build.gradle +++ b/app-wear-shared/shared/build.gradle @@ -7,11 +7,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { diff --git a/app/build.gradle b/app/build.gradle index 2107271ee5..6c3d114856 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ plugins { id 'com.google.firebase.crashlytics' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" repositories { mavenCentral() @@ -185,7 +185,7 @@ dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared-impl') - implementation project(':core') + implementation project(':core:core-main') implementation project(':interfaces') implementation project(':ui') implementation project(':plugins') @@ -227,7 +227,7 @@ dependencies { } -apply from: "${project.rootDir}/core/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" /* diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 7999cebb51..f5ff42cd2d 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -130,7 +130,7 @@ class MainApp : DaggerApplication() { InsertIfNewByTimestampTherapyEventTransaction( timestamp = dateUtil.now(), type = TherapyEvent.Type.NOTE, - note = rh.get().gs(info.nightscout.androidaps.core.R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL, + note = rh.get().gs(info.nightscout.core.main.R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL, glucoseUnit = TherapyEvent.GlucoseUnit.MGDL ) ) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt index 5336b64407..0c067964ab 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt @@ -6,8 +6,8 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.core.databinding.DialogBolusprogressBinding +import info.nightscout.core.main.R +import info.nightscout.core.main.databinding.DialogBolusprogressBinding import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers 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 4602046b05..d18e935800 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 @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.configBuilder -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper diff --git a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt index 9ca879b894..a0ddbacf5b 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt @@ -9,7 +9,7 @@ import android.content.Intent import androidx.core.app.NotificationCompat import androidx.core.app.TaskStackBuilder import info.nightscout.androidaps.MainActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.IconsProvider import info.nightscout.interfaces.NotificationHolder import info.nightscout.shared.interfaces.ResourceHelper diff --git a/automation/build.gradle b/automation/build.gradle index 0b7f76f4f4..c7f2486120 100644 --- a/automation/build.gradle +++ b/automation/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.automation' @@ -18,7 +18,7 @@ android { dependencies { implementation project(':graphview') - implementation project(':core') + implementation project(':core:core-main') implementation project(':database') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt index a734eed337..5cee80adf0 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt @@ -45,15 +45,15 @@ class ActionAlarmTest : TestBase() { @Before fun setup() { - `when`(rh.gs(info.nightscout.androidaps.core.R.string.ok)).thenReturn("OK") - `when`(rh.gs(info.nightscout.androidaps.core.R.string.alarm)).thenReturn("Alarm") + `when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK") + `when`(rh.gs(info.nightscout.core.main.R.string.alarm)).thenReturn("Alarm") `when`(rh.gs(ArgumentMatchers.eq(R.string.alarm_message), ArgumentMatchers.anyString())).thenReturn("Alarm: %s") sut = ActionAlarm(injector) } @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.alarm, sut.friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.alarm, sut.friendlyName()) } @Test fun shortDescriptionTest() { @@ -62,7 +62,7 @@ class ActionAlarmTest : TestBase() { } @Test fun iconTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_access_alarm_24dp, sut.icon()) + Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_access_alarm_24dp, sut.icon()) } @Test fun doActionTest() { diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt index 39cef728f3..61bebe6282 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt @@ -23,7 +23,7 @@ class ActionCarePortalEventTest : ActionsTestBase() { `when`(sp.getString(ArgumentMatchers.anyString(), ArgumentMatchers.anyString())).thenReturn("AAPS") `when`( rh.gs( - ArgumentMatchers.eq(info.nightscout.androidaps.core.R.string.careportal_note_message), + ArgumentMatchers.eq(info.nightscout.core.main.R.string.careportal_note_message), ArgumentMatchers.anyString() ) ).thenReturn("Note : %s") @@ -40,7 +40,7 @@ class ActionCarePortalEventTest : ActionsTestBase() { } @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.careportal, sut.friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.careportal, sut.friendlyName()) } @Test fun shortDescriptionTest() { @@ -48,7 +48,7 @@ class ActionCarePortalEventTest : ActionsTestBase() { } @Test fun iconTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_cp_note, sut.icon()) + Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_cp_note, sut.icon()) } @Test fun doActionTest() { diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt index bd2e39f48e..4d9679164d 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt @@ -18,7 +18,7 @@ class ActionLoopDisableTest : ActionsTestBase() { fun setup() { testPumpPlugin.pumpDescription.isTempBasalCapable = true - `when`(rh.gs(info.nightscout.androidaps.core.R.string.disableloop)).thenReturn("Disable loop") + `when`(rh.gs(info.nightscout.core.main.R.string.disableloop)).thenReturn("Disable loop") `when`(rh.gs(R.string.alreadydisabled)).thenReturn("Disable loop") sut = ActionLoopDisable(injector) @@ -26,7 +26,7 @@ class ActionLoopDisableTest : ActionsTestBase() { @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.disableloop, sut.friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.disableloop, sut.friendlyName()) } @Test diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt index 5d7b09a612..f353efeb29 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt @@ -17,14 +17,14 @@ class ActionLoopEnableTest : ActionsTestBase() { fun setup() { testPumpPlugin.pumpDescription.isTempBasalCapable = true - `when`(rh.gs(info.nightscout.androidaps.core.R.string.enableloop)).thenReturn("Enable loop") + `when`(rh.gs(info.nightscout.core.main.R.string.enableloop)).thenReturn("Enable loop") `when`(rh.gs(R.string.alreadyenabled)).thenReturn("Already enabled") sut = ActionLoopEnable(injector) } @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.enableloop, sut.friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.enableloop, sut.friendlyName()) } @Test fun shortDescriptionTest() { diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt index 6bfb258359..da7e057b1a 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt @@ -18,14 +18,14 @@ class ActionLoopResumeTest : ActionsTestBase() { @Before fun setup() { - `when`(rh.gs(info.nightscout.androidaps.core.R.string.resumeloop)).thenReturn("Resume loop") + `when`(rh.gs(info.nightscout.core.main.R.string.resumeloop)).thenReturn("Resume loop") `when`(rh.gs(R.string.notsuspended)).thenReturn("Not suspended") sut = ActionLoopResume(injector) } @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.resumeloop, sut.friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.resumeloop, sut.friendlyName()) } @Test fun shortDescriptionTest() { diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopSuspendTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopSuspendTest.kt index 38526d0f3a..22a8d204c6 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopSuspendTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopSuspendTest.kt @@ -17,7 +17,7 @@ class ActionLoopSuspendTest : ActionsTestBase() { @Before fun setup() { - `when`(rh.gs(info.nightscout.androidaps.core.R.string.suspendloop)).thenReturn("Suspend loop") + `when`(rh.gs(info.nightscout.core.main.R.string.suspendloop)).thenReturn("Suspend loop") `when`(rh.gs(ArgumentMatchers.eq(R.string.suspendloopforXmin), ArgumentMatchers.anyInt())).thenReturn("Suspend loop for %d min") `when`(rh.gs(R.string.alreadysuspended)).thenReturn("Already suspended") @@ -25,7 +25,7 @@ class ActionLoopSuspendTest : ActionsTestBase() { } @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.suspendloop, sut.friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.suspendloop, sut.friendlyName()) } @Test fun shortDescriptionTest() { diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt index 1b6c5f3c11..9b5084943b 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt @@ -43,8 +43,8 @@ class ActionNotificationTest : TestBase() { @Before fun setup() { - `when`(rh.gs(info.nightscout.androidaps.core.R.string.ok)).thenReturn("OK") - `when`(rh.gs(info.nightscout.androidaps.core.R.string.notification)).thenReturn("Notification") + `when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK") + `when`(rh.gs(info.nightscout.core.main.R.string.notification)).thenReturn("Notification") `when`( rh.gs( ArgumentMatchers.eq(R.string.notification_message), @@ -58,7 +58,7 @@ class ActionNotificationTest : TestBase() { } @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.notification, sut.friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.notification, sut.friendlyName()) } @Test fun shortDescriptionTest() { diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchPercentTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchPercentTest.kt index 6d535ec8f5..f65294c664 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchPercentTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchPercentTest.kt @@ -18,7 +18,7 @@ class ActionProfileSwitchPercentTest : ActionsTestBase() { fun setup() { `when`(rh.gs(R.string.startprofileforever)).thenReturn("Start profile %d%%") - `when`(rh.gs(info.nightscout.androidaps.core.R.string.startprofile)).thenReturn("Start profile %d%% for %d min") + `when`(rh.gs(info.nightscout.core.main.R.string.startprofile)).thenReturn("Start profile %d%% for %d min") sut = ActionProfileSwitchPercent(injector) } @@ -34,7 +34,7 @@ class ActionProfileSwitchPercentTest : ActionsTestBase() { } @Test fun iconTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_actions_profileswitch, sut.icon()) + Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_actions_profileswitch, sut.icon()) } @Test fun doActionTest() { diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchTest.kt index efefe49f18..ae0b862b72 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionProfileSwitchTest.kt @@ -23,9 +23,9 @@ class ActionProfileSwitchTest : ActionsTestBase() { `when`(rh.gs(R.string.profilename)).thenReturn("Change profile to") `when`(rh.gs(ArgumentMatchers.eq(R.string.changengetoprofilename), ArgumentMatchers.anyString())).thenReturn("Change profile to %s") `when`(rh.gs(R.string.alreadyset)).thenReturn("Already set") - `when`(rh.gs(info.nightscout.androidaps.core.R.string.notexists)).thenReturn("not exists") - `when`(rh.gs(info.nightscout.androidaps.core.R.string.error_field_must_not_be_empty)).thenReturn("The field must not be empty") - `when`(rh.gs(info.nightscout.androidaps.core.R.string.noprofile)).thenReturn("No profile loaded from NS yet") + `when`(rh.gs(info.nightscout.core.main.R.string.notexists)).thenReturn("not exists") + `when`(rh.gs(info.nightscout.core.main.R.string.error_field_must_not_be_empty)).thenReturn("The field must not be empty") + `when`(rh.gs(info.nightscout.core.main.R.string.noprofile)).thenReturn("No profile loaded from NS yet") sut = ActionProfileSwitch(injector) } @@ -107,6 +107,6 @@ class ActionProfileSwitchTest : ActionsTestBase() { } @Test fun iconTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_actions_profileswitch, sut.icon()) + Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_actions_profileswitch, sut.icon()) } } \ No newline at end of file diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt index 2232f77f26..9959e3f08d 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt @@ -38,7 +38,7 @@ class ActionStartTempTargetTest : ActionsTestBase() { } @Test fun iconTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.drawable.ic_temptarget_high, sut.icon()) + Assert.assertEquals(info.nightscout.core.main.R.drawable.ic_temptarget_high, sut.icon()) } @Test fun doActionTest() { diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index f0f8b5a72c..771befbe00 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -180,7 +180,7 @@ ActionsTestBase : TestBaseWithProfile() { `when`(activePlugin.activeProfileSource).thenReturn(profilePlugin) `when`(profilePlugin.profile).thenReturn(getValidProfileStore()) - `when`(rh.gs(info.nightscout.androidaps.core.R.string.ok)).thenReturn("OK") - `when`(rh.gs(info.nightscout.androidaps.core.R.string.error)).thenReturn("Error") + `when`(rh.gs(info.nightscout.core.main.R.string.ok)).thenReturn("OK") + `when`(rh.gs(info.nightscout.core.main.R.string.error)).thenReturn("Error") } } \ No newline at end of file diff --git a/automation/src/test/java/info/nightscout/automation/elements/StaticLabelTest.kt b/automation/src/test/java/info/nightscout/automation/elements/StaticLabelTest.kt index 64a9058643..a67f8470c6 100644 --- a/automation/src/test/java/info/nightscout/automation/elements/StaticLabelTest.kt +++ b/automation/src/test/java/info/nightscout/automation/elements/StaticLabelTest.kt @@ -11,8 +11,8 @@ class StaticLabelTest : TriggerTestBase() { @Test fun constructor() { var sl = StaticLabel(rh, "any", TriggerDummy(injector)) Assert.assertEquals("any", sl.label) - `when`(rh.gs(info.nightscout.androidaps.core.R.string.pumplimit)).thenReturn("pump limit") - sl = StaticLabel(rh, info.nightscout.androidaps.core.R.string.pumplimit, TriggerDummy(injector)) + `when`(rh.gs(info.nightscout.core.main.R.string.pumplimit)).thenReturn("pump limit") + sl = StaticLabel(rh, info.nightscout.core.main.R.string.pumplimit, TriggerDummy(injector)) Assert.assertEquals("pump limit", sl.label) } } \ No newline at end of file diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerAutosensValueTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerAutosensValueTest.kt index e054fd2f8c..8c51fbf35a 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerAutosensValueTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerAutosensValueTest.kt @@ -16,8 +16,8 @@ class TriggerAutosensValueTest : TriggerTestBase() { var now = 1514766900000L @Test fun shouldRunTest() { - `when`(sp.getDouble(Mockito.eq(info.nightscout.androidaps.core.R.string.key_openapsama_autosens_max), ArgumentMatchers.anyDouble())).thenReturn(1.2) - `when`(sp.getDouble(Mockito.eq(info.nightscout.androidaps.core.R.string.key_openapsama_autosens_min), ArgumentMatchers.anyDouble())).thenReturn(0.7) + `when`(sp.getDouble(Mockito.eq(info.nightscout.core.main.R.string.key_openapsama_autosens_max), ArgumentMatchers.anyDouble())).thenReturn(1.2) + `when`(sp.getDouble(Mockito.eq(info.nightscout.core.main.R.string.key_openapsama_autosens_min), ArgumentMatchers.anyDouble())).thenReturn(0.7) `when`(autosensDataStore.getLastAutosensData(anyObject(), anyObject(), anyObject())).thenReturn(generateAutosensData()) var t = TriggerAutosensValue(injector) t.autosens.value = 110.0 diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBTDeviceTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBTDeviceTest.kt index c717c94d4f..c37dcb33ec 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBTDeviceTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBTDeviceTest.kt @@ -33,7 +33,7 @@ class TriggerBTDeviceTest : TriggerTestBase() { @Test fun icon() { - Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_bluetooth_white_48dp), TriggerBTDevice(injector).icon()) + Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_bluetooth_white_48dp), TriggerBTDevice(injector).icon()) } @Test fun duplicate() { diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt index 98296a35c1..da9cf0d5b2 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt @@ -76,7 +76,7 @@ class TriggerBgTest : TriggerTestBase() { @Test fun iconTest() { - Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_cp_bgcheck), TriggerBg(injector).icon()) + Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_cp_bgcheck), TriggerBg(injector).icon()) } private fun generateOneCurrentRecordBgData(): List { diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt index f2d2322a5f..30eff00a5a 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt @@ -94,6 +94,6 @@ class TriggerBolusAgoTest : TriggerTestBase() { } @Test fun iconTest() { - Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_bolus), TriggerBolusAgo(injector).icon()) + Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_bolus), TriggerBolusAgo(injector).icon()) } } \ No newline at end of file diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt index 7e7d3634b1..5d362d3657 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerCOBTest.kt @@ -61,7 +61,7 @@ class TriggerCOBTest : TriggerTestBase() { } @Test fun iconTest() { - Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_cp_bolus_carbs), TriggerCOB(injector).icon()) + Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_cp_bolus_carbs), TriggerCOB(injector).icon()) } fun generateCobInfo(): CobInfo { diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerProfilePercentTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerProfilePercentTest.kt index 961e624221..6006fc7ed5 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerProfilePercentTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerProfilePercentTest.kt @@ -60,7 +60,7 @@ class TriggerProfilePercentTest : TriggerTestBase() { } @Test fun iconTest() { - Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_actions_profileswitch), TriggerProfilePercent(injector).icon()) + Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_actions_profileswitch), TriggerProfilePercent(injector).icon()) } @Test fun friendlyNameTest() { diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerPumpLastConnectionTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerPumpLastConnectionTest.kt index bbb6ad5173..b29c0bde46 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerPumpLastConnectionTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerPumpLastConnectionTest.kt @@ -61,7 +61,7 @@ class TriggerPumpLastConnectionTest : TriggerTestBase() { } @Test fun iconTest() { - Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_remove), TriggerPumpLastConnection(injector).icon()) + Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_remove), TriggerPumpLastConnection(injector).icon()) } @Test fun friendlyNameTest() { diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeRangeTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeRangeTest.kt index f6268a57aa..636af3e650 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeRangeTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeRangeTest.kt @@ -65,6 +65,6 @@ class TriggerTimeRangeTest : TriggerTestBase() { } @Test fun iconTest() { - Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_access_alarm_24dp), TriggerTimeRange(injector).icon()) + Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_access_alarm_24dp), TriggerTimeRange(injector).icon()) } } \ No newline at end of file diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt index bdab5ffc22..27fbd804bc 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTimeTest.kt @@ -48,7 +48,7 @@ class TriggerTimeTest : TriggerTestBase() { } @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.time, TriggerTime(injector).friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.time, TriggerTime(injector).friendlyName()) } @Test fun friendlyDescriptionTest() { @@ -56,6 +56,6 @@ class TriggerTimeTest : TriggerTestBase() { } @Test fun iconTest() { - Assert.assertEquals(Optional.of(info.nightscout.androidaps.core.R.drawable.ic_access_alarm_24dp), TriggerTime(injector).icon()) + Assert.assertEquals(Optional.of(info.nightscout.core.main.R.drawable.ic_access_alarm_24dp), TriggerTime(injector).icon()) } } \ No newline at end of file diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerWifiSsidTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerWifiSsidTest.kt index c7b8968427..ad114e9432 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerWifiSsidTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerWifiSsidTest.kt @@ -65,7 +65,7 @@ class TriggerWifiSsidTest : TriggerTestBase() { } @Test fun friendlyNameTest() { - Assert.assertEquals(info.nightscout.androidaps.core.R.string.ns_wifi_ssids, TriggerWifiSsid(injector).friendlyName()) + Assert.assertEquals(info.nightscout.core.main.R.string.ns_wifi_ssids, TriggerWifiSsid(injector).friendlyName()) } @Test fun friendlyDescriptionTest() { diff --git a/core/.gitignore b/core/core-main/.gitignore similarity index 100% rename from core/.gitignore rename to core/core-main/.gitignore diff --git a/core/allopen_dependencies.gradle b/core/core-main/allopen_dependencies.gradle similarity index 100% rename from core/allopen_dependencies.gradle rename to core/core-main/allopen_dependencies.gradle diff --git a/core/android_dependencies.gradle b/core/core-main/android_dependencies.gradle similarity index 100% rename from core/android_dependencies.gradle rename to core/core-main/android_dependencies.gradle diff --git a/core/android_module_dependencies.gradle b/core/core-main/android_module_dependencies.gradle similarity index 100% rename from core/android_module_dependencies.gradle rename to core/core-main/android_module_dependencies.gradle diff --git a/core/build.gradle b/core/core-main/build.gradle similarity index 89% rename from core/build.gradle rename to core/core-main/build.gradle index e1c2733b7a..a9c7b2c2bc 100644 --- a/core/build.gradle +++ b/core/core-main/build.gradle @@ -7,11 +7,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" dependencies { implementation project(':graphview') @@ -92,5 +92,5 @@ dependencies { } android { - namespace 'info.nightscout.androidaps.core' + namespace 'info.nightscout.core.main' } diff --git a/core/consumer-rules.pro b/core/core-main/consumer-rules.pro similarity index 100% rename from core/consumer-rules.pro rename to core/core-main/consumer-rules.pro diff --git a/core/jacoco_global.gradle b/core/core-main/jacoco_global.gradle similarity index 100% rename from core/jacoco_global.gradle rename to core/core-main/jacoco_global.gradle diff --git a/core/proguard-rules.pro b/core/core-main/proguard-rules.pro similarity index 100% rename from core/proguard-rules.pro rename to core/core-main/proguard-rules.pro diff --git a/core/src/main/AndroidManifest.xml b/core/core-main/src/main/AndroidManifest.xml similarity index 100% rename from core/src/main/AndroidManifest.xml rename to core/core-main/src/main/AndroidManifest.xml diff --git a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt b/core/core-main/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt index 90e2fe706f..b4d6d72760 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt @@ -5,7 +5,7 @@ import android.content.pm.PackageManager import androidx.activity.result.contract.ActivityResultContracts import androidx.core.app.ActivityCompat import dagger.android.support.DaggerAppCompatActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract diff --git a/core/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt b/core/core-main/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/activities/DialogAppCompatActivity.kt diff --git a/core/src/main/java/info/nightscout/androidaps/activities/NoSplashAppCompatActivity.kt b/core/core-main/src/main/java/info/nightscout/androidaps/activities/NoSplashAppCompatActivity.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/activities/NoSplashAppCompatActivity.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/activities/NoSplashAppCompatActivity.kt index c08dd5a6d9..7962fb0127 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/NoSplashAppCompatActivity.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/activities/NoSplashAppCompatActivity.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.activities import android.content.Context import android.os.Bundle -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventThemeSwitch diff --git a/core/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt diff --git a/core/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt diff --git a/core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/IobTotal.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/data/IobTotal.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/data/IobTotal.kt diff --git a/core/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt diff --git a/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt index 07b27916c1..2ffeeaaebf 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.data -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.database.data.TargetBlock import info.nightscout.androidaps.database.embedments.InsulinConfiguration diff --git a/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt index eed77b2044..d3249b9959 100644 --- a/core/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.data import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.interfaces.utils.Round diff --git a/core/src/main/java/info/nightscout/androidaps/data/PureProfile.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/data/PureProfile.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt diff --git a/core/src/main/java/info/nightscout/androidaps/data/Sms.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/Sms.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/data/Sms.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/data/Sms.kt diff --git a/core/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt b/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt diff --git a/core/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt b/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/di/CoreFragmentsModule.kt diff --git a/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt b/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreModule.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/di/CoreModule.kt diff --git a/core/src/main/java/info/nightscout/androidaps/di/CoreReceiversModule.kt b/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreReceiversModule.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/di/CoreReceiversModule.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/di/CoreReceiversModule.kt diff --git a/core/src/main/java/info/nightscout/androidaps/di/StaticInjector.kt b/core/core-main/src/main/java/info/nightscout/androidaps/di/StaticInjector.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/di/StaticInjector.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/di/StaticInjector.kt diff --git a/core/src/main/java/info/nightscout/androidaps/di/ValidatorsModule.kt b/core/core-main/src/main/java/info/nightscout/androidaps/di/ValidatorsModule.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/di/ValidatorsModule.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/di/ValidatorsModule.kt diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt index 0258993c5c..873714cfe7 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt @@ -9,8 +9,8 @@ import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.activities.DialogAppCompatActivity -import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.core.databinding.DialogBolusprogressBinding +import info.nightscout.core.main.R +import info.nightscout.core.main.databinding.DialogBolusprogressBinding import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventPumpStatusChanged diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt index 3417716d58..d9a175484a 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt @@ -13,7 +13,7 @@ import com.google.android.material.datepicker.MaterialDatePicker import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.extensions.toVisibility import info.nightscout.shared.utils.DateUtil import info.nightscout.rx.logging.AAPSLogger diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt index 9b901f2814..2faf1346d7 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt @@ -12,8 +12,8 @@ import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.activities.DialogAppCompatActivity -import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.core.databinding.DialogErrorBinding +import info.nightscout.core.main.R +import info.nightscout.core.main.databinding.DialogErrorBinding import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt index 4206dad71c..83500f2793 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt @@ -9,8 +9,8 @@ import android.view.Window import android.view.WindowManager import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.core.databinding.DialogProfileviewerBinding +import info.nightscout.core.main.R +import info.nightscout.core.main.databinding.DialogProfileviewerBinding import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/events/EventPreferenceChange.kt diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt index b8e251c0eb..0f4b7dbb08 100644 --- a/core/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventPumpStatusChanged.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.events -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.interfaces.ResourceHelper class EventPumpStatusChanged : EventStatus { diff --git a/core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventStatus.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/events/EventStatus.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/events/EventStatus.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/BluetoothAdapterExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BluetoothAdapterExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/BluetoothAdapterExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/BluetoothAdapterExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/Concurrency.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/Concurrency.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/Concurrency.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/Concurrency.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt index 7601bc1f08..6bb2afac9b 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt @@ -1,91 +1,91 @@ -package info.nightscout.androidaps.extensions - -import android.content.Context -import android.util.AttributeSet -import android.view.View -import androidx.recyclerview.widget.RecyclerView -import info.nightscout.shared.extensions.runOnUiThread -import info.nightscout.shared.extensions.toVisibility - -class EmptyRecyclerView : RecyclerView { - - private var mEmptyView: View? = null - private var mLoadingView: View? = null - private var mIsLoading = true - - constructor(context: Context) : super(context) - constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) - constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) - - private fun updateEmptyView() { - runOnUiThread { - val isEmpty = !mIsLoading && (adapter == null || adapter?.itemCount == 0) - visibility = isEmpty.not().toVisibility() - mEmptyView?.visibility = isEmpty.toVisibility() - } - } - - private fun updateLoadingView() { - runOnUiThread { - mLoadingView?.visibility = mIsLoading.toVisibility() - } - } - - private val observer: AdapterDataObserver = object : AdapterDataObserver() { - override fun onChanged() { - super.onChanged() - updateEmptyView() - } - - override fun onItemRangeInserted(positionStart: Int, itemCount: Int) { - super.onItemRangeInserted(positionStart, itemCount) - updateEmptyView() - } - - override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) { - super.onItemRangeRemoved(positionStart, itemCount) - updateEmptyView() - } - } - - override fun setAdapter(adapter: Adapter<*>?) { - val oldAdapter = getAdapter() - super.setAdapter(adapter) - update(oldAdapter, adapter) - } - - override fun swapAdapter(adapter: Adapter<*>?, removeAndRecycleExistingViews: Boolean) { - val oldAdapter = getAdapter() - super.swapAdapter(adapter, removeAndRecycleExistingViews) - update(oldAdapter, adapter) - } - - var emptyView: View? - get() = mEmptyView - set(view) { - mEmptyView = view - updateEmptyView() - } - - var loadingView: View? - get() = mLoadingView - set(view) { - mLoadingView = view - updateLoadingView() - } - - var isLoading: Boolean - get() = mIsLoading - set(loading) { - mIsLoading = loading - updateLoadingView() - } - - private fun update(oldAdapter: Adapter<*>?, newAdapter: Adapter<*>?) { - oldAdapter?.unregisterAdapterDataObserver(observer) - newAdapter?.registerAdapterDataObserver(observer) - updateEmptyView() - isLoading = false - updateLoadingView() - } -} +package info.nightscout.androidaps.extensions + +import android.content.Context +import android.util.AttributeSet +import android.view.View +import androidx.recyclerview.widget.RecyclerView +import info.nightscout.shared.extensions.runOnUiThread +import info.nightscout.shared.extensions.toVisibility + +class EmptyRecyclerView : RecyclerView { + + private var mEmptyView: View? = null + private var mLoadingView: View? = null + private var mIsLoading = true + + constructor(context: Context) : super(context) + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) + constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) + + private fun updateEmptyView() { + runOnUiThread { + val isEmpty = !mIsLoading && (adapter == null || adapter?.itemCount == 0) + visibility = isEmpty.not().toVisibility() + mEmptyView?.visibility = isEmpty.toVisibility() + } + } + + private fun updateLoadingView() { + runOnUiThread { + mLoadingView?.visibility = mIsLoading.toVisibility() + } + } + + private val observer: AdapterDataObserver = object : AdapterDataObserver() { + override fun onChanged() { + super.onChanged() + updateEmptyView() + } + + override fun onItemRangeInserted(positionStart: Int, itemCount: Int) { + super.onItemRangeInserted(positionStart, itemCount) + updateEmptyView() + } + + override fun onItemRangeRemoved(positionStart: Int, itemCount: Int) { + super.onItemRangeRemoved(positionStart, itemCount) + updateEmptyView() + } + } + + override fun setAdapter(adapter: Adapter<*>?) { + val oldAdapter = getAdapter() + super.setAdapter(adapter) + update(oldAdapter, adapter) + } + + override fun swapAdapter(adapter: Adapter<*>?, removeAndRecycleExistingViews: Boolean) { + val oldAdapter = getAdapter() + super.swapAdapter(adapter, removeAndRecycleExistingViews) + update(oldAdapter, adapter) + } + + var emptyView: View? + get() = mEmptyView + set(view) { + mEmptyView = view + updateEmptyView() + } + + var loadingView: View? + get() = mLoadingView + set(view) { + mLoadingView = view + updateLoadingView() + } + + var isLoading: Boolean + get() = mIsLoading + set(loading) { + mIsLoading = loading + updateLoadingView() + } + + private fun update(oldAdapter: Adapter<*>?, newAdapter: Adapter<*>?) { + oldAdapter?.unregisterAdapterDataObserver(observer) + newAdapter?.registerAdapterDataObserver(observer) + updateEmptyView() + isLoading = false + updateLoadingView() + } +} diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/HexByteArrayConversion.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/HtmlString.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/IntentExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/IntentExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/IntentExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/IntentExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt index 8e4e3f8998..763505043a 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt index fa5afa61c9..417daeaefb 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt @@ -5,7 +5,7 @@ import android.content.Context import android.view.Gravity import android.widget.TableRow import android.widget.TextView -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.TotalDailyDose import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt similarity index 95% rename from core/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt index 01fbcbe91a..1331e7c4c5 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.GlucoseValue fun GlucoseValue.TrendArrow.directionToIcon(): Int { diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt similarity index 94% rename from core/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt index 2e5c75787f..f766b727f0 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.UserEntry.* fun ColorGroup.colorId(): Int { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/APS.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/APS.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/APS.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/APS.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt similarity index 95% rename from core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt index 32d42efefd..f9744b0681 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.interfaces import android.os.SystemClock import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Sensitivity.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTIR.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTirCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTirCalculator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTirCalculator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/DexcomTirCalculator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TIR.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/stats/TirCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TirCalculator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/interfaces/stats/TirCalculator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TirCalculator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt b/core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt index f8414ac217..5820ea7c86 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.aps.loop import android.text.Spanned import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.extensions.convertedToAbsolute diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt index c0b656bed7..1c7980e542 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.constraints.versionChecker import android.os.Build -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.Config import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt index 79aabc5acc..67a8a3f3e3 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.general.maintenance import android.content.Context import android.os.Environment import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat import info.nightscout.interfaces.Config diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt index 1534c51271..b01410c029 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt @@ -11,9 +11,9 @@ import androidx.fragment.app.FragmentActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerAppCompatActivity -import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.core.databinding.MaintenanceImportListActivityBinding -import info.nightscout.androidaps.core.databinding.MaintenanceImportListItemBinding +import info.nightscout.core.main.R +import info.nightscout.core.main.databinding.MaintenanceImportListActivityBinding +import info.nightscout.core.main.databinding.MaintenanceImportListItemBinding import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider import info.nightscout.interfaces.data.maintenance.PrefsFile import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt index ac7b2a4323..80fb603c22 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.general.maintenance.formats -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.utils.CryptoUtil import info.nightscout.androidaps.extensions.hexStringToByteArray import info.nightscout.androidaps.extensions.toHex diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt index c5b98edc1f..894d572117 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt @@ -7,7 +7,7 @@ import androidx.annotation.DrawableRes import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissNotification.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissNotification.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissNotification.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissNotification.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventNewNotification.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventNewNotification.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventNewNotification.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventNewNotification.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/AreaGraphSeries.java b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/AreaGraphSeries.java similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/AreaGraphSeries.java rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/AreaGraphSeries.java diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt index de29e58319..e457c921f7 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt similarity index 95% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt index ca9c3bcf7f..9290e87b5e 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DataPointWithLabelInterface.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DataPointWithLabelInterface.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DataPointWithLabelInterface.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DataPointWithLabelInterface.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DeviationDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DeviationDataPoint.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DeviationDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DeviationDataPoint.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DoubleDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DoubleDataPoint.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DoubleDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/DoubleDataPoint.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt index e17131a927..05f3dcbe89 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.T diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt similarity index 95% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt index 19a9b037f4..00ad4ce522 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.ExtendedBolus import info.nightscout.androidaps.extensions.toStringTotal import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/FixedLineGraphSeries.java b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/FixedLineGraphSeries.java similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/FixedLineGraphSeries.java rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/FixedLineGraphSeries.java diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt index e6e6968ef6..433183be52 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt index 59b26025e7..58ea6df7b6 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.data.InMemoryGlucoseValue import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java index 1edec982f5..8347de420b 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/PointsWithLabelGraphSeries.java @@ -17,7 +17,7 @@ import com.jjoe64.graphview.series.BaseSeries; import java.util.Iterator; -import info.nightscout.androidaps.core.R; +import info.nightscout.core.main.R; /** * Series that plots the data as points. diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/Scale.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/Scale.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/Scale.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/Scale.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ScaledDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ScaledDataPoint.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ScaledDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ScaledDataPoint.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt index d1ca2efca4..44a9af4aa9 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TimeAsXAxisLabelFormatter.java b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TimeAsXAxisLabelFormatter.java similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TimeAsXAxisLabelFormatter.java rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TimeAsXAxisLabelFormatter.java diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensResult.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensResult.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensResult.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensResult.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/BasalData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/BasalData.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/BasalData.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/BasalData.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt index 65e6ae87b9..59151086ff 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/CobInfo.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatus.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/GlucoseStatusProvider.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt index 798aa29f95..d24d58611e 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator.data import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/events/EventBucketedDataCreated.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/events/EventBucketedDataCreated.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/events/EventBucketedDataCreated.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/events/EventBucketedDataCreated.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt index 95cdceeac5..026b20030d 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/ble/BlePreCheck.kt @@ -11,7 +11,7 @@ import android.provider.Settings import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.extensions.safeEnable import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java rename to core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/DateTimeUtil.java diff --git a/core/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt b/core/core-main/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt index faba5a75a8..652d04c773 100644 --- a/core/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.queue.commands import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.database.AppRepository import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt b/core/core-main/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/receivers/DataWorkerStorage.kt diff --git a/core/src/main/java/info/nightscout/androidaps/receivers/Intents.kt b/core/core-main/src/main/java/info/nightscout/androidaps/receivers/Intents.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/receivers/Intents.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/receivers/Intents.kt diff --git a/core/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt b/core/core-main/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/receivers/NetworkChangeReceiver.kt diff --git a/core/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt b/core/core-main/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/receivers/ReceiverStatusStore.kt diff --git a/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt b/core/core-main/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt index 396e1ca8d0..f16e684a4b 100644 --- a/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt @@ -9,7 +9,7 @@ import android.os.Handler import android.os.IBinder import android.os.Looper import dagger.android.DaggerService -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.NotificationHolder import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.logging.AAPSLogger diff --git a/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundServiceHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/services/AlarmSoundServiceHelper.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/services/AlarmSoundServiceHelper.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/services/AlarmSoundServiceHelper.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt index 97d023cca9..01aafc2a4d 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ActionModeHelper.kt @@ -1,185 +1,185 @@ -package info.nightscout.androidaps.utils - -import android.util.SparseArray -import android.view.ActionMode -import android.view.Menu -import android.view.MenuInflater -import android.view.MenuItem -import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentActivity -import info.nightscout.androidaps.core.R - -import info.nightscout.shared.interfaces.ResourceHelper - -class ActionModeHelper(val rh: ResourceHelper, val activity: FragmentActivity?, val fragment: Fragment?) { - - var enableSort = false - private var selectedItems: SparseArray = SparseArray() - private var actionMode: ActionMode? = null - private var removeActionMode: ActionMode? = null - private var sortActionMode: ActionMode? = null - private var onRemove: ((selectedItems: SparseArray) -> Unit)? = null - private var onUpdate: (() -> Unit)? = null - - private val inSingleFragment: Boolean - get() { - val parentClass = this.activity?.let { it::class.simpleName } - return parentClass == "SingleFragmentActivity" - } - - private val enableRemove: Boolean - get() = onRemove != null - - val isNoAction: Boolean - get() = actionMode == null && removeActionMode == null && sortActionMode == null - - val isSorting: Boolean - get() = sortActionMode != null - - val isRemoving: Boolean - get() = removeActionMode != null - - fun onOptionsItemSelected(item: MenuItem): Boolean { - return when (item.itemId) { - R.id.nav_remove_items -> { - removeActionMode = activity?.startActionMode(RemoveActionModeCallback()) - true - } - - R.id.nav_sort_items -> { - sortActionMode = activity?.startActionMode(SortActionModeCallback()) - true - } - - else -> false - } - } - - fun updateSelection(position: Int, item: T, selected: Boolean) { - if (selected) { - selectedItems.put(position, item) - } else { - selectedItems.remove(position) - } - removeActionMode?.title = rh.gs(R.string.count_selected, selectedItems.size()) - } - - fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { - if (inSingleFragment) { - inflater.inflate(R.menu.menu_actions, menu) - } else if (fragment?.isResumed == true) { - menu.add(Menu.FIRST, R.id.nav_remove_items, 0, rh.gs(R.string.remove_items)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) - menu.add(Menu.FIRST, R.id.nav_sort_items, 0, rh.gs(R.string.sort_items)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) - menu.setGroupDividerEnabled(true) - } - } - - fun onPrepareOptionsMenu(menu: Menu) { - menu.findItem(R.id.nav_remove_items)?.isVisible = enableRemove - menu.findItem(R.id.nav_sort_items)?.isVisible = enableSort - } - - fun startAction(): Boolean { - if (isNoAction) { - actionMode = activity?.startActionMode(ActionModeCallback()) - return true - } - return false - } - - fun startRemove(): Boolean { - if (removeActionMode == null) { - removeActionMode = activity?.startActionMode(RemoveActionModeCallback()) - return true - } - return false - } - - fun isSelected(position: Int) = - selectedItems.get(position) != null - - fun setOnRemoveHandler(onRemove: (selectedItems: SparseArray) -> Unit) { - this.onRemove = onRemove - } - - fun setUpdateListHandler(onUpdate: () -> Unit) { - this.onUpdate = onUpdate - } - - fun finish() { - actionMode?.finish() - removeActionMode?.finish() - sortActionMode?.finish() - } - - private inner class ActionModeCallback : ActionMode.Callback { - - override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean { - mode.title = activity?.title - mode.menuInflater.inflate(R.menu.menu_actions, menu) - onUpdate?.let { it() } - return true - } - - override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false - - override fun onActionItemClicked(mode: ActionMode, item: MenuItem) = - onOptionsItemSelected(item) - - override fun onDestroyActionMode(mode: ActionMode?) { - actionMode = null - } - } - - private inner class SortActionModeCallback : ActionMode.Callback { - - override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean { - mode.title = rh.gs(R.string.sort_label) - onUpdate?.let { it() } - return true - } - - override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false - - override fun onActionItemClicked(mode: ActionMode, item: MenuItem) = false - - override fun onDestroyActionMode(mode: ActionMode?) { - sortActionMode = null - onUpdate?.let { it() } - } - } - - private inner class RemoveActionModeCallback : ActionMode.Callback { - - override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean { - mode.menuInflater.inflate(R.menu.menu_delete_selection, menu) - selectedItems.clear() - mode.title = rh.gs(R.string.count_selected, selectedItems.size()) - onUpdate?.let { it() } - return true - } - - override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false - - override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean { - return when (item.itemId) { - R.id.remove_selected -> { - if (selectedItems.size() > 0) { - onRemove?.let { it(selectedItems) } - } else { - finish() - } - true - } - - else -> false - } - } - - override fun onDestroyActionMode(mode: ActionMode?) { - removeActionMode = null - onUpdate?.let { it() } - } - } - -} +package info.nightscout.androidaps.utils + +import android.util.SparseArray +import android.view.ActionMode +import android.view.Menu +import android.view.MenuInflater +import android.view.MenuItem +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentActivity +import info.nightscout.core.main.R + +import info.nightscout.shared.interfaces.ResourceHelper + +class ActionModeHelper(val rh: ResourceHelper, val activity: FragmentActivity?, val fragment: Fragment?) { + + var enableSort = false + private var selectedItems: SparseArray = SparseArray() + private var actionMode: ActionMode? = null + private var removeActionMode: ActionMode? = null + private var sortActionMode: ActionMode? = null + private var onRemove: ((selectedItems: SparseArray) -> Unit)? = null + private var onUpdate: (() -> Unit)? = null + + private val inSingleFragment: Boolean + get() { + val parentClass = this.activity?.let { it::class.simpleName } + return parentClass == "SingleFragmentActivity" + } + + private val enableRemove: Boolean + get() = onRemove != null + + val isNoAction: Boolean + get() = actionMode == null && removeActionMode == null && sortActionMode == null + + val isSorting: Boolean + get() = sortActionMode != null + + val isRemoving: Boolean + get() = removeActionMode != null + + fun onOptionsItemSelected(item: MenuItem): Boolean { + return when (item.itemId) { + R.id.nav_remove_items -> { + removeActionMode = activity?.startActionMode(RemoveActionModeCallback()) + true + } + + R.id.nav_sort_items -> { + sortActionMode = activity?.startActionMode(SortActionModeCallback()) + true + } + + else -> false + } + } + + fun updateSelection(position: Int, item: T, selected: Boolean) { + if (selected) { + selectedItems.put(position, item) + } else { + selectedItems.remove(position) + } + removeActionMode?.title = rh.gs(R.string.count_selected, selectedItems.size()) + } + + fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { + if (inSingleFragment) { + inflater.inflate(R.menu.menu_actions, menu) + } else if (fragment?.isResumed == true) { + menu.add(Menu.FIRST, R.id.nav_remove_items, 0, rh.gs(R.string.remove_items)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) + menu.add(Menu.FIRST, R.id.nav_sort_items, 0, rh.gs(R.string.sort_items)).setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER) + menu.setGroupDividerEnabled(true) + } + } + + fun onPrepareOptionsMenu(menu: Menu) { + menu.findItem(R.id.nav_remove_items)?.isVisible = enableRemove + menu.findItem(R.id.nav_sort_items)?.isVisible = enableSort + } + + fun startAction(): Boolean { + if (isNoAction) { + actionMode = activity?.startActionMode(ActionModeCallback()) + return true + } + return false + } + + fun startRemove(): Boolean { + if (removeActionMode == null) { + removeActionMode = activity?.startActionMode(RemoveActionModeCallback()) + return true + } + return false + } + + fun isSelected(position: Int) = + selectedItems.get(position) != null + + fun setOnRemoveHandler(onRemove: (selectedItems: SparseArray) -> Unit) { + this.onRemove = onRemove + } + + fun setUpdateListHandler(onUpdate: () -> Unit) { + this.onUpdate = onUpdate + } + + fun finish() { + actionMode?.finish() + removeActionMode?.finish() + sortActionMode?.finish() + } + + private inner class ActionModeCallback : ActionMode.Callback { + + override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean { + mode.title = activity?.title + mode.menuInflater.inflate(R.menu.menu_actions, menu) + onUpdate?.let { it() } + return true + } + + override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false + + override fun onActionItemClicked(mode: ActionMode, item: MenuItem) = + onOptionsItemSelected(item) + + override fun onDestroyActionMode(mode: ActionMode?) { + actionMode = null + } + } + + private inner class SortActionModeCallback : ActionMode.Callback { + + override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean { + mode.title = rh.gs(R.string.sort_label) + onUpdate?.let { it() } + return true + } + + override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false + + override fun onActionItemClicked(mode: ActionMode, item: MenuItem) = false + + override fun onDestroyActionMode(mode: ActionMode?) { + sortActionMode = null + onUpdate?.let { it() } + } + } + + private inner class RemoveActionModeCallback : ActionMode.Callback { + + override fun onCreateActionMode(mode: ActionMode, menu: Menu?): Boolean { + mode.menuInflater.inflate(R.menu.menu_delete_selection, menu) + selectedItems.clear() + mode.title = rh.gs(R.string.count_selected, selectedItems.size()) + onUpdate?.let { it() } + return true + } + + override fun onPrepareActionMode(mode: ActionMode?, menu: Menu?) = false + + override fun onActionItemClicked(mode: ActionMode, item: MenuItem): Boolean { + return when (item.itemId) { + R.id.remove_selected -> { + if (selectedItems.size() > 0) { + onRemove?.let { it(selectedItems) } + } else { + finish() + } + true + } + + else -> false + } + } + + override fun onDestroyActionMode(mode: ActionMode?) { + removeActionMode = null + onUpdate?.let { it() } + } + } + +} diff --git a/core/src/main/java/info/nightscout/androidaps/utils/CryptoUtil.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/CryptoUtil.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/utils/CryptoUtil.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/CryptoUtil.kt index 18beeac298..7146746b1d 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/CryptoUtil.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/CryptoUtil.kt @@ -1,127 +1,127 @@ -package info.nightscout.androidaps.utils - -import info.nightscout.androidaps.extensions.toHex -import info.nightscout.rx.logging.AAPSLogger -import org.spongycastle.util.encoders.Base64 -import java.nio.ByteBuffer -import java.security.MessageDigest -import java.security.SecureRandom -import java.security.spec.KeySpec -import javax.crypto.Cipher -import javax.crypto.Mac -import javax.crypto.SecretKey -import javax.crypto.SecretKeyFactory -import javax.crypto.spec.GCMParameterSpec -import javax.crypto.spec.PBEKeySpec -import javax.crypto.spec.SecretKeySpec -import javax.inject.Inject -import javax.inject.Singleton - -@Suppress("SpellCheckingInspection") -@Singleton -class CryptoUtil @Inject constructor( - val aapsLogger: AAPSLogger -) { - - companion object { - private const val IV_LENGTH_BYTE = 12 - private const val TAG_LENGTH_BIT = 128 - private const val AES_KEY_SIZE_BIT = 256 - private const val PBKDF2_ITERATIONS = 50000 // check delays it cause on real device - private const val SALT_SIZE_BYTE = 32 - } - - private val secureRandom: SecureRandom = SecureRandom() - var lastException: Exception? = null - - fun sha256(source: String): String { - val digest = MessageDigest.getInstance("SHA-256") - val hashRaw = digest.digest(source.toByteArray()) - return hashRaw.toHex() - } - - fun hmac256(str: String, secret: String): String { - val sha256HMAC = Mac.getInstance("HmacSHA256") - val secretKey = SecretKeySpec(secret.toByteArray(), "HmacSHA256") - sha256HMAC.init(secretKey) - return sha256HMAC.doFinal(str.toByteArray()).toHex() - } - - private fun prepCipherKey(passPhrase: String, salt: ByteArray, iterationCount: Int = PBKDF2_ITERATIONS, keyStrength: Int = AES_KEY_SIZE_BIT): SecretKeySpec { - val factory: SecretKeyFactory = SecretKeyFactory.getInstance("PBKDF2withHmacSHA1") - val spec: KeySpec = PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount, keyStrength) - val tmp: SecretKey = factory.generateSecret(spec) - return SecretKeySpec(tmp.encoded, "AES") - } - - fun mineSalt(len: Int = SALT_SIZE_BYTE): ByteArray { - val salt = ByteArray(len) - secureRandom.nextBytes(salt) - return salt - } - - fun encrypt(passPhrase: String, salt: ByteArray, rawData: String): String? { - val iv: ByteArray? - val encrypted: ByteArray? - return try { - lastException = null - iv = ByteArray(IV_LENGTH_BYTE) - secureRandom.nextBytes(iv) - val cipherEnc: Cipher = Cipher.getInstance("AES/GCM/NoPadding") - cipherEnc.init(Cipher.ENCRYPT_MODE, prepCipherKey(passPhrase, salt), GCMParameterSpec(TAG_LENGTH_BIT, iv)) - encrypted = cipherEnc.doFinal(rawData.toByteArray()) ?: return null - val byteBuffer: ByteBuffer = ByteBuffer.allocate(1 + iv.size + encrypted.size) - byteBuffer.put(iv.size.toByte()) - byteBuffer.put(iv) - byteBuffer.put(encrypted) - String(Base64.encode(byteBuffer.array())) - } catch (e: Exception) { - lastException = e - aapsLogger.error("Encryption failed due to technical exception: $e") - null - } - } - - fun decrypt(passPhrase: String, salt: ByteArray, encryptedData: String): String? { - val iv: ByteArray? - val encrypted: ByteArray? - return try { - lastException = null - val byteBuffer = ByteBuffer.wrap(Base64.decode(encryptedData)) - val ivLength = byteBuffer.get().toInt() - iv = ByteArray(ivLength) - byteBuffer[iv] - encrypted = ByteArray(byteBuffer.remaining()) - byteBuffer[encrypted] - val cipherDec: Cipher = Cipher.getInstance("AES/GCM/NoPadding") - cipherDec.init(Cipher.DECRYPT_MODE, prepCipherKey(passPhrase, salt), GCMParameterSpec(TAG_LENGTH_BIT, iv)) - val dec = cipherDec.doFinal(encrypted) - String(dec) - } catch (e: Exception) { - lastException = e - aapsLogger.error("Decryption failed due to technical exception: $e") - null - } - } - - fun checkPassword(password: String, referenceHash: String): Boolean { - return if (referenceHash.startsWith("hmac:")) { - val hashSegments = referenceHash.split(":") - if (hashSegments.size != 3) - return false - return hmac256(password, hashSegments[1]) == hashSegments[2] - } else { - password == referenceHash - } - } - - fun hashPassword(password: String): String { - return if (!password.startsWith("hmac:")) { - val salt = mineSalt().toHex() - return "hmac:${salt}:${hmac256(password, salt)}" - } else { - password - } - } - +package info.nightscout.androidaps.utils + +import info.nightscout.androidaps.extensions.toHex +import info.nightscout.rx.logging.AAPSLogger +import org.spongycastle.util.encoders.Base64 +import java.nio.ByteBuffer +import java.security.MessageDigest +import java.security.SecureRandom +import java.security.spec.KeySpec +import javax.crypto.Cipher +import javax.crypto.Mac +import javax.crypto.SecretKey +import javax.crypto.SecretKeyFactory +import javax.crypto.spec.GCMParameterSpec +import javax.crypto.spec.PBEKeySpec +import javax.crypto.spec.SecretKeySpec +import javax.inject.Inject +import javax.inject.Singleton + +@Suppress("SpellCheckingInspection") +@Singleton +class CryptoUtil @Inject constructor( + val aapsLogger: AAPSLogger +) { + + companion object { + private const val IV_LENGTH_BYTE = 12 + private const val TAG_LENGTH_BIT = 128 + private const val AES_KEY_SIZE_BIT = 256 + private const val PBKDF2_ITERATIONS = 50000 // check delays it cause on real device + private const val SALT_SIZE_BYTE = 32 + } + + private val secureRandom: SecureRandom = SecureRandom() + var lastException: Exception? = null + + fun sha256(source: String): String { + val digest = MessageDigest.getInstance("SHA-256") + val hashRaw = digest.digest(source.toByteArray()) + return hashRaw.toHex() + } + + fun hmac256(str: String, secret: String): String { + val sha256HMAC = Mac.getInstance("HmacSHA256") + val secretKey = SecretKeySpec(secret.toByteArray(), "HmacSHA256") + sha256HMAC.init(secretKey) + return sha256HMAC.doFinal(str.toByteArray()).toHex() + } + + private fun prepCipherKey(passPhrase: String, salt: ByteArray, iterationCount: Int = PBKDF2_ITERATIONS, keyStrength: Int = AES_KEY_SIZE_BIT): SecretKeySpec { + val factory: SecretKeyFactory = SecretKeyFactory.getInstance("PBKDF2withHmacSHA1") + val spec: KeySpec = PBEKeySpec(passPhrase.toCharArray(), salt, iterationCount, keyStrength) + val tmp: SecretKey = factory.generateSecret(spec) + return SecretKeySpec(tmp.encoded, "AES") + } + + fun mineSalt(len: Int = SALT_SIZE_BYTE): ByteArray { + val salt = ByteArray(len) + secureRandom.nextBytes(salt) + return salt + } + + fun encrypt(passPhrase: String, salt: ByteArray, rawData: String): String? { + val iv: ByteArray? + val encrypted: ByteArray? + return try { + lastException = null + iv = ByteArray(IV_LENGTH_BYTE) + secureRandom.nextBytes(iv) + val cipherEnc: Cipher = Cipher.getInstance("AES/GCM/NoPadding") + cipherEnc.init(Cipher.ENCRYPT_MODE, prepCipherKey(passPhrase, salt), GCMParameterSpec(TAG_LENGTH_BIT, iv)) + encrypted = cipherEnc.doFinal(rawData.toByteArray()) ?: return null + val byteBuffer: ByteBuffer = ByteBuffer.allocate(1 + iv.size + encrypted.size) + byteBuffer.put(iv.size.toByte()) + byteBuffer.put(iv) + byteBuffer.put(encrypted) + String(Base64.encode(byteBuffer.array())) + } catch (e: Exception) { + lastException = e + aapsLogger.error("Encryption failed due to technical exception: $e") + null + } + } + + fun decrypt(passPhrase: String, salt: ByteArray, encryptedData: String): String? { + val iv: ByteArray? + val encrypted: ByteArray? + return try { + lastException = null + val byteBuffer = ByteBuffer.wrap(Base64.decode(encryptedData)) + val ivLength = byteBuffer.get().toInt() + iv = ByteArray(ivLength) + byteBuffer[iv] + encrypted = ByteArray(byteBuffer.remaining()) + byteBuffer[encrypted] + val cipherDec: Cipher = Cipher.getInstance("AES/GCM/NoPadding") + cipherDec.init(Cipher.DECRYPT_MODE, prepCipherKey(passPhrase, salt), GCMParameterSpec(TAG_LENGTH_BIT, iv)) + val dec = cipherDec.doFinal(encrypted) + String(dec) + } catch (e: Exception) { + lastException = e + aapsLogger.error("Decryption failed due to technical exception: $e") + null + } + } + + fun checkPassword(password: String, referenceHash: String): Boolean { + return if (referenceHash.startsWith("hmac:")) { + val hashSegments = referenceHash.split(":") + if (hashSegments.size != 3) + return false + return hmac256(password, hashSegments[1]) == hashSegments[2] + } else { + password == referenceHash + } + } + + fun hashPassword(password: String): String { + return if (!password.startsWith("hmac:")) { + val salt = mineSalt().toHex() + return "hmac:${salt}:${hmac256(password, salt)}" + } else { + password + } + } + } \ No newline at end of file diff --git a/core/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt index 787be730c0..811888d85e 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.utils -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.Pump import info.nightscout.shared.interfaces.ResourceHelper import java.text.DecimalFormat diff --git a/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt index 27c49d87a8..b346feaffc 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils import info.nightscout.interfaces.Constants import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/core/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt index 1b9cc5b517..8d3f433c62 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt @@ -6,7 +6,7 @@ import com.google.firebase.analytics.ktx.analytics import com.google.firebase.crashlytics.FirebaseCrashlytics import com.google.firebase.ktx.Firebase import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt index c077c761be..42f95d4e2c 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils import android.content.Context import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/utils/InstanceId.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/InstanceId.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/InstanceId.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/InstanceId.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt index 4cff217013..deb391ed0c 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ToastUtils.kt @@ -12,7 +12,7 @@ import android.widget.Toast import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.appcompat.view.ContextThemeWrapper -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.utils.resources.getThemeColor diff --git a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/Translator.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/Translator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/Translator.kt index 601d64a0aa..86eadfbda1 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/Translator.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.utils -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.OfflineEvent import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.TherapyEvent diff --git a/core/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt index b705d64e3c..5567bf256c 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.utils import android.widget.TextView -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.extensions.isOlderThan import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/AlertDialogHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/AlertDialogHelper.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/AlertDialogHelper.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/AlertDialogHelper.kt index fd68b96034..f839a8fd57 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/AlertDialogHelper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/AlertDialogHelper.kt @@ -10,7 +10,7 @@ import androidx.annotation.LayoutRes import androidx.annotation.StyleRes import androidx.appcompat.view.ContextThemeWrapper import com.google.android.material.dialog.MaterialAlertDialogBuilder -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R object AlertDialogHelper { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt index b7f53746c1..b613bfc76e 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/OKDialog.kt @@ -7,7 +7,7 @@ import android.os.SystemClock import android.text.Spanned import androidx.fragment.app.FragmentActivity import com.google.android.material.dialog.MaterialAlertDialogBuilder -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.extensions.runOnUiThread object OKDialog { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt index 8206f74ccb..85df84f366 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/alertDialogs/WarningDialog.kt @@ -6,7 +6,7 @@ import android.content.DialogInterface import android.os.SystemClock import androidx.annotation.StringRes import com.google.android.material.dialog.MaterialAlertDialogBuilder -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.extensions.runOnUiThread // if you need error dialog - duplicate to ErrorDialog and make it and use: AppThemeErrorDialog & R.drawable.ic_header_error instead diff --git a/core/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt index a9df635e47..31be63bbb5 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.utils.protection import androidx.biometric.BiometricPrompt import androidx.biometric.BiometricPrompt.* import androidx.fragment.app.FragmentActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.extensions.runOnUiThread import java.util.concurrent.Executors diff --git a/core/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt index 24b67debb7..18d6f68b2f 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt @@ -12,7 +12,7 @@ import android.widget.EditText import android.widget.TextView import androidx.annotation.StringRes import com.google.android.material.dialog.MaterialAlertDialogBuilder -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider import info.nightscout.androidaps.utils.CryptoUtil diff --git a/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt index b810fa8b56..27fb7c29f9 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.utils.protection import androidx.fragment.app.FragmentActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.sharedPreferences.SP import java.util.concurrent.TimeUnit diff --git a/core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperExtensions.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperExtensions.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperExtensions.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperExtensions.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt index d943766c3e..ea58448e7c 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt @@ -13,7 +13,7 @@ import androidx.annotation.* import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.view.ContextThemeWrapper import androidx.core.content.ContextCompat -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.FabricPrivacy import java.util.* diff --git a/core/src/main/java/info/nightscout/androidaps/utils/serialisation/SealedClassHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/SealedClassHelper.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/serialisation/SealedClassHelper.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/SealedClassHelper.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiser.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiser.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiser.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiser.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt index 26d108b25f..16bbc77974 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt @@ -7,7 +7,7 @@ import android.text.TextWatcher import android.widget.EditText import com.google.android.material.textfield.TextInputLayout import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.textValidator.validators.* diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/EditTextValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt index 5ebdd6dbfa..354ad7daab 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt @@ -5,7 +5,7 @@ import android.util.AttributeSet import androidx.preference.EditTextPreference import androidx.preference.PreferenceViewHolder import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.SafeParse diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaNumericValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AlphaValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/AndValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/CreditCardValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DateValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DigitLengthRangeValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DomainValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/DummyValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmailValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/EmptyValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/FloatNumericRangeValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/HttpsUrlValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/IpAddressValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MinDigitLengthValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiPhoneValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/MultiValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NotValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericRangeValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/NumericValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/OrValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PatternValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonFullNameValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PersonNameValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PhoneValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/PinStrengthValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/RegexpValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/SameValueValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/Validator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/WebUrlValidator.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt index 15a5a86449..1517b19d39 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt @@ -6,7 +6,7 @@ import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.utils.Round import java.text.NumberFormat diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt similarity index 97% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt index 20bbfd38a0..00d3e0d556 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt @@ -9,7 +9,7 @@ import android.os.Build import android.util.AttributeSet import androidx.core.app.ActivityCompat import androidx.preference.ListPreference -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.utils.ToastUtils import java.util.* diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/DigitsKeyListenerWithComma.java b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/DigitsKeyListenerWithComma.java similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/DigitsKeyListenerWithComma.java rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/DigitsKeyListenerWithComma.java diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt index e70b7b0da2..4af96b9f65 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt @@ -6,7 +6,7 @@ import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.utils.Round import java.text.NumberFormat diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt similarity index 98% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt index fae4aa98e8..3906db112e 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt @@ -6,7 +6,7 @@ import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.utils.Round import java.text.NumberFormat diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/MinutesNumberPicker.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/MinutesNumberPicker.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/MinutesNumberPicker.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/MinutesNumberPicker.kt index aa2575d996..04a14700ea 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/MinutesNumberPicker.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/MinutesNumberPicker.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.utils.ui import android.content.Context import android.util.AttributeSet import android.widget.Button -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import java.text.DecimalFormat class MinutesNumberPicker constructor(context: Context, attrs: AttributeSet? = null) : NumberPicker(context, attrs) { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt index b4a198f2ff..3f93fdeae2 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt @@ -21,8 +21,8 @@ import android.view.accessibility.AccessibilityManager import android.view.inputmethod.InputMethodManager import android.widget.Button import android.widget.LinearLayout -import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.core.databinding.NumberPickerLayoutBinding +import info.nightscout.core.main.R +import info.nightscout.core.main.databinding.NumberPickerLayoutBinding import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.SafeParse diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerVertical.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerVertical.kt similarity index 85% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerVertical.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerVertical.kt index ec94040cdb..94745da4d5 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerVertical.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerVertical.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.utils.ui import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater -import info.nightscout.androidaps.core.databinding.NumberPickerLayoutVerticalBinding +import info.nightscout.core.main.databinding.NumberPickerLayoutVerticalBinding class NumberPickerVertical(context: Context, attrs: AttributeSet? = null) : NumberPicker(context, attrs) { diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerViewAdapter.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerViewAdapter.kt similarity index 88% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerViewAdapter.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerViewAdapter.kt index 43ab2e2f72..30a648165c 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerViewAdapter.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/NumberPickerViewAdapter.kt @@ -1,36 +1,36 @@ -package info.nightscout.androidaps.utils.ui - -import info.nightscout.androidaps.core.databinding.NumberPickerLayoutBinding -import info.nightscout.androidaps.core.databinding.NumberPickerLayoutVerticalBinding - -/** - * NumberPickerViewAdapter binds both NumberPickerLayoutBinding and NumberPickerLayoutVerticalBinding shared attributes to one common view adapter. - * Requires at least one of the ViewBinding as a parameter. Recommended to use the factory object to create the binding. - */ -class NumberPickerViewAdapter( - val nH: NumberPickerLayoutBinding?, - val nV: NumberPickerLayoutVerticalBinding?, -) { - - init { - if (nH == null && nV == null) { - throw IllegalArgumentException("Require at least on Binding parameter") - } - } - - val editText = nH?.display ?: nV?.display ?: throw IllegalArgumentException("Missing require View Binding parameter display") - val minusButton = nH?.decrement ?: nV?.decrement ?: throw IllegalArgumentException("require at least on Binding parameter decrement") - val plusButton = nH?.increment ?: nV?.increment ?: throw IllegalArgumentException("require at least on Binding parameter increment") - var textInputLayout = nH?.textInputLayout ?: nV?.textInputLayout ?: throw IllegalArgumentException("require at least on Binding parameter textInputLayout") - - companion object { - - fun getBinding(bindLayout: NumberPickerLayoutBinding): NumberPickerViewAdapter { - return NumberPickerViewAdapter(bindLayout, null) - } - - fun getBinding(bindLayout: NumberPickerLayoutVerticalBinding): NumberPickerViewAdapter { - return NumberPickerViewAdapter(null, bindLayout) - } - } -} +package info.nightscout.androidaps.utils.ui + +import info.nightscout.core.main.databinding.NumberPickerLayoutBinding +import info.nightscout.core.main.databinding.NumberPickerLayoutVerticalBinding + +/** + * NumberPickerViewAdapter binds both NumberPickerLayoutBinding and NumberPickerLayoutVerticalBinding shared attributes to one common view adapter. + * Requires at least one of the ViewBinding as a parameter. Recommended to use the factory object to create the binding. + */ +class NumberPickerViewAdapter( + val nH: NumberPickerLayoutBinding?, + val nV: NumberPickerLayoutVerticalBinding?, +) { + + init { + if (nH == null && nV == null) { + throw IllegalArgumentException("Require at least on Binding parameter") + } + } + + val editText = nH?.display ?: nV?.display ?: throw IllegalArgumentException("Missing require View Binding parameter display") + val minusButton = nH?.decrement ?: nV?.decrement ?: throw IllegalArgumentException("require at least on Binding parameter decrement") + val plusButton = nH?.increment ?: nV?.increment ?: throw IllegalArgumentException("require at least on Binding parameter increment") + var textInputLayout = nH?.textInputLayout ?: nV?.textInputLayout ?: throw IllegalArgumentException("require at least on Binding parameter textInputLayout") + + companion object { + + fun getBinding(bindLayout: NumberPickerLayoutBinding): NumberPickerViewAdapter { + return NumberPickerViewAdapter(bindLayout, null) + } + + fun getBinding(bindLayout: NumberPickerLayoutVerticalBinding): NumberPickerViewAdapter { + return NumberPickerViewAdapter(null, bindLayout) + } + } +} diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt similarity index 96% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt index 8fa18c3e67..996a22a30f 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/SingleClickButton.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.utils.ui import android.content.Context import android.util.AttributeSet import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt index c10ead7998..f2feee5ed9 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt @@ -4,7 +4,7 @@ import android.content.Context import android.util.AttributeSet import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.general.overview.graphExtensions.AreaGraphSeries diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/UIRunnable.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/VerticalTextView.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/VerticalTextView.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/ui/VerticalTextView.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/VerticalTextView.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt diff --git a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt similarity index 99% rename from core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt index ed075845d1..cc6cc86028 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.utils.userEntry import android.text.Spanned import dagger.Reusable import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.ColorGroup diff --git a/core/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt similarity index 100% rename from core/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt diff --git a/core/src/main/res/color/day_selection_background.xml b/core/core-main/src/main/res/color/day_selection_background.xml similarity index 100% rename from core/src/main/res/color/day_selection_background.xml rename to core/core-main/src/main/res/color/day_selection_background.xml diff --git a/core/src/main/res/color/mtrl_btn_bg_color_selector_grey.xml b/core/core-main/src/main/res/color/mtrl_btn_bg_color_selector_grey.xml similarity index 100% rename from core/src/main/res/color/mtrl_btn_bg_color_selector_grey.xml rename to core/core-main/src/main/res/color/mtrl_btn_bg_color_selector_grey.xml diff --git a/core/src/main/res/drawable-hdpi/background_input_border.xml b/core/core-main/src/main/res/drawable-hdpi/background_input_border.xml similarity index 100% rename from core/src/main/res/drawable-hdpi/background_input_border.xml rename to core/core-main/src/main/res/drawable-hdpi/background_input_border.xml diff --git a/core/src/main/res/drawable-hdpi/dialog.xml b/core/core-main/src/main/res/drawable-hdpi/dialog.xml similarity index 100% rename from core/src/main/res/drawable-hdpi/dialog.xml rename to core/core-main/src/main/res/drawable-hdpi/dialog.xml diff --git a/core/src/main/res/drawable-hdpi/dialog_header.xml b/core/core-main/src/main/res/drawable-hdpi/dialog_header.xml similarity index 100% rename from core/src/main/res/drawable-hdpi/dialog_header.xml rename to core/core-main/src/main/res/drawable-hdpi/dialog_header.xml diff --git a/core/src/main/res/drawable-hdpi/toast_border_ok.xml b/core/core-main/src/main/res/drawable-hdpi/toast_border_ok.xml similarity index 100% rename from core/src/main/res/drawable-hdpi/toast_border_ok.xml rename to core/core-main/src/main/res/drawable-hdpi/toast_border_ok.xml diff --git a/core/src/main/res/drawable/alert_border_error.xml b/core/core-main/src/main/res/drawable/alert_border_error.xml similarity index 100% rename from core/src/main/res/drawable/alert_border_error.xml rename to core/core-main/src/main/res/drawable/alert_border_error.xml diff --git a/core/src/main/res/drawable/alert_border_warning.xml b/core/core-main/src/main/res/drawable/alert_border_warning.xml similarity index 100% rename from core/src/main/res/drawable/alert_border_warning.xml rename to core/core-main/src/main/res/drawable/alert_border_warning.xml diff --git a/core/src/main/res/drawable/anim_carbs.xml b/core/core-main/src/main/res/drawable/anim_carbs.xml similarity index 100% rename from core/src/main/res/drawable/anim_carbs.xml rename to core/core-main/src/main/res/drawable/anim_carbs.xml diff --git a/core/src/main/res/drawable/ic_aaps.xml b/core/core-main/src/main/res/drawable/ic_aaps.xml similarity index 100% rename from core/src/main/res/drawable/ic_aaps.xml rename to core/core-main/src/main/res/drawable/ic_aaps.xml diff --git a/core/src/main/res/drawable/ic_access_alarm_24dp.xml b/core/core-main/src/main/res/drawable/ic_access_alarm_24dp.xml similarity index 100% rename from core/src/main/res/drawable/ic_access_alarm_24dp.xml rename to core/core-main/src/main/res/drawable/ic_access_alarm_24dp.xml diff --git a/core/src/main/res/drawable/ic_action.xml b/core/core-main/src/main/res/drawable/ic_action.xml similarity index 100% rename from core/src/main/res/drawable/ic_action.xml rename to core/core-main/src/main/res/drawable/ic_action.xml diff --git a/core/src/main/res/drawable/ic_actions_refill.xml b/core/core-main/src/main/res/drawable/ic_actions_refill.xml similarity index 100% rename from core/src/main/res/drawable/ic_actions_refill.xml rename to core/core-main/src/main/res/drawable/ic_actions_refill.xml diff --git a/core/src/main/res/drawable/ic_actions_start_extended_bolus.xml b/core/core-main/src/main/res/drawable/ic_actions_start_extended_bolus.xml similarity index 100% rename from core/src/main/res/drawable/ic_actions_start_extended_bolus.xml rename to core/core-main/src/main/res/drawable/ic_actions_start_extended_bolus.xml diff --git a/core/src/main/res/drawable/ic_actions_starttempbasal.xml b/core/core-main/src/main/res/drawable/ic_actions_starttempbasal.xml similarity index 100% rename from core/src/main/res/drawable/ic_actions_starttempbasal.xml rename to core/core-main/src/main/res/drawable/ic_actions_starttempbasal.xml diff --git a/core/src/main/res/drawable/ic_add.xml b/core/core-main/src/main/res/drawable/ic_add.xml similarity index 100% rename from core/src/main/res/drawable/ic_add.xml rename to core/core-main/src/main/res/drawable/ic_add.xml diff --git a/core/src/main/res/drawable/ic_automation.xml b/core/core-main/src/main/res/drawable/ic_automation.xml similarity index 100% rename from core/src/main/res/drawable/ic_automation.xml rename to core/core-main/src/main/res/drawable/ic_automation.xml diff --git a/core/src/main/res/drawable/ic_autotune.xml b/core/core-main/src/main/res/drawable/ic_autotune.xml similarity index 100% rename from core/src/main/res/drawable/ic_autotune.xml rename to core/core-main/src/main/res/drawable/ic_autotune.xml diff --git a/core/src/main/res/drawable/ic_blooddrop_48.xml b/core/core-main/src/main/res/drawable/ic_blooddrop_48.xml similarity index 100% rename from core/src/main/res/drawable/ic_blooddrop_48.xml rename to core/core-main/src/main/res/drawable/ic_blooddrop_48.xml diff --git a/core/src/main/res/drawable/ic_bluetooth_white_48dp.xml b/core/core-main/src/main/res/drawable/ic_bluetooth_white_48dp.xml similarity index 100% rename from core/src/main/res/drawable/ic_bluetooth_white_48dp.xml rename to core/core-main/src/main/res/drawable/ic_bluetooth_white_48dp.xml diff --git a/core/src/main/res/drawable/ic_bolus.xml b/core/core-main/src/main/res/drawable/ic_bolus.xml similarity index 100% rename from core/src/main/res/drawable/ic_bolus.xml rename to core/core-main/src/main/res/drawable/ic_bolus.xml diff --git a/core/src/main/res/drawable/ic_calculator.xml b/core/core-main/src/main/res/drawable/ic_calculator.xml similarity index 100% rename from core/src/main/res/drawable/ic_calculator.xml rename to core/core-main/src/main/res/drawable/ic_calculator.xml diff --git a/core/src/main/res/drawable/ic_calibration.xml b/core/core-main/src/main/res/drawable/ic_calibration.xml similarity index 100% rename from core/src/main/res/drawable/ic_calibration.xml rename to core/core-main/src/main/res/drawable/ic_calibration.xml diff --git a/core/src/main/res/drawable/ic_check_while_48dp.xml b/core/core-main/src/main/res/drawable/ic_check_while_48dp.xml similarity index 100% rename from core/src/main/res/drawable/ic_check_while_48dp.xml rename to core/core-main/src/main/res/drawable/ic_check_while_48dp.xml diff --git a/core/src/main/res/drawable/ic_clone.xml b/core/core-main/src/main/res/drawable/ic_clone.xml similarity index 100% rename from core/src/main/res/drawable/ic_clone.xml rename to core/core-main/src/main/res/drawable/ic_clone.xml diff --git a/core/src/main/res/drawable/ic_close.xml b/core/core-main/src/main/res/drawable/ic_close.xml similarity index 100% rename from core/src/main/res/drawable/ic_close.xml rename to core/core-main/src/main/res/drawable/ic_close.xml diff --git a/core/src/main/res/drawable/ic_cogs.xml b/core/core-main/src/main/res/drawable/ic_cogs.xml similarity index 100% rename from core/src/main/res/drawable/ic_cogs.xml rename to core/core-main/src/main/res/drawable/ic_cogs.xml diff --git a/core/src/main/res/drawable/ic_combo_128.xml b/core/core-main/src/main/res/drawable/ic_combo_128.xml similarity index 100% rename from core/src/main/res/drawable/ic_combo_128.xml rename to core/core-main/src/main/res/drawable/ic_combo_128.xml diff --git a/core/src/main/res/drawable/ic_compare_profiles.xml b/core/core-main/src/main/res/drawable/ic_compare_profiles.xml similarity index 100% rename from core/src/main/res/drawable/ic_compare_profiles.xml rename to core/core-main/src/main/res/drawable/ic_compare_profiles.xml diff --git a/core/src/main/res/drawable/ic_cp_announcement.xml b/core/core-main/src/main/res/drawable/ic_cp_announcement.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_announcement.xml rename to core/core-main/src/main/res/drawable/ic_cp_announcement.xml diff --git a/core/src/main/res/drawable/ic_cp_basal_no_tbr.xml b/core/core-main/src/main/res/drawable/ic_cp_basal_no_tbr.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_basal_no_tbr.xml rename to core/core-main/src/main/res/drawable/ic_cp_basal_no_tbr.xml diff --git a/core/src/main/res/drawable/ic_cp_basal_tbr_high.xml b/core/core-main/src/main/res/drawable/ic_cp_basal_tbr_high.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_basal_tbr_high.xml rename to core/core-main/src/main/res/drawable/ic_cp_basal_tbr_high.xml diff --git a/core/src/main/res/drawable/ic_cp_basal_tbr_low.xml b/core/core-main/src/main/res/drawable/ic_cp_basal_tbr_low.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_basal_tbr_low.xml rename to core/core-main/src/main/res/drawable/ic_cp_basal_tbr_low.xml diff --git a/core/src/main/res/drawable/ic_cp_bgcheck.xml b/core/core-main/src/main/res/drawable/ic_cp_bgcheck.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_bgcheck.xml rename to core/core-main/src/main/res/drawable/ic_cp_bgcheck.xml diff --git a/core/src/main/res/drawable/ic_cp_bolus_carbs.xml b/core/core-main/src/main/res/drawable/ic_cp_bolus_carbs.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_bolus_carbs.xml rename to core/core-main/src/main/res/drawable/ic_cp_bolus_carbs.xml diff --git a/core/src/main/res/drawable/ic_cp_bolus_carbs_red.xml b/core/core-main/src/main/res/drawable/ic_cp_bolus_carbs_red.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_bolus_carbs_red.xml rename to core/core-main/src/main/res/drawable/ic_cp_bolus_carbs_red.xml diff --git a/core/src/main/res/drawable/ic_cp_cgm_insert.xml b/core/core-main/src/main/res/drawable/ic_cp_cgm_insert.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_cgm_insert.xml rename to core/core-main/src/main/res/drawable/ic_cp_cgm_insert.xml diff --git a/core/src/main/res/drawable/ic_cp_exercise.xml b/core/core-main/src/main/res/drawable/ic_cp_exercise.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_exercise.xml rename to core/core-main/src/main/res/drawable/ic_cp_exercise.xml diff --git a/core/src/main/res/drawable/ic_cp_note.xml b/core/core-main/src/main/res/drawable/ic_cp_note.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_note.xml rename to core/core-main/src/main/res/drawable/ic_cp_note.xml diff --git a/core/src/main/res/drawable/ic_cp_pump_battery.xml b/core/core-main/src/main/res/drawable/ic_cp_pump_battery.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_pump_battery.xml rename to core/core-main/src/main/res/drawable/ic_cp_pump_battery.xml diff --git a/core/src/main/res/drawable/ic_cp_pump_canula.xml b/core/core-main/src/main/res/drawable/ic_cp_pump_canula.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_pump_canula.xml rename to core/core-main/src/main/res/drawable/ic_cp_pump_canula.xml diff --git a/core/src/main/res/drawable/ic_cp_question.xml b/core/core-main/src/main/res/drawable/ic_cp_question.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_question.xml rename to core/core-main/src/main/res/drawable/ic_cp_question.xml diff --git a/core/src/main/res/drawable/ic_cp_stats.xml b/core/core-main/src/main/res/drawable/ic_cp_stats.xml similarity index 100% rename from core/src/main/res/drawable/ic_cp_stats.xml rename to core/core-main/src/main/res/drawable/ic_cp_stats.xml diff --git a/core/src/main/res/drawable/ic_danai_128.xml b/core/core-main/src/main/res/drawable/ic_danai_128.xml similarity index 100% rename from core/src/main/res/drawable/ic_danai_128.xml rename to core/core-main/src/main/res/drawable/ic_danai_128.xml diff --git a/core/src/main/res/drawable/ic_danar_useropt.xml b/core/core-main/src/main/res/drawable/ic_danar_useropt.xml similarity index 100% rename from core/src/main/res/drawable/ic_danar_useropt.xml rename to core/core-main/src/main/res/drawable/ic_danar_useropt.xml diff --git a/core/src/main/res/drawable/ic_danarprofile.xml b/core/core-main/src/main/res/drawable/ic_danarprofile.xml similarity index 100% rename from core/src/main/res/drawable/ic_danarprofile.xml rename to core/core-main/src/main/res/drawable/ic_danarprofile.xml diff --git a/core/src/main/res/drawable/ic_danars_128.xml b/core/core-main/src/main/res/drawable/ic_danars_128.xml similarity index 100% rename from core/src/main/res/drawable/ic_danars_128.xml rename to core/core-main/src/main/res/drawable/ic_danars_128.xml diff --git a/core/src/main/res/drawable/ic_danarstats.xml b/core/core-main/src/main/res/drawable/ic_danarstats.xml similarity index 100% rename from core/src/main/res/drawable/ic_danarstats.xml rename to core/core-main/src/main/res/drawable/ic_danarstats.xml diff --git a/core/src/main/res/drawable/ic_dexcom_g6.xml b/core/core-main/src/main/res/drawable/ic_dexcom_g6.xml similarity index 100% rename from core/src/main/res/drawable/ic_dexcom_g6.xml rename to core/core-main/src/main/res/drawable/ic_dexcom_g6.xml diff --git a/core/src/main/res/drawable/ic_diaconn_g8.xml b/core/core-main/src/main/res/drawable/ic_diaconn_g8.xml similarity index 100% rename from core/src/main/res/drawable/ic_diaconn_g8.xml rename to core/core-main/src/main/res/drawable/ic_diaconn_g8.xml diff --git a/core/src/main/res/drawable/ic_doubledown.xml b/core/core-main/src/main/res/drawable/ic_doubledown.xml similarity index 100% rename from core/src/main/res/drawable/ic_doubledown.xml rename to core/core-main/src/main/res/drawable/ic_doubledown.xml diff --git a/core/src/main/res/drawable/ic_doubleup.xml b/core/core-main/src/main/res/drawable/ic_doubleup.xml similarity index 100% rename from core/src/main/res/drawable/ic_doubleup.xml rename to core/core-main/src/main/res/drawable/ic_doubleup.xml diff --git a/core/src/main/res/drawable/ic_eopatch2_128.xml b/core/core-main/src/main/res/drawable/ic_eopatch2_128.xml similarity index 100% rename from core/src/main/res/drawable/ic_eopatch2_128.xml rename to core/core-main/src/main/res/drawable/ic_eopatch2_128.xml diff --git a/core/src/main/res/drawable/ic_error_red_48dp.xml b/core/core-main/src/main/res/drawable/ic_error_red_48dp.xml similarity index 100% rename from core/src/main/res/drawable/ic_error_red_48dp.xml rename to core/core-main/src/main/res/drawable/ic_error_red_48dp.xml diff --git a/core/src/main/res/drawable/ic_eversense.xml b/core/core-main/src/main/res/drawable/ic_eversense.xml similarity index 100% rename from core/src/main/res/drawable/ic_eversense.xml rename to core/core-main/src/main/res/drawable/ic_eversense.xml diff --git a/core/src/main/res/drawable/ic_flat.xml b/core/core-main/src/main/res/drawable/ic_flat.xml similarity index 100% rename from core/src/main/res/drawable/ic_flat.xml rename to core/core-main/src/main/res/drawable/ic_flat.xml diff --git a/core/src/main/res/drawable/ic_food.xml b/core/core-main/src/main/res/drawable/ic_food.xml similarity index 100% rename from core/src/main/res/drawable/ic_food.xml rename to core/core-main/src/main/res/drawable/ic_food.xml diff --git a/core/src/main/res/drawable/ic_fortyfivedown.xml b/core/core-main/src/main/res/drawable/ic_fortyfivedown.xml similarity index 100% rename from core/src/main/res/drawable/ic_fortyfivedown.xml rename to core/core-main/src/main/res/drawable/ic_fortyfivedown.xml diff --git a/core/src/main/res/drawable/ic_fortyfiveup.xml b/core/core-main/src/main/res/drawable/ic_fortyfiveup.xml similarity index 100% rename from core/src/main/res/drawable/ic_fortyfiveup.xml rename to core/core-main/src/main/res/drawable/ic_fortyfiveup.xml diff --git a/core/src/main/res/drawable/ic_generic_cgm.xml b/core/core-main/src/main/res/drawable/ic_generic_cgm.xml similarity index 100% rename from core/src/main/res/drawable/ic_generic_cgm.xml rename to core/core-main/src/main/res/drawable/ic_generic_cgm.xml diff --git a/core/src/main/res/drawable/ic_generic_icon.xml b/core/core-main/src/main/res/drawable/ic_generic_icon.xml similarity index 100% rename from core/src/main/res/drawable/ic_generic_icon.xml rename to core/core-main/src/main/res/drawable/ic_generic_icon.xml diff --git a/core/src/main/res/drawable/ic_glimp.xml b/core/core-main/src/main/res/drawable/ic_glimp.xml similarity index 100% rename from core/src/main/res/drawable/ic_glimp.xml rename to core/core-main/src/main/res/drawable/ic_glimp.xml diff --git a/core/src/main/res/drawable/ic_glunovo.xml b/core/core-main/src/main/res/drawable/ic_glunovo.xml similarity index 100% rename from core/src/main/res/drawable/ic_glunovo.xml rename to core/core-main/src/main/res/drawable/ic_glunovo.xml diff --git a/core/src/main/res/drawable/ic_graduation.xml b/core/core-main/src/main/res/drawable/ic_graduation.xml similarity index 100% rename from core/src/main/res/drawable/ic_graduation.xml rename to core/core-main/src/main/res/drawable/ic_graduation.xml diff --git a/core/src/main/res/drawable/ic_header_key.xml b/core/core-main/src/main/res/drawable/ic_header_key.xml similarity index 100% rename from core/src/main/res/drawable/ic_header_key.xml rename to core/core-main/src/main/res/drawable/ic_header_key.xml diff --git a/core/src/main/res/drawable/ic_header_warning.xml b/core/core-main/src/main/res/drawable/ic_header_warning.xml similarity index 100% rename from core/src/main/res/drawable/ic_header_warning.xml rename to core/core-main/src/main/res/drawable/ic_header_warning.xml diff --git a/core/src/main/res/drawable/ic_home.xml b/core/core-main/src/main/res/drawable/ic_home.xml similarity index 100% rename from core/src/main/res/drawable/ic_home.xml rename to core/core-main/src/main/res/drawable/ic_home.xml diff --git a/core/src/main/res/drawable/ic_home_profile.xml b/core/core-main/src/main/res/drawable/ic_home_profile.xml similarity index 100% rename from core/src/main/res/drawable/ic_home_profile.xml rename to core/core-main/src/main/res/drawable/ic_home_profile.xml diff --git a/core/src/main/res/drawable/ic_ict.xml b/core/core-main/src/main/res/drawable/ic_ict.xml similarity index 100% rename from core/src/main/res/drawable/ic_ict.xml rename to core/core-main/src/main/res/drawable/ic_ict.xml diff --git a/core/src/main/res/drawable/ic_insight_128.xml b/core/core-main/src/main/res/drawable/ic_insight_128.xml similarity index 100% rename from core/src/main/res/drawable/ic_insight_128.xml rename to core/core-main/src/main/res/drawable/ic_insight_128.xml diff --git a/core/src/main/res/drawable/ic_insulin.xml b/core/core-main/src/main/res/drawable/ic_insulin.xml similarity index 100% rename from core/src/main/res/drawable/ic_insulin.xml rename to core/core-main/src/main/res/drawable/ic_insulin.xml diff --git a/core/src/main/res/drawable/ic_intelligo.xml b/core/core-main/src/main/res/drawable/ic_intelligo.xml similarity index 100% rename from core/src/main/res/drawable/ic_intelligo.xml rename to core/core-main/src/main/res/drawable/ic_intelligo.xml diff --git a/core/src/main/res/drawable/ic_invalid.xml b/core/core-main/src/main/res/drawable/ic_invalid.xml similarity index 100% rename from core/src/main/res/drawable/ic_invalid.xml rename to core/core-main/src/main/res/drawable/ic_invalid.xml diff --git a/core/src/main/res/drawable/ic_local_profile.xml b/core/core-main/src/main/res/drawable/ic_local_profile.xml similarity index 100% rename from core/src/main/res/drawable/ic_local_profile.xml rename to core/core-main/src/main/res/drawable/ic_local_profile.xml diff --git a/core/src/main/res/drawable/ic_local_save.xml b/core/core-main/src/main/res/drawable/ic_local_save.xml similarity index 100% rename from core/src/main/res/drawable/ic_local_save.xml rename to core/core-main/src/main/res/drawable/ic_local_save.xml diff --git a/core/src/main/res/drawable/ic_loop_closed.xml b/core/core-main/src/main/res/drawable/ic_loop_closed.xml similarity index 100% rename from core/src/main/res/drawable/ic_loop_closed.xml rename to core/core-main/src/main/res/drawable/ic_loop_closed.xml diff --git a/core/src/main/res/drawable/ic_loop_closed_off.xml b/core/core-main/src/main/res/drawable/ic_loop_closed_off.xml similarity index 100% rename from core/src/main/res/drawable/ic_loop_closed_off.xml rename to core/core-main/src/main/res/drawable/ic_loop_closed_off.xml diff --git a/core/src/main/res/drawable/ic_loop_closed_white.xml b/core/core-main/src/main/res/drawable/ic_loop_closed_white.xml similarity index 100% rename from core/src/main/res/drawable/ic_loop_closed_white.xml rename to core/core-main/src/main/res/drawable/ic_loop_closed_white.xml diff --git a/core/src/main/res/drawable/ic_maintenance.xml b/core/core-main/src/main/res/drawable/ic_maintenance.xml similarity index 100% rename from core/src/main/res/drawable/ic_maintenance.xml rename to core/core-main/src/main/res/drawable/ic_maintenance.xml diff --git a/core/src/main/res/drawable/ic_minus.xml b/core/core-main/src/main/res/drawable/ic_minus.xml similarity index 100% rename from core/src/main/res/drawable/ic_minus.xml rename to core/core-main/src/main/res/drawable/ic_minus.xml diff --git a/core/src/main/res/drawable/ic_nightscout_profile.xml b/core/core-main/src/main/res/drawable/ic_nightscout_profile.xml similarity index 100% rename from core/src/main/res/drawable/ic_nightscout_profile.xml rename to core/core-main/src/main/res/drawable/ic_nightscout_profile.xml diff --git a/core/src/main/res/drawable/ic_nightscout_syncs.xml b/core/core-main/src/main/res/drawable/ic_nightscout_syncs.xml similarity index 100% rename from core/src/main/res/drawable/ic_nightscout_syncs.xml rename to core/core-main/src/main/res/drawable/ic_nightscout_syncs.xml diff --git a/core/src/main/res/drawable/ic_notif_aaps.xml b/core/core-main/src/main/res/drawable/ic_notif_aaps.xml similarity index 100% rename from core/src/main/res/drawable/ic_notif_aaps.xml rename to core/core-main/src/main/res/drawable/ic_notif_aaps.xml diff --git a/core/src/main/res/drawable/ic_nsclient_bg.xml b/core/core-main/src/main/res/drawable/ic_nsclient_bg.xml similarity index 100% rename from core/src/main/res/drawable/ic_nsclient_bg.xml rename to core/core-main/src/main/res/drawable/ic_nsclient_bg.xml diff --git a/core/src/main/res/drawable/ic_patch_pump_outline.xml b/core/core-main/src/main/res/drawable/ic_patch_pump_outline.xml similarity index 100% rename from core/src/main/res/drawable/ic_patch_pump_outline.xml rename to core/core-main/src/main/res/drawable/ic_patch_pump_outline.xml diff --git a/core/src/main/res/drawable/ic_plus.xml b/core/core-main/src/main/res/drawable/ic_plus.xml similarity index 100% rename from core/src/main/res/drawable/ic_plus.xml rename to core/core-main/src/main/res/drawable/ic_plus.xml diff --git a/core/src/main/res/drawable/ic_poctech.xml b/core/core-main/src/main/res/drawable/ic_poctech.xml similarity index 100% rename from core/src/main/res/drawable/ic_poctech.xml rename to core/core-main/src/main/res/drawable/ic_poctech.xml diff --git a/core/src/main/res/drawable/ic_pod_128.xml b/core/core-main/src/main/res/drawable/ic_pod_128.xml similarity index 100% rename from core/src/main/res/drawable/ic_pod_128.xml rename to core/core-main/src/main/res/drawable/ic_pod_128.xml diff --git a/core/src/main/res/drawable/ic_pump_history.xml b/core/core-main/src/main/res/drawable/ic_pump_history.xml similarity index 100% rename from core/src/main/res/drawable/ic_pump_history.xml rename to core/core-main/src/main/res/drawable/ic_pump_history.xml diff --git a/core/src/main/res/drawable/ic_quick_wizard.xml b/core/core-main/src/main/res/drawable/ic_quick_wizard.xml similarity index 100% rename from core/src/main/res/drawable/ic_quick_wizard.xml rename to core/core-main/src/main/res/drawable/ic_quick_wizard.xml diff --git a/core/src/main/res/drawable/ic_refresh.xml b/core/core-main/src/main/res/drawable/ic_refresh.xml similarity index 100% rename from core/src/main/res/drawable/ic_refresh.xml rename to core/core-main/src/main/res/drawable/ic_refresh.xml diff --git a/core/src/main/res/drawable/ic_remove.xml b/core/core-main/src/main/res/drawable/ic_remove.xml similarity index 100% rename from core/src/main/res/drawable/ic_remove.xml rename to core/core-main/src/main/res/drawable/ic_remove.xml diff --git a/core/src/main/res/drawable/ic_ribbon_profile.xml b/core/core-main/src/main/res/drawable/ic_ribbon_profile.xml similarity index 100% rename from core/src/main/res/drawable/ic_ribbon_profile.xml rename to core/core-main/src/main/res/drawable/ic_ribbon_profile.xml diff --git a/core/src/main/res/drawable/ic_sensor.xml b/core/core-main/src/main/res/drawable/ic_sensor.xml similarity index 100% rename from core/src/main/res/drawable/ic_sensor.xml rename to core/core-main/src/main/res/drawable/ic_sensor.xml diff --git a/core/src/main/res/drawable/ic_singledown.xml b/core/core-main/src/main/res/drawable/ic_singledown.xml similarity index 100% rename from core/src/main/res/drawable/ic_singledown.xml rename to core/core-main/src/main/res/drawable/ic_singledown.xml diff --git a/core/src/main/res/drawable/ic_singleup.xml b/core/core-main/src/main/res/drawable/ic_singleup.xml similarity index 100% rename from core/src/main/res/drawable/ic_singleup.xml rename to core/core-main/src/main/res/drawable/ic_singleup.xml diff --git a/core/src/main/res/drawable/ic_smartphone.xml b/core/core-main/src/main/res/drawable/ic_smartphone.xml similarity index 100% rename from core/src/main/res/drawable/ic_smartphone.xml rename to core/core-main/src/main/res/drawable/ic_smartphone.xml diff --git a/core/src/main/res/drawable/ic_sms.xml b/core/core-main/src/main/res/drawable/ic_sms.xml similarity index 100% rename from core/src/main/res/drawable/ic_sms.xml rename to core/core-main/src/main/res/drawable/ic_sms.xml diff --git a/core/src/main/res/drawable/ic_sort.xml b/core/core-main/src/main/res/drawable/ic_sort.xml similarity index 100% rename from core/src/main/res/drawable/ic_sort.xml rename to core/core-main/src/main/res/drawable/ic_sort.xml diff --git a/core/src/main/res/drawable/ic_swap_vert_black_48dp_green.xml b/core/core-main/src/main/res/drawable/ic_swap_vert_black_48dp_green.xml similarity index 100% rename from core/src/main/res/drawable/ic_swap_vert_black_48dp_green.xml rename to core/core-main/src/main/res/drawable/ic_swap_vert_black_48dp_green.xml diff --git a/core/src/main/res/drawable/ic_temptarget_high.xml b/core/core-main/src/main/res/drawable/ic_temptarget_high.xml similarity index 100% rename from core/src/main/res/drawable/ic_temptarget_high.xml rename to core/core-main/src/main/res/drawable/ic_temptarget_high.xml diff --git a/core/src/main/res/drawable/ic_toast_check.xml b/core/core-main/src/main/res/drawable/ic_toast_check.xml similarity index 100% rename from core/src/main/res/drawable/ic_toast_check.xml rename to core/core-main/src/main/res/drawable/ic_toast_check.xml diff --git a/core/src/main/res/drawable/ic_toast_delete_confirm.xml b/core/core-main/src/main/res/drawable/ic_toast_delete_confirm.xml similarity index 100% rename from core/src/main/res/drawable/ic_toast_delete_confirm.xml rename to core/core-main/src/main/res/drawable/ic_toast_delete_confirm.xml diff --git a/core/src/main/res/drawable/ic_toast_error.xml b/core/core-main/src/main/res/drawable/ic_toast_error.xml similarity index 100% rename from core/src/main/res/drawable/ic_toast_error.xml rename to core/core-main/src/main/res/drawable/ic_toast_error.xml diff --git a/core/src/main/res/drawable/ic_toast_info.xml b/core/core-main/src/main/res/drawable/ic_toast_info.xml similarity index 100% rename from core/src/main/res/drawable/ic_toast_info.xml rename to core/core-main/src/main/res/drawable/ic_toast_info.xml diff --git a/core/src/main/res/drawable/ic_toast_warn.xml b/core/core-main/src/main/res/drawable/ic_toast_warn.xml similarity index 100% rename from core/src/main/res/drawable/ic_toast_warn.xml rename to core/core-main/src/main/res/drawable/ic_toast_warn.xml diff --git a/core/src/main/res/drawable/ic_trash.xml b/core/core-main/src/main/res/drawable/ic_trash.xml similarity index 100% rename from core/src/main/res/drawable/ic_trash.xml rename to core/core-main/src/main/res/drawable/ic_trash.xml diff --git a/core/src/main/res/drawable/ic_trash_outline.xml b/core/core-main/src/main/res/drawable/ic_trash_outline.xml similarity index 100% rename from core/src/main/res/drawable/ic_trash_outline.xml rename to core/core-main/src/main/res/drawable/ic_trash_outline.xml diff --git a/core/src/main/res/drawable/ic_treatments.xml b/core/core-main/src/main/res/drawable/ic_treatments.xml similarity index 100% rename from core/src/main/res/drawable/ic_treatments.xml rename to core/core-main/src/main/res/drawable/ic_treatments.xml diff --git a/core/src/main/res/drawable/ic_trending_flat_white_48dp.xml b/core/core-main/src/main/res/drawable/ic_trending_flat_white_48dp.xml similarity index 100% rename from core/src/main/res/drawable/ic_trending_flat_white_48dp.xml rename to core/core-main/src/main/res/drawable/ic_trending_flat_white_48dp.xml diff --git a/core/src/main/res/drawable/ic_veo.xml b/core/core-main/src/main/res/drawable/ic_veo.xml similarity index 100% rename from core/src/main/res/drawable/ic_veo.xml rename to core/core-main/src/main/res/drawable/ic_veo.xml diff --git a/core/src/main/res/drawable/ic_veo_128.xml b/core/core-main/src/main/res/drawable/ic_veo_128.xml similarity index 100% rename from core/src/main/res/drawable/ic_veo_128.xml rename to core/core-main/src/main/res/drawable/ic_veo_128.xml diff --git a/core/src/main/res/drawable/ic_virtual_pump.xml b/core/core-main/src/main/res/drawable/ic_virtual_pump.xml similarity index 100% rename from core/src/main/res/drawable/ic_virtual_pump.xml rename to core/core-main/src/main/res/drawable/ic_virtual_pump.xml diff --git a/core/src/main/res/drawable/ic_watch.xml b/core/core-main/src/main/res/drawable/ic_watch.xml similarity index 100% rename from core/src/main/res/drawable/ic_watch.xml rename to core/core-main/src/main/res/drawable/ic_watch.xml diff --git a/core/src/main/res/drawable/ic_x_swap_vert.xml b/core/core-main/src/main/res/drawable/ic_x_swap_vert.xml similarity index 100% rename from core/src/main/res/drawable/ic_x_swap_vert.xml rename to core/core-main/src/main/res/drawable/ic_x_swap_vert.xml diff --git a/core/src/main/res/drawable/icon_insulin_carbs.xml b/core/core-main/src/main/res/drawable/icon_insulin_carbs.xml similarity index 100% rename from core/src/main/res/drawable/icon_insulin_carbs.xml rename to core/core-main/src/main/res/drawable/icon_insulin_carbs.xml diff --git a/core/src/main/res/drawable/launch_screen.xml b/core/core-main/src/main/res/drawable/launch_screen.xml similarity index 100% rename from core/src/main/res/drawable/launch_screen.xml rename to core/core-main/src/main/res/drawable/launch_screen.xml diff --git a/core/src/main/res/drawable/material_button_background.xml b/core/core-main/src/main/res/drawable/material_button_background.xml similarity index 100% rename from core/src/main/res/drawable/material_button_background.xml rename to core/core-main/src/main/res/drawable/material_button_background.xml diff --git a/core/src/main/res/drawable/material_button_selected.xml b/core/core-main/src/main/res/drawable/material_button_selected.xml similarity index 100% rename from core/src/main/res/drawable/material_button_selected.xml rename to core/core-main/src/main/res/drawable/material_button_selected.xml diff --git a/core/src/main/res/drawable/pillborder.xml b/core/core-main/src/main/res/drawable/pillborder.xml similarity index 100% rename from core/src/main/res/drawable/pillborder.xml rename to core/core-main/src/main/res/drawable/pillborder.xml diff --git a/core/src/main/res/drawable/splash_icon.png b/core/core-main/src/main/res/drawable/splash_icon.png similarity index 100% rename from core/src/main/res/drawable/splash_icon.png rename to core/core-main/src/main/res/drawable/splash_icon.png diff --git a/core/src/main/res/layout/close.xml b/core/core-main/src/main/res/layout/close.xml similarity index 100% rename from core/src/main/res/layout/close.xml rename to core/core-main/src/main/res/layout/close.xml diff --git a/core/src/main/res/layout/datetime.xml b/core/core-main/src/main/res/layout/datetime.xml similarity index 100% rename from core/src/main/res/layout/datetime.xml rename to core/core-main/src/main/res/layout/datetime.xml diff --git a/core/src/main/res/layout/dialog_alert_custom_title.xml b/core/core-main/src/main/res/layout/dialog_alert_custom_title.xml similarity index 100% rename from core/src/main/res/layout/dialog_alert_custom_title.xml rename to core/core-main/src/main/res/layout/dialog_alert_custom_title.xml diff --git a/core/src/main/res/layout/dialog_bolusprogress.xml b/core/core-main/src/main/res/layout/dialog_bolusprogress.xml similarity index 100% rename from core/src/main/res/layout/dialog_bolusprogress.xml rename to core/core-main/src/main/res/layout/dialog_bolusprogress.xml diff --git a/core/src/main/res/layout/dialog_error.xml b/core/core-main/src/main/res/layout/dialog_error.xml similarity index 100% rename from core/src/main/res/layout/dialog_error.xml rename to core/core-main/src/main/res/layout/dialog_error.xml diff --git a/core/src/main/res/layout/dialog_profileviewer.xml b/core/core-main/src/main/res/layout/dialog_profileviewer.xml similarity index 100% rename from core/src/main/res/layout/dialog_profileviewer.xml rename to core/core-main/src/main/res/layout/dialog_profileviewer.xml diff --git a/core/src/main/res/layout/maintenance_import_list_activity.xml b/core/core-main/src/main/res/layout/maintenance_import_list_activity.xml similarity index 100% rename from core/src/main/res/layout/maintenance_import_list_activity.xml rename to core/core-main/src/main/res/layout/maintenance_import_list_activity.xml diff --git a/core/src/main/res/layout/maintenance_import_list_item.xml b/core/core-main/src/main/res/layout/maintenance_import_list_item.xml similarity index 100% rename from core/src/main/res/layout/maintenance_import_list_item.xml rename to core/core-main/src/main/res/layout/maintenance_import_list_item.xml diff --git a/core/src/main/res/layout/notes.xml b/core/core-main/src/main/res/layout/notes.xml similarity index 100% rename from core/src/main/res/layout/notes.xml rename to core/core-main/src/main/res/layout/notes.xml diff --git a/core/src/main/res/layout/number_picker_layout.xml b/core/core-main/src/main/res/layout/number_picker_layout.xml similarity index 100% rename from core/src/main/res/layout/number_picker_layout.xml rename to core/core-main/src/main/res/layout/number_picker_layout.xml diff --git a/core/src/main/res/layout/number_picker_layout_vertical.xml b/core/core-main/src/main/res/layout/number_picker_layout_vertical.xml similarity index 100% rename from core/src/main/res/layout/number_picker_layout_vertical.xml rename to core/core-main/src/main/res/layout/number_picker_layout_vertical.xml diff --git a/core/src/main/res/layout/okcancel.xml b/core/core-main/src/main/res/layout/okcancel.xml similarity index 100% rename from core/src/main/res/layout/okcancel.xml rename to core/core-main/src/main/res/layout/okcancel.xml diff --git a/core/src/main/res/layout/passwordprompt.xml b/core/core-main/src/main/res/layout/passwordprompt.xml similarity index 100% rename from core/src/main/res/layout/passwordprompt.xml rename to core/core-main/src/main/res/layout/passwordprompt.xml diff --git a/core/src/main/res/layout/spinner_centered.xml b/core/core-main/src/main/res/layout/spinner_centered.xml similarity index 100% rename from core/src/main/res/layout/spinner_centered.xml rename to core/core-main/src/main/res/layout/spinner_centered.xml diff --git a/core/src/main/res/layout/toast.xml b/core/core-main/src/main/res/layout/toast.xml similarity index 100% rename from core/src/main/res/layout/toast.xml rename to core/core-main/src/main/res/layout/toast.xml diff --git a/core/src/main/res/menu/menu_actions.xml b/core/core-main/src/main/res/menu/menu_actions.xml similarity index 96% rename from core/src/main/res/menu/menu_actions.xml rename to core/core-main/src/main/res/menu/menu_actions.xml index 798c6a5da2..05dc8da163 100644 --- a/core/src/main/res/menu/menu_actions.xml +++ b/core/core-main/src/main/res/menu/menu_actions.xml @@ -1,19 +1,19 @@ - - - - - - - + + + + + + + diff --git a/core/src/main/res/menu/menu_delete_selection.xml b/core/core-main/src/main/res/menu/menu_delete_selection.xml similarity index 100% rename from core/src/main/res/menu/menu_delete_selection.xml rename to core/core-main/src/main/res/menu/menu_delete_selection.xml diff --git a/core/src/main/res/raw/alarm.mp3 b/core/core-main/src/main/res/raw/alarm.mp3 similarity index 100% rename from core/src/main/res/raw/alarm.mp3 rename to core/core-main/src/main/res/raw/alarm.mp3 diff --git a/core/src/main/res/raw/boluserror.mp3 b/core/core-main/src/main/res/raw/boluserror.mp3 similarity index 100% rename from core/src/main/res/raw/boluserror.mp3 rename to core/core-main/src/main/res/raw/boluserror.mp3 diff --git a/core/src/main/res/raw/error.mp3 b/core/core-main/src/main/res/raw/error.mp3 similarity index 100% rename from core/src/main/res/raw/error.mp3 rename to core/core-main/src/main/res/raw/error.mp3 diff --git a/core/src/main/res/values-af-rZA/protection.xml b/core/core-main/src/main/res/values-af-rZA/protection.xml similarity index 100% rename from core/src/main/res/values-af-rZA/protection.xml rename to core/core-main/src/main/res/values-af-rZA/protection.xml diff --git a/core/src/main/res/values-af-rZA/strings.xml b/core/core-main/src/main/res/values-af-rZA/strings.xml similarity index 100% rename from core/src/main/res/values-af-rZA/strings.xml rename to core/core-main/src/main/res/values-af-rZA/strings.xml diff --git a/core/src/main/res/values-af-rZA/validator.xml b/core/core-main/src/main/res/values-af-rZA/validator.xml similarity index 100% rename from core/src/main/res/values-af-rZA/validator.xml rename to core/core-main/src/main/res/values-af-rZA/validator.xml diff --git a/core/src/main/res/values-ar-rSA/protection.xml b/core/core-main/src/main/res/values-ar-rSA/protection.xml similarity index 100% rename from core/src/main/res/values-ar-rSA/protection.xml rename to core/core-main/src/main/res/values-ar-rSA/protection.xml diff --git a/core/src/main/res/values-ar-rSA/strings.xml b/core/core-main/src/main/res/values-ar-rSA/strings.xml similarity index 100% rename from core/src/main/res/values-ar-rSA/strings.xml rename to core/core-main/src/main/res/values-ar-rSA/strings.xml diff --git a/core/src/main/res/values-bg-rBG/protection.xml b/core/core-main/src/main/res/values-bg-rBG/protection.xml similarity index 100% rename from core/src/main/res/values-bg-rBG/protection.xml rename to core/core-main/src/main/res/values-bg-rBG/protection.xml diff --git a/core/src/main/res/values-bg-rBG/strings.xml b/core/core-main/src/main/res/values-bg-rBG/strings.xml similarity index 100% rename from core/src/main/res/values-bg-rBG/strings.xml rename to core/core-main/src/main/res/values-bg-rBG/strings.xml diff --git a/core/src/main/res/values-bg-rBG/validator.xml b/core/core-main/src/main/res/values-bg-rBG/validator.xml similarity index 100% rename from core/src/main/res/values-bg-rBG/validator.xml rename to core/core-main/src/main/res/values-bg-rBG/validator.xml diff --git a/core/src/main/res/values-ca-rES/strings.xml b/core/core-main/src/main/res/values-ca-rES/strings.xml similarity index 100% rename from core/src/main/res/values-ca-rES/strings.xml rename to core/core-main/src/main/res/values-ca-rES/strings.xml diff --git a/core/src/main/res/values-ca-rES/validator.xml b/core/core-main/src/main/res/values-ca-rES/validator.xml similarity index 100% rename from core/src/main/res/values-ca-rES/validator.xml rename to core/core-main/src/main/res/values-ca-rES/validator.xml diff --git a/core/src/main/res/values-cs-rCZ/protection.xml b/core/core-main/src/main/res/values-cs-rCZ/protection.xml similarity index 100% rename from core/src/main/res/values-cs-rCZ/protection.xml rename to core/core-main/src/main/res/values-cs-rCZ/protection.xml diff --git a/core/src/main/res/values-cs-rCZ/strings.xml b/core/core-main/src/main/res/values-cs-rCZ/strings.xml similarity index 100% rename from core/src/main/res/values-cs-rCZ/strings.xml rename to core/core-main/src/main/res/values-cs-rCZ/strings.xml diff --git a/core/src/main/res/values-cs-rCZ/validator.xml b/core/core-main/src/main/res/values-cs-rCZ/validator.xml similarity index 100% rename from core/src/main/res/values-cs-rCZ/validator.xml rename to core/core-main/src/main/res/values-cs-rCZ/validator.xml diff --git a/core/src/main/res/values-cy-rGB/protection.xml b/core/core-main/src/main/res/values-cy-rGB/protection.xml similarity index 100% rename from core/src/main/res/values-cy-rGB/protection.xml rename to core/core-main/src/main/res/values-cy-rGB/protection.xml diff --git a/core/src/main/res/values-cy-rGB/strings.xml b/core/core-main/src/main/res/values-cy-rGB/strings.xml similarity index 100% rename from core/src/main/res/values-cy-rGB/strings.xml rename to core/core-main/src/main/res/values-cy-rGB/strings.xml diff --git a/core/src/main/res/values-da-rDK/strings.xml b/core/core-main/src/main/res/values-da-rDK/strings.xml similarity index 100% rename from core/src/main/res/values-da-rDK/strings.xml rename to core/core-main/src/main/res/values-da-rDK/strings.xml diff --git a/core/src/main/res/values-da-rDK/validator.xml b/core/core-main/src/main/res/values-da-rDK/validator.xml similarity index 100% rename from core/src/main/res/values-da-rDK/validator.xml rename to core/core-main/src/main/res/values-da-rDK/validator.xml diff --git a/core/src/main/res/values-de-rDE/protection.xml b/core/core-main/src/main/res/values-de-rDE/protection.xml similarity index 100% rename from core/src/main/res/values-de-rDE/protection.xml rename to core/core-main/src/main/res/values-de-rDE/protection.xml diff --git a/core/src/main/res/values-de-rDE/strings.xml b/core/core-main/src/main/res/values-de-rDE/strings.xml similarity index 100% rename from core/src/main/res/values-de-rDE/strings.xml rename to core/core-main/src/main/res/values-de-rDE/strings.xml diff --git a/core/src/main/res/values-de-rDE/validator.xml b/core/core-main/src/main/res/values-de-rDE/validator.xml similarity index 100% rename from core/src/main/res/values-de-rDE/validator.xml rename to core/core-main/src/main/res/values-de-rDE/validator.xml diff --git a/core/src/main/res/values-el-rGR/protection.xml b/core/core-main/src/main/res/values-el-rGR/protection.xml similarity index 100% rename from core/src/main/res/values-el-rGR/protection.xml rename to core/core-main/src/main/res/values-el-rGR/protection.xml diff --git a/core/src/main/res/values-el-rGR/strings.xml b/core/core-main/src/main/res/values-el-rGR/strings.xml similarity index 100% rename from core/src/main/res/values-el-rGR/strings.xml rename to core/core-main/src/main/res/values-el-rGR/strings.xml diff --git a/core/src/main/res/values-el-rGR/validator.xml b/core/core-main/src/main/res/values-el-rGR/validator.xml similarity index 100% rename from core/src/main/res/values-el-rGR/validator.xml rename to core/core-main/src/main/res/values-el-rGR/validator.xml diff --git a/core/src/main/res/values-es-rES/protection.xml b/core/core-main/src/main/res/values-es-rES/protection.xml similarity index 100% rename from core/src/main/res/values-es-rES/protection.xml rename to core/core-main/src/main/res/values-es-rES/protection.xml diff --git a/core/src/main/res/values-es-rES/strings.xml b/core/core-main/src/main/res/values-es-rES/strings.xml similarity index 100% rename from core/src/main/res/values-es-rES/strings.xml rename to core/core-main/src/main/res/values-es-rES/strings.xml diff --git a/core/src/main/res/values-es-rES/validator.xml b/core/core-main/src/main/res/values-es-rES/validator.xml similarity index 100% rename from core/src/main/res/values-es-rES/validator.xml rename to core/core-main/src/main/res/values-es-rES/validator.xml diff --git a/core/src/main/res/values-fi-rFI/protection.xml b/core/core-main/src/main/res/values-fi-rFI/protection.xml similarity index 100% rename from core/src/main/res/values-fi-rFI/protection.xml rename to core/core-main/src/main/res/values-fi-rFI/protection.xml diff --git a/core/src/main/res/values-fi-rFI/strings.xml b/core/core-main/src/main/res/values-fi-rFI/strings.xml similarity index 100% rename from core/src/main/res/values-fi-rFI/strings.xml rename to core/core-main/src/main/res/values-fi-rFI/strings.xml diff --git a/core/src/main/res/values-fr-rFR/protection.xml b/core/core-main/src/main/res/values-fr-rFR/protection.xml similarity index 100% rename from core/src/main/res/values-fr-rFR/protection.xml rename to core/core-main/src/main/res/values-fr-rFR/protection.xml diff --git a/core/src/main/res/values-fr-rFR/strings.xml b/core/core-main/src/main/res/values-fr-rFR/strings.xml similarity index 100% rename from core/src/main/res/values-fr-rFR/strings.xml rename to core/core-main/src/main/res/values-fr-rFR/strings.xml diff --git a/core/src/main/res/values-fr-rFR/validator.xml b/core/core-main/src/main/res/values-fr-rFR/validator.xml similarity index 100% rename from core/src/main/res/values-fr-rFR/validator.xml rename to core/core-main/src/main/res/values-fr-rFR/validator.xml diff --git a/core/src/main/res/values-ga-rIE/protection.xml b/core/core-main/src/main/res/values-ga-rIE/protection.xml similarity index 100% rename from core/src/main/res/values-ga-rIE/protection.xml rename to core/core-main/src/main/res/values-ga-rIE/protection.xml diff --git a/core/src/main/res/values-ga-rIE/strings.xml b/core/core-main/src/main/res/values-ga-rIE/strings.xml similarity index 100% rename from core/src/main/res/values-ga-rIE/strings.xml rename to core/core-main/src/main/res/values-ga-rIE/strings.xml diff --git a/core/src/main/res/values-ga-rIE/validator.xml b/core/core-main/src/main/res/values-ga-rIE/validator.xml similarity index 100% rename from core/src/main/res/values-ga-rIE/validator.xml rename to core/core-main/src/main/res/values-ga-rIE/validator.xml diff --git a/core/src/main/res/values-hr-rHR/protection.xml b/core/core-main/src/main/res/values-hr-rHR/protection.xml similarity index 100% rename from core/src/main/res/values-hr-rHR/protection.xml rename to core/core-main/src/main/res/values-hr-rHR/protection.xml diff --git a/core/src/main/res/values-hr-rHR/strings.xml b/core/core-main/src/main/res/values-hr-rHR/strings.xml similarity index 100% rename from core/src/main/res/values-hr-rHR/strings.xml rename to core/core-main/src/main/res/values-hr-rHR/strings.xml diff --git a/core/src/main/res/values-hr-rHR/validator.xml b/core/core-main/src/main/res/values-hr-rHR/validator.xml similarity index 100% rename from core/src/main/res/values-hr-rHR/validator.xml rename to core/core-main/src/main/res/values-hr-rHR/validator.xml diff --git a/core/src/main/res/values-hu-rHU/strings.xml b/core/core-main/src/main/res/values-hu-rHU/strings.xml similarity index 100% rename from core/src/main/res/values-hu-rHU/strings.xml rename to core/core-main/src/main/res/values-hu-rHU/strings.xml diff --git a/core/src/main/res/values-hu-rHU/validator.xml b/core/core-main/src/main/res/values-hu-rHU/validator.xml similarity index 100% rename from core/src/main/res/values-hu-rHU/validator.xml rename to core/core-main/src/main/res/values-hu-rHU/validator.xml diff --git a/core/src/main/res/values-it-rIT/protection.xml b/core/core-main/src/main/res/values-it-rIT/protection.xml similarity index 100% rename from core/src/main/res/values-it-rIT/protection.xml rename to core/core-main/src/main/res/values-it-rIT/protection.xml diff --git a/core/src/main/res/values-it-rIT/strings.xml b/core/core-main/src/main/res/values-it-rIT/strings.xml similarity index 100% rename from core/src/main/res/values-it-rIT/strings.xml rename to core/core-main/src/main/res/values-it-rIT/strings.xml diff --git a/core/src/main/res/values-it-rIT/validator.xml b/core/core-main/src/main/res/values-it-rIT/validator.xml similarity index 100% rename from core/src/main/res/values-it-rIT/validator.xml rename to core/core-main/src/main/res/values-it-rIT/validator.xml diff --git a/core/src/main/res/values-iw-rIL/protection.xml b/core/core-main/src/main/res/values-iw-rIL/protection.xml similarity index 100% rename from core/src/main/res/values-iw-rIL/protection.xml rename to core/core-main/src/main/res/values-iw-rIL/protection.xml diff --git a/core/src/main/res/values-iw-rIL/strings.xml b/core/core-main/src/main/res/values-iw-rIL/strings.xml similarity index 100% rename from core/src/main/res/values-iw-rIL/strings.xml rename to core/core-main/src/main/res/values-iw-rIL/strings.xml diff --git a/core/src/main/res/values-iw-rIL/validator.xml b/core/core-main/src/main/res/values-iw-rIL/validator.xml similarity index 100% rename from core/src/main/res/values-iw-rIL/validator.xml rename to core/core-main/src/main/res/values-iw-rIL/validator.xml diff --git a/core/src/main/res/values-ja-rJP/protection.xml b/core/core-main/src/main/res/values-ja-rJP/protection.xml similarity index 100% rename from core/src/main/res/values-ja-rJP/protection.xml rename to core/core-main/src/main/res/values-ja-rJP/protection.xml diff --git a/core/src/main/res/values-ja-rJP/strings.xml b/core/core-main/src/main/res/values-ja-rJP/strings.xml similarity index 100% rename from core/src/main/res/values-ja-rJP/strings.xml rename to core/core-main/src/main/res/values-ja-rJP/strings.xml diff --git a/core/src/main/res/values-ko-rKR/protection.xml b/core/core-main/src/main/res/values-ko-rKR/protection.xml similarity index 100% rename from core/src/main/res/values-ko-rKR/protection.xml rename to core/core-main/src/main/res/values-ko-rKR/protection.xml diff --git a/core/src/main/res/values-ko-rKR/strings.xml b/core/core-main/src/main/res/values-ko-rKR/strings.xml similarity index 100% rename from core/src/main/res/values-ko-rKR/strings.xml rename to core/core-main/src/main/res/values-ko-rKR/strings.xml diff --git a/core/src/main/res/values-ko-rKR/validator.xml b/core/core-main/src/main/res/values-ko-rKR/validator.xml similarity index 100% rename from core/src/main/res/values-ko-rKR/validator.xml rename to core/core-main/src/main/res/values-ko-rKR/validator.xml diff --git a/core/src/main/res/values-lt-rLT/protection.xml b/core/core-main/src/main/res/values-lt-rLT/protection.xml similarity index 100% rename from core/src/main/res/values-lt-rLT/protection.xml rename to core/core-main/src/main/res/values-lt-rLT/protection.xml diff --git a/core/src/main/res/values-lt-rLT/strings.xml b/core/core-main/src/main/res/values-lt-rLT/strings.xml similarity index 100% rename from core/src/main/res/values-lt-rLT/strings.xml rename to core/core-main/src/main/res/values-lt-rLT/strings.xml diff --git a/core/src/main/res/values-lt-rLT/validator.xml b/core/core-main/src/main/res/values-lt-rLT/validator.xml similarity index 100% rename from core/src/main/res/values-lt-rLT/validator.xml rename to core/core-main/src/main/res/values-lt-rLT/validator.xml diff --git a/core/src/main/res/values-night/colors.xml b/core/core-main/src/main/res/values-night/colors.xml similarity index 100% rename from core/src/main/res/values-night/colors.xml rename to core/core-main/src/main/res/values-night/colors.xml diff --git a/core/src/main/res/values-night/styles.xml b/core/core-main/src/main/res/values-night/styles.xml similarity index 100% rename from core/src/main/res/values-night/styles.xml rename to core/core-main/src/main/res/values-night/styles.xml diff --git a/core/src/main/res/values-nl-rNL/protection.xml b/core/core-main/src/main/res/values-nl-rNL/protection.xml similarity index 100% rename from core/src/main/res/values-nl-rNL/protection.xml rename to core/core-main/src/main/res/values-nl-rNL/protection.xml diff --git a/core/src/main/res/values-nl-rNL/strings.xml b/core/core-main/src/main/res/values-nl-rNL/strings.xml similarity index 100% rename from core/src/main/res/values-nl-rNL/strings.xml rename to core/core-main/src/main/res/values-nl-rNL/strings.xml diff --git a/core/src/main/res/values-nl-rNL/validator.xml b/core/core-main/src/main/res/values-nl-rNL/validator.xml similarity index 100% rename from core/src/main/res/values-nl-rNL/validator.xml rename to core/core-main/src/main/res/values-nl-rNL/validator.xml diff --git a/core/src/main/res/values-no-rNO/strings.xml b/core/core-main/src/main/res/values-no-rNO/strings.xml similarity index 100% rename from core/src/main/res/values-no-rNO/strings.xml rename to core/core-main/src/main/res/values-no-rNO/strings.xml diff --git a/core/src/main/res/values-no-rNO/validator.xml b/core/core-main/src/main/res/values-no-rNO/validator.xml similarity index 100% rename from core/src/main/res/values-no-rNO/validator.xml rename to core/core-main/src/main/res/values-no-rNO/validator.xml diff --git a/core/src/main/res/values-pl-rPL/protection.xml b/core/core-main/src/main/res/values-pl-rPL/protection.xml similarity index 100% rename from core/src/main/res/values-pl-rPL/protection.xml rename to core/core-main/src/main/res/values-pl-rPL/protection.xml diff --git a/core/src/main/res/values-pl-rPL/strings.xml b/core/core-main/src/main/res/values-pl-rPL/strings.xml similarity index 100% rename from core/src/main/res/values-pl-rPL/strings.xml rename to core/core-main/src/main/res/values-pl-rPL/strings.xml diff --git a/core/src/main/res/values-pl-rPL/validator.xml b/core/core-main/src/main/res/values-pl-rPL/validator.xml similarity index 100% rename from core/src/main/res/values-pl-rPL/validator.xml rename to core/core-main/src/main/res/values-pl-rPL/validator.xml diff --git a/core/src/main/res/values-pt-rBR/protection.xml b/core/core-main/src/main/res/values-pt-rBR/protection.xml similarity index 100% rename from core/src/main/res/values-pt-rBR/protection.xml rename to core/core-main/src/main/res/values-pt-rBR/protection.xml diff --git a/core/src/main/res/values-pt-rBR/strings.xml b/core/core-main/src/main/res/values-pt-rBR/strings.xml similarity index 100% rename from core/src/main/res/values-pt-rBR/strings.xml rename to core/core-main/src/main/res/values-pt-rBR/strings.xml diff --git a/core/src/main/res/values-pt-rBR/validator.xml b/core/core-main/src/main/res/values-pt-rBR/validator.xml similarity index 100% rename from core/src/main/res/values-pt-rBR/validator.xml rename to core/core-main/src/main/res/values-pt-rBR/validator.xml diff --git a/core/src/main/res/values-pt-rPT/protection.xml b/core/core-main/src/main/res/values-pt-rPT/protection.xml similarity index 100% rename from core/src/main/res/values-pt-rPT/protection.xml rename to core/core-main/src/main/res/values-pt-rPT/protection.xml diff --git a/core/src/main/res/values-pt-rPT/strings.xml b/core/core-main/src/main/res/values-pt-rPT/strings.xml similarity index 100% rename from core/src/main/res/values-pt-rPT/strings.xml rename to core/core-main/src/main/res/values-pt-rPT/strings.xml diff --git a/core/src/main/res/values-pt-rPT/validator.xml b/core/core-main/src/main/res/values-pt-rPT/validator.xml similarity index 100% rename from core/src/main/res/values-pt-rPT/validator.xml rename to core/core-main/src/main/res/values-pt-rPT/validator.xml diff --git a/core/src/main/res/values-ro-rRO/protection.xml b/core/core-main/src/main/res/values-ro-rRO/protection.xml similarity index 100% rename from core/src/main/res/values-ro-rRO/protection.xml rename to core/core-main/src/main/res/values-ro-rRO/protection.xml diff --git a/core/src/main/res/values-ro-rRO/strings.xml b/core/core-main/src/main/res/values-ro-rRO/strings.xml similarity index 100% rename from core/src/main/res/values-ro-rRO/strings.xml rename to core/core-main/src/main/res/values-ro-rRO/strings.xml diff --git a/core/src/main/res/values-ro-rRO/validator.xml b/core/core-main/src/main/res/values-ro-rRO/validator.xml similarity index 100% rename from core/src/main/res/values-ro-rRO/validator.xml rename to core/core-main/src/main/res/values-ro-rRO/validator.xml diff --git a/core/src/main/res/values-ru-rRU/protection.xml b/core/core-main/src/main/res/values-ru-rRU/protection.xml similarity index 100% rename from core/src/main/res/values-ru-rRU/protection.xml rename to core/core-main/src/main/res/values-ru-rRU/protection.xml diff --git a/core/src/main/res/values-ru-rRU/strings.xml b/core/core-main/src/main/res/values-ru-rRU/strings.xml similarity index 100% rename from core/src/main/res/values-ru-rRU/strings.xml rename to core/core-main/src/main/res/values-ru-rRU/strings.xml diff --git a/core/src/main/res/values-ru-rRU/validator.xml b/core/core-main/src/main/res/values-ru-rRU/validator.xml similarity index 100% rename from core/src/main/res/values-ru-rRU/validator.xml rename to core/core-main/src/main/res/values-ru-rRU/validator.xml diff --git a/core/src/main/res/values-sk-rSK/protection.xml b/core/core-main/src/main/res/values-sk-rSK/protection.xml similarity index 100% rename from core/src/main/res/values-sk-rSK/protection.xml rename to core/core-main/src/main/res/values-sk-rSK/protection.xml diff --git a/core/src/main/res/values-sk-rSK/strings.xml b/core/core-main/src/main/res/values-sk-rSK/strings.xml similarity index 100% rename from core/src/main/res/values-sk-rSK/strings.xml rename to core/core-main/src/main/res/values-sk-rSK/strings.xml diff --git a/core/src/main/res/values-sk-rSK/validator.xml b/core/core-main/src/main/res/values-sk-rSK/validator.xml similarity index 100% rename from core/src/main/res/values-sk-rSK/validator.xml rename to core/core-main/src/main/res/values-sk-rSK/validator.xml diff --git a/core/src/main/res/values-sl-rSI/protection.xml b/core/core-main/src/main/res/values-sl-rSI/protection.xml similarity index 100% rename from core/src/main/res/values-sl-rSI/protection.xml rename to core/core-main/src/main/res/values-sl-rSI/protection.xml diff --git a/core/src/main/res/values-sl-rSI/strings.xml b/core/core-main/src/main/res/values-sl-rSI/strings.xml similarity index 100% rename from core/src/main/res/values-sl-rSI/strings.xml rename to core/core-main/src/main/res/values-sl-rSI/strings.xml diff --git a/core/src/main/res/values-sl-rSI/validator.xml b/core/core-main/src/main/res/values-sl-rSI/validator.xml similarity index 100% rename from core/src/main/res/values-sl-rSI/validator.xml rename to core/core-main/src/main/res/values-sl-rSI/validator.xml diff --git a/core/src/main/res/values-sr-rCS/strings.xml b/core/core-main/src/main/res/values-sr-rCS/strings.xml similarity index 100% rename from core/src/main/res/values-sr-rCS/strings.xml rename to core/core-main/src/main/res/values-sr-rCS/strings.xml diff --git a/core/src/main/res/values-sr-rCS/validator.xml b/core/core-main/src/main/res/values-sr-rCS/validator.xml similarity index 100% rename from core/src/main/res/values-sr-rCS/validator.xml rename to core/core-main/src/main/res/values-sr-rCS/validator.xml diff --git a/core/src/main/res/values-sv-rSE/protection.xml b/core/core-main/src/main/res/values-sv-rSE/protection.xml similarity index 100% rename from core/src/main/res/values-sv-rSE/protection.xml rename to core/core-main/src/main/res/values-sv-rSE/protection.xml diff --git a/core/src/main/res/values-sv-rSE/strings.xml b/core/core-main/src/main/res/values-sv-rSE/strings.xml similarity index 100% rename from core/src/main/res/values-sv-rSE/strings.xml rename to core/core-main/src/main/res/values-sv-rSE/strings.xml diff --git a/core/src/main/res/values-sv-rSE/validator.xml b/core/core-main/src/main/res/values-sv-rSE/validator.xml similarity index 100% rename from core/src/main/res/values-sv-rSE/validator.xml rename to core/core-main/src/main/res/values-sv-rSE/validator.xml diff --git a/core/src/main/res/values-ta-rIN/strings.xml b/core/core-main/src/main/res/values-ta-rIN/strings.xml similarity index 100% rename from core/src/main/res/values-ta-rIN/strings.xml rename to core/core-main/src/main/res/values-ta-rIN/strings.xml diff --git a/core/src/main/res/values-ta-rIN/validator.xml b/core/core-main/src/main/res/values-ta-rIN/validator.xml similarity index 100% rename from core/src/main/res/values-ta-rIN/validator.xml rename to core/core-main/src/main/res/values-ta-rIN/validator.xml diff --git a/core/src/main/res/values-tr-rTR/protection.xml b/core/core-main/src/main/res/values-tr-rTR/protection.xml similarity index 100% rename from core/src/main/res/values-tr-rTR/protection.xml rename to core/core-main/src/main/res/values-tr-rTR/protection.xml diff --git a/core/src/main/res/values-tr-rTR/strings.xml b/core/core-main/src/main/res/values-tr-rTR/strings.xml similarity index 100% rename from core/src/main/res/values-tr-rTR/strings.xml rename to core/core-main/src/main/res/values-tr-rTR/strings.xml diff --git a/core/src/main/res/values-tr-rTR/validator.xml b/core/core-main/src/main/res/values-tr-rTR/validator.xml similarity index 100% rename from core/src/main/res/values-tr-rTR/validator.xml rename to core/core-main/src/main/res/values-tr-rTR/validator.xml diff --git a/core/src/main/res/values-zh-rCN/protection.xml b/core/core-main/src/main/res/values-zh-rCN/protection.xml similarity index 100% rename from core/src/main/res/values-zh-rCN/protection.xml rename to core/core-main/src/main/res/values-zh-rCN/protection.xml diff --git a/core/src/main/res/values-zh-rCN/strings.xml b/core/core-main/src/main/res/values-zh-rCN/strings.xml similarity index 100% rename from core/src/main/res/values-zh-rCN/strings.xml rename to core/core-main/src/main/res/values-zh-rCN/strings.xml diff --git a/core/src/main/res/values-zh-rCN/validator.xml b/core/core-main/src/main/res/values-zh-rCN/validator.xml similarity index 100% rename from core/src/main/res/values-zh-rCN/validator.xml rename to core/core-main/src/main/res/values-zh-rCN/validator.xml diff --git a/core/src/main/res/values/attrs.xml b/core/core-main/src/main/res/values/attrs.xml similarity index 100% rename from core/src/main/res/values/attrs.xml rename to core/core-main/src/main/res/values/attrs.xml diff --git a/core/src/main/res/values/colors.xml b/core/core-main/src/main/res/values/colors.xml similarity index 100% rename from core/src/main/res/values/colors.xml rename to core/core-main/src/main/res/values/colors.xml diff --git a/core/src/main/res/values/dimens.xml b/core/core-main/src/main/res/values/dimens.xml similarity index 100% rename from core/src/main/res/values/dimens.xml rename to core/core-main/src/main/res/values/dimens.xml diff --git a/core/src/main/res/values/fet_attrs.xml b/core/core-main/src/main/res/values/fet_attrs.xml similarity index 100% rename from core/src/main/res/values/fet_attrs.xml rename to core/core-main/src/main/res/values/fet_attrs.xml diff --git a/core/core-main/src/main/res/values/protection.xml b/core/core-main/src/main/res/values/protection.xml new file mode 100644 index 0000000000..9f6c0e279b --- /dev/null +++ b/core/core-main/src/main/res/values/protection.xml @@ -0,0 +1,49 @@ + + + Authentication required + Place your finger on the fingerprint reader to verify your identity + Settings protection + Application protection + Bolus protection + Master password + Settings password + Settings PIN + Application password + Application PIN + Bolus password + Bolus PIN + Password and PIN retention [s] + Time before the password or PIN should be entered + Unlock settings + Biometric + Custom password + Custom PIN + No protection + Protection + Master password is not set!\n\nPlease set your Master password in Preferences (%1$s → %2$s) + Unsecure Fallback + In order to be effective, biometric protection needs a master password set for fallback.\n\nPlease set a master password! + + Password set! + PIN set! + Password not set + PIN not set + Password not changed + PIN not changed + Password cleared! + PIN cleared! + Enter password here + Enter PIN here + + master_password + settings_password + settings_pin + application_password + application_pin + bolus_password + bolus_pin + settings_protection + application_protection + bolus_protection + protection_timeout + diff --git a/core/core-main/src/main/res/values/strings.xml b/core/core-main/src/main/res/values/strings.xml new file mode 100644 index 0000000000..441a580345 --- /dev/null +++ b/core/core-main/src/main/res/values/strings.xml @@ -0,0 +1,673 @@ + + + + enable_fabric2 + units + loop_openmode_min_change + absorption_maxtime + openapsama_min_5m_carbimpact + absorption_cutoff + danar_useextended + eatingsoon_duration + eatingsoon_target + activity_duration + activity_target + hypo_duration + hypo_target + low_mark + high_mark + ns_create_announcements_from_errors + bt_watchdog + bt_watchdog_last + pump_unreachable_threshold + missed_bg_readings_threshold + gradually_increase_notification_volume + virtualpump_type + QuickWizard + wearcontrol + units_mgdl + show_notes_entry_dialogs + autosens_max + autosens_min + treatmentssafety_maxcarbs + bgsource_upload_settings + localalert_settings + wear_settings + configbuilder_general_settings + maintenance_settings + smscommunicator_settings + openapssmb_settings + treatmentssafety_settings + loop_settings + virtualpump_settings + pump_settings + tidepool_settings + absorption_settings + overview_settings + openapsma_settings + medtronic_settings + danars_settings + nsclientinternal_settings + insight_local_settings + data_choices_settings + dexcom_settings + active_pump_change_timestamp + active_pump_type + active_pump_serial_number + age + child + teenage + adult + resistantadult + pregnant + app_expiration + use_dark_mode + insulin_oref_peak + autotune_auto + categorize_uam_as_basal + autotune_tune_insulin_curve + autotune_default_tune_days + autotune_circadian_ic_isf + autotune_additional_log + key_autotune_plugin + key_autotune_last_run + dexcomg5_xdripupload + nsclient_localbroadcasts + use_bolus_reminder + carbs_button_increment_1 + carbs_button_increment_2 + carbs_button_increment_3 + enable_pump_unreachable_alert + enable_missed_bg_readings + enable_carbs_required_alert_local + smscommunicator_report_pump_unreachable + rangetodisplay + local_profile_last_change + ns_receive_profile_store + nsclientinternal_url + nsclientinternal_api_secret + ns_receive_insulin + ns_receive_carbs + ns_receive_therapy_events + ns_receive_profile_switch + ns_receive_offline_event + ns_receive_temp_target + + + Refresh + Error + Save + Not set + Failed to update basal profile + Basal profile in pump updated + Invalid input data + Tempbasal delivery error + Going to deliver %1$.2f U + Waiting for pump + Connecting for %1$d s + Delivering %1$.2f U + Handshaking + Connecting + Connected + Disconnected + Disconnecting + Waiting for disconnection + AAPS started + %1$.1f U + %1$.2f U + %1$+.2f U + %1$d g + %1$.0f / %2$d U + %1$.2f U/h + %1$.2f h + %1$d mins + Pump is busy + Pump connection error + Allowed limit reached + Objectives + Close + Please wait… + Mute + Reload + STOP PRESSED + Stop + Carbs + Invalid profile! + NO PROFILE SET + ]]> + Date + Units + DIA + IC + ISF + Basal + Target + Duration of Insulin Action + Insulin to Carb ratio + Insulin Sensitivity Factor + Basal rate + Blood Glucose Target + Initializing ... + Serial number + Battery + Last connection + Last bolus + Daily units + Base basal rate + Temp basal + Extended bolus + Reservoir + Pump history + View profile + Event type + mg/dl + mmol/l + g + % + Advanced Settings + Bluetooth + BT Watchdog + Switches off the phone\'s bluetooth for one second if no connection to the pump is possible. This may help on some phones where the bluetooth stack freezes. + Pairing + Yes + No + LOOP DISABLED BY CONSTRAINTS + Bolus %1$.2f U delivered successfully + OK + No valid basal rate read from pump + Limiting max IOB to %1$.1f U because of %2$s + unsafe usage + Pump unreachable + Extended bolus + Pump time updated + Exit + Remove record + Loop is disabled + Alarm + Disable loop + Enable loop + Resume loop + Suspend loop + Duration [min] + Notification + No profile loaded from NS yet + exists + not exists + Glucose + IOB + COB + Name: + Time + WiFi SSID + Loading … + Event time + Notes + Remove + Add new + Add new above + Data is coming from different pump. Change pump driver to reset pump state. + BG + Calibration + Run alarm in %1$d min + Bolus reported an error. Manually check real delivered amount + Bolus reminder + Duration + g + Pump suspended + Not configured + Loop suspended + Trend arrow + Auto sens + n/a + req + falling rapidly + falling + falling slowly + stable + rising slowly + rising + rising rapidly + none + unknown + high + in range + low + Average + TIR + TDD Total + ]]> + REMOVE + Activate profile + reset + ProfileSwitch missing. Please do a profile switch or press \"Activate Profile\" in the LocalProfile. + Profile + Select for removal + Are you sure you want to remove %1$d items + Treatment + Create new profile from this profile? + Wizard Settings + 15min trend + 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 + pump limit + Limiting max percent rate to %1$d%% because of %2$s + it must be positive value + Limiting bolus to %1$.1f U because of %2$s + Pump not initialized, profile not set! + + + Confirmation + Message + OK + Cancel + DISMISS + + + Bluetooth Low Energy not supported. + Bluetooth Low Energy not supported or device not paired. + Bluetooth not enabled. + Location Is Not Enabled + For Bluetooth discovery to work on newer devices, location must be enabled. AAPS does not track your location and it can be disabled after pairing is successful. + + + Wrong password + Wrong PIN + Passwords don\'t match + PINs don\'t match + + + Basal values not aligned to hours: %1$s + Basal value replaced by minimum supported value: %1$s + Basal value replaced by maximum supported value: %1$s + /U + U/h + g/U + + + Start profile %1$d%% for %2$d min + + + Cancel temp basal + Let temp basal run + Rate + Duration + Reason + No change requested + + + Invalid profile: %1$s + + + %1$d min + + + Careportal + BG Check + Manual BG or Calibration + Announcement + Note + Question + Exercise + Announcement : %1$s + Note : %1$s + Question : %1$s + Exercise : %1$s + Pump Site Change + CGM Sensor Insert + CGM Sensor Start + CGM Sensor Stop + D.A.D. Alert + Insulin Cartridge Change + Profile switch + Snack Bolus + Meal Bolus + Correction Bolus + Combo Bolus + Temp Basal Start + Temp Basal End + Carbs correction + OpenAPS Offline + Pump Battery Change + Temporary target + Temporary target value + Temporary target cancel + Bolus wizard + Finger + Sensor + Manual + unknown + Eating Soon + Hypo + Activity + Wear + Automation + Custom + Pump + Loop + NS + Record + Reading pump history + Pump icon + + + Connection timed out + + + Enacted + Comment + Success + Percent + Absolute + Insulin + U + Waiting for result + SMB + + + %1$d g additional carbs required within %2$d minutes + + + Stats + Cumulative TDD + Exponentially Weighted TDD + Basal + Bolus + TDD + Ratio + # Days + Weight + Possibly inaccurate if using boluses for priming/filling! + Old data, please press "RELOAD" + Total Base Basal + TBB * 2 + + + Time detection + %1$dh %2$dm + + Mute for 5 minutes + + + exported %1$s ago + exported at %1$s + exported less than hour ago + in directory: %1$s + Select file to import + Preferences were created with different variant of AAPS (%1$s) while you have: %2$s.\n\nSome settings may be missing or invalid - after importing please check and update your preferences. + Preferences were created on a different device. It is OK if you are importing from older/different phone, but make sure imported preferences are correct! + You are using the outdated legacy format from old versions of AAPS, which is not secure! Only use it as a last resort, if you do not have an export in current, JSON format. + Imported preferences are already %1$s days old! Maybe you have more up-to-date preferences or you choose the wrong file? Remember to export preferences regularly! + Invalid date-time format! + Preferences from different minor version of application. It is OK if you are importing after upgrade, but check after import if preferences are still correct! + Preferences from different major version of application. Major versions differ significantly and may have incompatible preferences! Make sure after import that preferences are still correct! + Settings file tampered + Settings file is secure + Using not secure, unencrypted settings format + JSON format error, missing required field (format, content, metadata or security) + Decryption error, the given password cannot decrypt the file + File checksum (hash) missing, cannot verify the authenticity of settings! + File was modified after export! + Decryption error, parsing preferences failed! + Decryption error, the provided password is invalid or settings file was modified! It may happen that the imported file was exported with a different Master password. + Missing encryption configuration, settings format is invalid! + Unsupported or not specified encryption algorithm! + + + last_time_this_version_detected + last_versionchecker_warning + last_expired_version_checker_warning + last_versionchecker_plugin_waring + last_revoked_certs_check + We have detected that you are running an invalid version. Loop disabled! + Version %1$s available + Version %1$s expire on %2$s + + + Please reboot your phone or restart AAPS from the System Settings \notherwise Android APS will not have logging (important to track and verify that the algorithms are working correctly)! + + + BOLUS + BOLUS CALCULATOR + BOLUS ADVISOR + EXTENDED BOLUS + SUPERBOLUS TBR + CARBS + EXTENDED CARBS + TEMP BASAL + TEMP TARGET + NEW PROFILE + CLONE PROFILE + STORE PROFILE + PROFILE SWITCH + PROFILE SWITCH CLONED + CLOSED LOOP MODE + LGS LOOP MODE + OPEN LOOP MODE + LOOP DISABLED + LOOP ENABLED + RECONNECT + DISCONNECT + RESUME + SUSPEND + HW PUMP ALLOWED + CLEAR PAIRING KEYS + ACCEPTS TEMP BASAL + CANCEL TEMP BASAL + CANCEL BOLUS + CANCEL EXTENDED BOLUS + CANCEL TEMP TARGET + CAREPORTAL + SITE CHANGE + RESERVOIR CHANGE + CALIBRATION + PRIME BOLUS + TREATMENT + CAREPORTAL NS REFRESH + PROFILE SWITCH NS REFRESH + TREATMENTS NS REFRESH + TEMP TARGET NS REFRESH + AUTOMATION REMOVED + BG REMOVED + CAREPORTAL REMOVED + BOLUS REMOVED + CARBS REMOVED + TEMP BASAL REMOVED + EXTENDED BOLUS REMOVED + FOOD + FOOD REMOVED + PROFILE REMOVED + PROFILE SWITCH REMOVED + RESTART EVENTS REMOVED + TREATMENT REMOVED + TEMP TARGET REMOVED + NS PAUSED + NS RESUME + NS QUEUE CLEARED + NS SETTINGS COPIED + ERROR DIALOG OK + ERROR DIALOG MUTE + ERROR DIALOG MUTE 5MIN + OBJECTIVE STARTED + OBJECTIVE UNSTARTED + OBJECTIVES SKIPPED + STAT RESET + DELETE LOGS + DELETE FUTURE TREATMENTS + Delete future treatments + EXPORT SETTINGS + IMPORT SETTINGS + RESET DATABASES + CLEANUP DATABASES + EXPORT DATABASES + IMPORT DATABASES + OTP EXPORT + OTP RESET + STOP SMS + EXPORT USER ENTRIES + START AAPS + EXIT AAPS + PLUGIN ENABLED + PLUGIN DISABLED + UNKNOWN + String + Source + UTC Offset + Action + Timestamp + No Unit + Export User Entries to Excel (csv) + "%1$s;%2$s;%3$s;%4$s;%5$s;%6$s;%7$s;%8$s;%9$s;%10$s;%11$s;%12$s;%13$s;%14$s;%15$s;%16$s;%17$s" + LOOP CHANGED + LOOP REMOVED + OTHER + + + Profile low target + Profile high target + Temporary target bottom value + Temporary target top value + Temporary target value + Profile DIA value + Profile sensitivity value + Maximal profile basal value + Current basal value + Profile carbs ratio value + %1$.2f limited to %2$.2f + »%1$s« is out of hard limits + »%1$s« %2$.2f is out of hard limits + Basal value + AAPSClient version doesn\'t match AAPS version. Please update. + + + BOLUS %1$.2f U + CARBS %1$d g + EXTENDED BOLUS %1$.2f U %2$d min + LOAD EVENTS + LOAD HISTORY %1$d + LOAD TDDs + SET PROFILE + SET USER SETTINGS + SMB BOLUS %1$.2f U + START PUMP + STOP PUMP + TEMP BASAL %1$.2f U/h %2$d min + TEMP BASAL %1$d%% %2$d min + INSIGHT SET TBR OVER NOTIFICATION + READSTATUS %1$s + KeepAlive. Status outdated. + KeepAlive. Basal outdated. + SMS + Clicked connect to pump + Pump driver changed. + Pump driver change. + Device changed + Clicked refresh + Scheduled Status Refresh + Unconfirmed command + Requested by user + User request + Bolus OK + Pump paired + Insight Refresh Button + decrement %1$s by %2$s + increment %1$s by %2$s + %1$.0f%% + Basal + Basal % + %1$d selected + Sort + Remove Items + Sort Items + Remove Selected Items + file + user + + + Autotune + Help for potential adjustments of profile (ISF, carb ratio, and basal rates) + AT + Autotune settings + Automation Switch Profile + If enabled, Autotune will automatically update and switch to input profile after calculation from an automation rule. + Categorize UAM as basal + Enable only if you have reliably entered all carbs eaten, with this option sudden rises seen by Autotune will be used to recommend changes to the basal rate. + Tune insulin curve + Enable only if you use free peak. This option will tune peak and DIA durations + Number of days of data + Apply average result in circadian IC/ISF + Autotune will not tune circadian variations, this option only apply the average tuning of IC and ISF to your circadian input profile + Include more log information for debugging + Switch on only if requested by dev to send more log information to help debugging Autotune plugin + Default number of days of data to be processed by Autotune (up to 30) + Tuned + Profile : + Tune days : + Last run : + Warning : + Select profile to tune + Selected profile has %1$d IC values. Autotune will use %2$.2f g/U + Selected profile has %1$d ISF values. Autotune will use %2$.1f %3$s/U + Error in input data, try to run again autotune or reduce the number of days + Autotune calculation started, please be patient + Check the results carefully before using it! + Partial result day %1$d / %2$d tuned + Result: %1$s + Param + % + Missing + Autotune profile %1$s + Run Autotune + Check input profile + Compare profiles + Copy to local profile + Update input profile + Revert input profile + Create a new local profile from this Autotune Profile? + Update %1$s profile with Autotune Profile? + Revert %1$s profile with Input Profile? + Profile invalid + |Param|Profile|Tuned|%/Miss.\n + +------------------------------------------\n + | %1$4.4s |\t%2$d |\t%3$d |\n + | %1$4.4s |\t%2$3.1f |\t%3$3.1f |\n + | %1$4.4s | %2$3.3f |\t%3$3.3f |\n + |\t%1$02.0f\t| %2$3.3f |%3$3.3f\t| %5$.0f%% / %4$d\n + |\t∑\t|\t%1$3.1f |\t%2$3.1f |\n + Autotune ran without profile switch + Autotune ran and profile automatically switched + Error during last Autotune run + 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 + + + %1$d day + %1$d days + + + %1$d hour + %1$d hours + + + %1$d minute + %1$d minutes + + + diff --git a/core/src/main/res/values/styles.xml b/core/core-main/src/main/res/values/styles.xml similarity index 100% rename from core/src/main/res/values/styles.xml rename to core/core-main/src/main/res/values/styles.xml diff --git a/core/core-main/src/main/res/values/validator.xml b/core/core-main/src/main/res/values/validator.xml new file mode 100644 index 0000000000..4de9c5fab1 --- /dev/null +++ b/core/core-main/src/main/res/values/validator.xml @@ -0,0 +1,30 @@ + + + Only numeric digits are allowed. + Only numeric digits within the range %1$s - %2$s are allowed. + This field cannot contain any special character + Only standard letters are allowed + The field must not be empty + Email address not valid + Credit card number is not valid + Phone number not valid + Domain name not valid + IP Address not valid + Web Url is not valid + Not a valid first or last name. + Not a valid full name. + Format not valid + Must be 4 digit number + Must be 6 digit number + Must be 12 characters of ABCDEF0123456789 + Must be 8 characters of ABCDEF0123456789 + Must be 4 characters of ABCDEF0123456789 + Not a minimum length + Pin should be 3 to 6 digits, not same or in series + + ^\\d{4} + ^[A-F0-9]{12}$ + ^[A-F0-9]{8}$ + ^[A-F0-9]{4}$ + + \ No newline at end of file diff --git a/core/src/test/java/info/nightscout/androidaps/TestBase.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBase.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/TestBase.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/TestBase.kt diff --git a/core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt diff --git a/core/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt diff --git a/core/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/data/IobTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/data/IobTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/data/IobTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt similarity index 99% rename from core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt index 9a37dfbe8e..4fd5150895 100644 --- a/core/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt @@ -4,7 +4,7 @@ import android.content.Context import dagger.android.AndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.GlucoseUnit diff --git a/core/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt similarity index 99% rename from core/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt index b759a68d3c..ae1da713f6 100644 --- a/core/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.data import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.interfaces.data.PumpEnactResult import org.json.JSONObject import org.junit.Assert diff --git a/core/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/plugins/contraints/versionChecker/VersionCheckerUtilsKtTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/SingleStringStorage.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/SingleStringStorage.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/SingleStringStorage.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/SingleStringStorage.kt diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/pump/common/utils/DateTimeUtilUTest.java b/core/core-main/src/test/java/info/nightscout/androidaps/pump/common/utils/DateTimeUtilUTest.java similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/pump/common/utils/DateTimeUtilUTest.java rename to core/core-main/src/test/java/info/nightscout/androidaps/pump/common/utils/DateTimeUtilUTest.java diff --git a/core/src/test/java/info/nightscout/androidaps/utils/CryptoUtilTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/CryptoUtilTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/utils/CryptoUtilTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/CryptoUtilTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt similarity index 98% rename from core/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt index 16b0d92740..584236da62 100644 --- a/core/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/utils/DateUtilTest.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils import android.content.Context import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/core/src/test/java/info/nightscout/androidaps/utils/DecimalFormatterTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/DecimalFormatterTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/utils/DecimalFormatterTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/DecimalFormatterTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/utils/JsonHelperTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/JsonHelperTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/utils/JsonHelperTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/JsonHelperTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/utils/MidnightTimeTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/MidnightTimeTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/utils/MidnightTimeTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/MidnightTimeTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/utils/RoundTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/RoundTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/utils/RoundTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/RoundTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/utils/StringUtilsTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/StringUtilsTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/utils/StringUtilsTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/StringUtilsTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/utils/TTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/TTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/utils/TTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/TTest.kt diff --git a/core/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiserTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiserTest.kt similarity index 100% rename from core/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiserTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiserTest.kt diff --git a/core/test_dependencies.gradle b/core/core-main/test_dependencies.gradle similarity index 100% rename from core/test_dependencies.gradle rename to core/core-main/test_dependencies.gradle diff --git a/core/src/main/res/values/protection.xml b/core/src/main/res/values/protection.xml index 9f6c0e279b..045e125f3d 100644 --- a/core/src/main/res/values/protection.xml +++ b/core/src/main/res/values/protection.xml @@ -1,49 +1,3 @@ - Authentication required - Place your finger on the fingerprint reader to verify your identity - Settings protection - Application protection - Bolus protection - Master password - Settings password - Settings PIN - Application password - Application PIN - Bolus password - Bolus PIN - Password and PIN retention [s] - Time before the password or PIN should be entered - Unlock settings - Biometric - Custom password - Custom PIN - No protection - Protection - Master password is not set!\n\nPlease set your Master password in Preferences (%1$s → %2$s) - Unsecure Fallback - In order to be effective, biometric protection needs a master password set for fallback.\n\nPlease set a master password! - - Password set! - PIN set! - Password not set - PIN not set - Password not changed - PIN not changed - Password cleared! - PIN cleared! - Enter password here - Enter PIN here - - master_password - settings_password - settings_pin - application_password - application_pin - bolus_password - bolus_pin - settings_protection - application_protection - bolus_protection - protection_timeout diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 441a580345..045e125f3d 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -1,673 +1,3 @@ - - enable_fabric2 - units - loop_openmode_min_change - absorption_maxtime - openapsama_min_5m_carbimpact - absorption_cutoff - danar_useextended - eatingsoon_duration - eatingsoon_target - activity_duration - activity_target - hypo_duration - hypo_target - low_mark - high_mark - ns_create_announcements_from_errors - bt_watchdog - bt_watchdog_last - pump_unreachable_threshold - missed_bg_readings_threshold - gradually_increase_notification_volume - virtualpump_type - QuickWizard - wearcontrol - units_mgdl - show_notes_entry_dialogs - autosens_max - autosens_min - treatmentssafety_maxcarbs - bgsource_upload_settings - localalert_settings - wear_settings - configbuilder_general_settings - maintenance_settings - smscommunicator_settings - openapssmb_settings - treatmentssafety_settings - loop_settings - virtualpump_settings - pump_settings - tidepool_settings - absorption_settings - overview_settings - openapsma_settings - medtronic_settings - danars_settings - nsclientinternal_settings - insight_local_settings - data_choices_settings - dexcom_settings - active_pump_change_timestamp - active_pump_type - active_pump_serial_number - age - child - teenage - adult - resistantadult - pregnant - app_expiration - use_dark_mode - insulin_oref_peak - autotune_auto - categorize_uam_as_basal - autotune_tune_insulin_curve - autotune_default_tune_days - autotune_circadian_ic_isf - autotune_additional_log - key_autotune_plugin - key_autotune_last_run - dexcomg5_xdripupload - nsclient_localbroadcasts - use_bolus_reminder - carbs_button_increment_1 - carbs_button_increment_2 - carbs_button_increment_3 - enable_pump_unreachable_alert - enable_missed_bg_readings - enable_carbs_required_alert_local - smscommunicator_report_pump_unreachable - rangetodisplay - local_profile_last_change - ns_receive_profile_store - nsclientinternal_url - nsclientinternal_api_secret - ns_receive_insulin - ns_receive_carbs - ns_receive_therapy_events - ns_receive_profile_switch - ns_receive_offline_event - ns_receive_temp_target - - - Refresh - Error - Save - Not set - Failed to update basal profile - Basal profile in pump updated - Invalid input data - Tempbasal delivery error - Going to deliver %1$.2f U - Waiting for pump - Connecting for %1$d s - Delivering %1$.2f U - Handshaking - Connecting - Connected - Disconnected - Disconnecting - Waiting for disconnection - AAPS started - %1$.1f U - %1$.2f U - %1$+.2f U - %1$d g - %1$.0f / %2$d U - %1$.2f U/h - %1$.2f h - %1$d mins - Pump is busy - Pump connection error - Allowed limit reached - Objectives - Close - Please wait… - Mute - Reload - STOP PRESSED - Stop - Carbs - Invalid profile! - NO PROFILE SET - ]]> - Date - Units - DIA - IC - ISF - Basal - Target - Duration of Insulin Action - Insulin to Carb ratio - Insulin Sensitivity Factor - Basal rate - Blood Glucose Target - Initializing ... - Serial number - Battery - Last connection - Last bolus - Daily units - Base basal rate - Temp basal - Extended bolus - Reservoir - Pump history - View profile - Event type - mg/dl - mmol/l - g - % - Advanced Settings - Bluetooth - BT Watchdog - Switches off the phone\'s bluetooth for one second if no connection to the pump is possible. This may help on some phones where the bluetooth stack freezes. - Pairing - Yes - No - LOOP DISABLED BY CONSTRAINTS - Bolus %1$.2f U delivered successfully - OK - No valid basal rate read from pump - Limiting max IOB to %1$.1f U because of %2$s - unsafe usage - Pump unreachable - Extended bolus - Pump time updated - Exit - Remove record - Loop is disabled - Alarm - Disable loop - Enable loop - Resume loop - Suspend loop - Duration [min] - Notification - No profile loaded from NS yet - exists - not exists - Glucose - IOB - COB - Name: - Time - WiFi SSID - Loading … - Event time - Notes - Remove - Add new - Add new above - Data is coming from different pump. Change pump driver to reset pump state. - BG - Calibration - Run alarm in %1$d min - Bolus reported an error. Manually check real delivered amount - Bolus reminder - Duration - g - Pump suspended - Not configured - Loop suspended - Trend arrow - Auto sens - n/a - req - falling rapidly - falling - falling slowly - stable - rising slowly - rising - rising rapidly - none - unknown - high - in range - low - Average - TIR - TDD Total - ]]> - REMOVE - Activate profile - reset - ProfileSwitch missing. Please do a profile switch or press \"Activate Profile\" in the LocalProfile. - Profile - Select for removal - Are you sure you want to remove %1$d items - Treatment - Create new profile from this profile? - Wizard Settings - 15min trend - 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 - pump limit - Limiting max percent rate to %1$d%% because of %2$s - it must be positive value - Limiting bolus to %1$.1f U because of %2$s - Pump not initialized, profile not set! - - - Confirmation - Message - OK - Cancel - DISMISS - - - Bluetooth Low Energy not supported. - Bluetooth Low Energy not supported or device not paired. - Bluetooth not enabled. - Location Is Not Enabled - For Bluetooth discovery to work on newer devices, location must be enabled. AAPS does not track your location and it can be disabled after pairing is successful. - - - Wrong password - Wrong PIN - Passwords don\'t match - PINs don\'t match - - - Basal values not aligned to hours: %1$s - Basal value replaced by minimum supported value: %1$s - Basal value replaced by maximum supported value: %1$s - /U - U/h - g/U - - - Start profile %1$d%% for %2$d min - - - Cancel temp basal - Let temp basal run - Rate - Duration - Reason - No change requested - - - Invalid profile: %1$s - - - %1$d min - - - Careportal - BG Check - Manual BG or Calibration - Announcement - Note - Question - Exercise - Announcement : %1$s - Note : %1$s - Question : %1$s - Exercise : %1$s - Pump Site Change - CGM Sensor Insert - CGM Sensor Start - CGM Sensor Stop - D.A.D. Alert - Insulin Cartridge Change - Profile switch - Snack Bolus - Meal Bolus - Correction Bolus - Combo Bolus - Temp Basal Start - Temp Basal End - Carbs correction - OpenAPS Offline - Pump Battery Change - Temporary target - Temporary target value - Temporary target cancel - Bolus wizard - Finger - Sensor - Manual - unknown - Eating Soon - Hypo - Activity - Wear - Automation - Custom - Pump - Loop - NS - Record - Reading pump history - Pump icon - - - Connection timed out - - - Enacted - Comment - Success - Percent - Absolute - Insulin - U - Waiting for result - SMB - - - %1$d g additional carbs required within %2$d minutes - - - Stats - Cumulative TDD - Exponentially Weighted TDD - Basal - Bolus - TDD - Ratio - # Days - Weight - Possibly inaccurate if using boluses for priming/filling! - Old data, please press "RELOAD" - Total Base Basal - TBB * 2 - - - Time detection - %1$dh %2$dm - - Mute for 5 minutes - - - exported %1$s ago - exported at %1$s - exported less than hour ago - in directory: %1$s - Select file to import - Preferences were created with different variant of AAPS (%1$s) while you have: %2$s.\n\nSome settings may be missing or invalid - after importing please check and update your preferences. - Preferences were created on a different device. It is OK if you are importing from older/different phone, but make sure imported preferences are correct! - You are using the outdated legacy format from old versions of AAPS, which is not secure! Only use it as a last resort, if you do not have an export in current, JSON format. - Imported preferences are already %1$s days old! Maybe you have more up-to-date preferences or you choose the wrong file? Remember to export preferences regularly! - Invalid date-time format! - Preferences from different minor version of application. It is OK if you are importing after upgrade, but check after import if preferences are still correct! - Preferences from different major version of application. Major versions differ significantly and may have incompatible preferences! Make sure after import that preferences are still correct! - Settings file tampered - Settings file is secure - Using not secure, unencrypted settings format - JSON format error, missing required field (format, content, metadata or security) - Decryption error, the given password cannot decrypt the file - File checksum (hash) missing, cannot verify the authenticity of settings! - File was modified after export! - Decryption error, parsing preferences failed! - Decryption error, the provided password is invalid or settings file was modified! It may happen that the imported file was exported with a different Master password. - Missing encryption configuration, settings format is invalid! - Unsupported or not specified encryption algorithm! - - - last_time_this_version_detected - last_versionchecker_warning - last_expired_version_checker_warning - last_versionchecker_plugin_waring - last_revoked_certs_check - We have detected that you are running an invalid version. Loop disabled! - Version %1$s available - Version %1$s expire on %2$s - - - Please reboot your phone or restart AAPS from the System Settings \notherwise Android APS will not have logging (important to track and verify that the algorithms are working correctly)! - - - BOLUS - BOLUS CALCULATOR - BOLUS ADVISOR - EXTENDED BOLUS - SUPERBOLUS TBR - CARBS - EXTENDED CARBS - TEMP BASAL - TEMP TARGET - NEW PROFILE - CLONE PROFILE - STORE PROFILE - PROFILE SWITCH - PROFILE SWITCH CLONED - CLOSED LOOP MODE - LGS LOOP MODE - OPEN LOOP MODE - LOOP DISABLED - LOOP ENABLED - RECONNECT - DISCONNECT - RESUME - SUSPEND - HW PUMP ALLOWED - CLEAR PAIRING KEYS - ACCEPTS TEMP BASAL - CANCEL TEMP BASAL - CANCEL BOLUS - CANCEL EXTENDED BOLUS - CANCEL TEMP TARGET - CAREPORTAL - SITE CHANGE - RESERVOIR CHANGE - CALIBRATION - PRIME BOLUS - TREATMENT - CAREPORTAL NS REFRESH - PROFILE SWITCH NS REFRESH - TREATMENTS NS REFRESH - TEMP TARGET NS REFRESH - AUTOMATION REMOVED - BG REMOVED - CAREPORTAL REMOVED - BOLUS REMOVED - CARBS REMOVED - TEMP BASAL REMOVED - EXTENDED BOLUS REMOVED - FOOD - FOOD REMOVED - PROFILE REMOVED - PROFILE SWITCH REMOVED - RESTART EVENTS REMOVED - TREATMENT REMOVED - TEMP TARGET REMOVED - NS PAUSED - NS RESUME - NS QUEUE CLEARED - NS SETTINGS COPIED - ERROR DIALOG OK - ERROR DIALOG MUTE - ERROR DIALOG MUTE 5MIN - OBJECTIVE STARTED - OBJECTIVE UNSTARTED - OBJECTIVES SKIPPED - STAT RESET - DELETE LOGS - DELETE FUTURE TREATMENTS - Delete future treatments - EXPORT SETTINGS - IMPORT SETTINGS - RESET DATABASES - CLEANUP DATABASES - EXPORT DATABASES - IMPORT DATABASES - OTP EXPORT - OTP RESET - STOP SMS - EXPORT USER ENTRIES - START AAPS - EXIT AAPS - PLUGIN ENABLED - PLUGIN DISABLED - UNKNOWN - String - Source - UTC Offset - Action - Timestamp - No Unit - Export User Entries to Excel (csv) - "%1$s;%2$s;%3$s;%4$s;%5$s;%6$s;%7$s;%8$s;%9$s;%10$s;%11$s;%12$s;%13$s;%14$s;%15$s;%16$s;%17$s" - LOOP CHANGED - LOOP REMOVED - OTHER - - - Profile low target - Profile high target - Temporary target bottom value - Temporary target top value - Temporary target value - Profile DIA value - Profile sensitivity value - Maximal profile basal value - Current basal value - Profile carbs ratio value - %1$.2f limited to %2$.2f - »%1$s« is out of hard limits - »%1$s« %2$.2f is out of hard limits - Basal value - AAPSClient version doesn\'t match AAPS version. Please update. - - - BOLUS %1$.2f U - CARBS %1$d g - EXTENDED BOLUS %1$.2f U %2$d min - LOAD EVENTS - LOAD HISTORY %1$d - LOAD TDDs - SET PROFILE - SET USER SETTINGS - SMB BOLUS %1$.2f U - START PUMP - STOP PUMP - TEMP BASAL %1$.2f U/h %2$d min - TEMP BASAL %1$d%% %2$d min - INSIGHT SET TBR OVER NOTIFICATION - READSTATUS %1$s - KeepAlive. Status outdated. - KeepAlive. Basal outdated. - SMS - Clicked connect to pump - Pump driver changed. - Pump driver change. - Device changed - Clicked refresh - Scheduled Status Refresh - Unconfirmed command - Requested by user - User request - Bolus OK - Pump paired - Insight Refresh Button - decrement %1$s by %2$s - increment %1$s by %2$s - %1$.0f%% - Basal - Basal % - %1$d selected - Sort - Remove Items - Sort Items - Remove Selected Items - file - user - - - Autotune - Help for potential adjustments of profile (ISF, carb ratio, and basal rates) - AT - Autotune settings - Automation Switch Profile - If enabled, Autotune will automatically update and switch to input profile after calculation from an automation rule. - Categorize UAM as basal - Enable only if you have reliably entered all carbs eaten, with this option sudden rises seen by Autotune will be used to recommend changes to the basal rate. - Tune insulin curve - Enable only if you use free peak. This option will tune peak and DIA durations - Number of days of data - Apply average result in circadian IC/ISF - Autotune will not tune circadian variations, this option only apply the average tuning of IC and ISF to your circadian input profile - Include more log information for debugging - Switch on only if requested by dev to send more log information to help debugging Autotune plugin - Default number of days of data to be processed by Autotune (up to 30) - Tuned - Profile : - Tune days : - Last run : - Warning : - Select profile to tune - Selected profile has %1$d IC values. Autotune will use %2$.2f g/U - Selected profile has %1$d ISF values. Autotune will use %2$.1f %3$s/U - Error in input data, try to run again autotune or reduce the number of days - Autotune calculation started, please be patient - Check the results carefully before using it! - Partial result day %1$d / %2$d tuned - Result: %1$s - Param - % - Missing - Autotune profile %1$s - Run Autotune - Check input profile - Compare profiles - Copy to local profile - Update input profile - Revert input profile - Create a new local profile from this Autotune Profile? - Update %1$s profile with Autotune Profile? - Revert %1$s profile with Input Profile? - Profile invalid - |Param|Profile|Tuned|%/Miss.\n - +------------------------------------------\n - | %1$4.4s |\t%2$d |\t%3$d |\n - | %1$4.4s |\t%2$3.1f |\t%3$3.1f |\n - | %1$4.4s | %2$3.3f |\t%3$3.3f |\n - |\t%1$02.0f\t| %2$3.3f |%3$3.3f\t| %5$.0f%% / %4$d\n - |\t∑\t|\t%1$3.1f |\t%2$3.1f |\n - Autotune ran without profile switch - Autotune ran and profile automatically switched - Error during last Autotune run - 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 - - - %1$d day - %1$d days - - - %1$d hour - %1$d hours - - - %1$d minute - %1$d minutes - - diff --git a/core/src/main/res/values/validator.xml b/core/src/main/res/values/validator.xml index 4de9c5fab1..55344e5192 100644 --- a/core/src/main/res/values/validator.xml +++ b/core/src/main/res/values/validator.xml @@ -1,30 +1,3 @@ - Only numeric digits are allowed. - Only numeric digits within the range %1$s - %2$s are allowed. - This field cannot contain any special character - Only standard letters are allowed - The field must not be empty - Email address not valid - Credit card number is not valid - Phone number not valid - Domain name not valid - IP Address not valid - Web Url is not valid - Not a valid first or last name. - Not a valid full name. - Format not valid - Must be 4 digit number - Must be 6 digit number - Must be 12 characters of ABCDEF0123456789 - Must be 8 characters of ABCDEF0123456789 - Must be 4 characters of ABCDEF0123456789 - Not a minimum length - Pin should be 3 to 6 digits, not same or in series - - ^\\d{4} - ^[A-F0-9]{12}$ - ^[A-F0-9]{8}$ - ^[A-F0-9]{4}$ - \ No newline at end of file diff --git a/database/build.gradle b/database/build.gradle index 82b79ab3f9..3b45869b87 100644 --- a/database/build.gradle +++ b/database/build.gradle @@ -6,8 +6,8 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" android { diff --git a/graphview/build.gradle b/graphview/build.gradle index a7e69d8d3e..a5f62389b7 100644 --- a/graphview/build.gradle +++ b/graphview/build.gradle @@ -4,7 +4,7 @@ plugins { id 'kotlin-kapt' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" android { diff --git a/implementation/build.gradle b/implementation/build.gradle index c7648b67ef..5cc3ef317d 100644 --- a/implementation/build.gradle +++ b/implementation/build.gradle @@ -6,17 +6,17 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.implementation' } dependencies { - implementation project(':core') + implementation project(':core:core-main') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':database') diff --git a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt index 1df309db04..05799ef818 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt @@ -1,6 +1,6 @@ package info.nightscout.implementation -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.shared.interfaces.ResourceHelper diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 403d1469c7..59e55dcaca 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -1,6 +1,6 @@ package info.nightscout.implementation.pump -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper diff --git a/insight/build.gradle b/insight/build.gradle index 55feaf304e..7cf99ebb59 100644 --- a/insight/build.gradle +++ b/insight/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { @@ -27,7 +27,7 @@ android { dependencies { - implementation project(':core') + implementation project(':core:core-main') implementation project(':interfaces') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/interfaces/build.gradle b/interfaces/build.gradle index 59108b8319..3e5bcf62be 100644 --- a/interfaces/build.gradle +++ b/interfaces/build.gradle @@ -8,8 +8,8 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" android { diff --git a/ns-sdk/build.gradle b/ns-sdk/build.gradle index d8c4d43bd3..7156942277 100644 --- a/ns-sdk/build.gradle +++ b/ns-sdk/build.gradle @@ -5,9 +5,9 @@ plugins { id 'kotlinx-serialization' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" android { namespace 'info.nightscout.sdk' diff --git a/openhumans/build.gradle b/openhumans/build.gradle index 797ea3d9d3..5e9a0b01f2 100644 --- a/openhumans/build.gradle +++ b/openhumans/build.gradle @@ -6,18 +6,18 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.androidaps.plugin.general.openhumans' } dependencies { - implementation project(':core') + implementation project(':core:core-main') implementation project(':database') implementation project(':interfaces') implementation project(':app-wear-shared:rx') diff --git a/plugins/build.gradle b/plugins/build.gradle index b14ffeda51..9a6b3b6c7a 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.plugins' } @@ -20,7 +20,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':database') implementation project(':graphview') - implementation project(':core') + implementation project(':core:core-main') implementation project(':interfaces') implementation project(':ns-sdk') diff --git a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt index bb018bda28..54652d33fd 100644 --- a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt +++ b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.configBuilder -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Insulin diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index 6b4e4b6594..326a9bcb8d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.general.autotune.data import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile 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 edb2e4ab77..ce2bf354e8 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 @@ -1,6 +1,6 @@ package info.nightscout.plugins.sync.nsclient.extensions -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.Constants diff --git a/pump/combo/build.gradle b/pump/combo/build.gradle index b89823c385..42fcb70cfe 100644 --- a/pump/combo/build.gradle +++ b/pump/combo/build.gradle @@ -6,18 +6,18 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.androidaps.combo' } dependencies { implementation project(':libraries') - implementation project(':core') + implementation project(':core:core-main') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') diff --git a/pump/dana/build.gradle b/pump/dana/build.gradle index 2b95c5c310..0d2f194186 100644 --- a/pump/dana/build.gradle +++ b/pump/dana/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { @@ -27,7 +27,7 @@ android { dependencies { implementation project(':libraries') - implementation project(':core') + implementation project(':core:core-main') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') diff --git a/pump/danar/build.gradle b/pump/danar/build.gradle index a42d20830f..06808b1162 100644 --- a/pump/danar/build.gradle +++ b/pump/danar/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.androidaps.danar' } @@ -18,7 +18,7 @@ android { dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') - implementation project(':core') + implementation project(':core:core-main') implementation project(':pump:dana') implementation project(':interfaces') } \ No newline at end of file diff --git a/pump/danars/build.gradle b/pump/danars/build.gradle index b2150687f9..5628f1e947 100644 --- a/pump/danars/build.gradle +++ b/pump/danars/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { ndkVersion "21.1.6352462" @@ -31,7 +31,7 @@ android { } dependencies { - implementation project(':core') + implementation project(':core:core-main') implementation project(':pump:dana') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/BLEScanActivity.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/BLEScanActivity.kt index a6cface7dc..96ab578ecc 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/BLEScanActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/BLEScanActivity.kt @@ -66,7 +66,7 @@ class BLEScanActivity : NoSplashAppCompatActivity() { bluetoothAdapter?.safeEnable() startScan() } else { - ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.needconnectpermission)) } } @@ -82,7 +82,7 @@ class BLEScanActivity : NoSplashAppCompatActivity() { } catch (ignore: IllegalStateException) { } // ignore BT not on } else { - ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.needconnectpermission)) } private fun stopScan() = @@ -92,7 +92,7 @@ class BLEScanActivity : NoSplashAppCompatActivity() { } catch (ignore: IllegalStateException) { } // ignore BT not on } else { - ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.needconnectpermission)) } @SuppressLint("MissingPermission") @@ -153,7 +153,7 @@ class BLEScanActivity : NoSplashAppCompatActivity() { item.device.createBond() rxBus.send(EventDanaRSDeviceChange()) } else { - ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.needconnectpermission)) } finish() } diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt index 7800ee4fe8..42ebdf60d6 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt @@ -106,7 +106,7 @@ class BLEComm @Inject internal constructor( if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED ) { - ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.needconnectpermission)) aapsLogger.error(LTag.PUMPBTCOMM, "missing permission: $from") return false } diff --git a/pump/diaconn/build.gradle b/pump/diaconn/build.gradle index bb1b4ad234..e8dfecc216 100644 --- a/pump/diaconn/build.gradle +++ b/pump/diaconn/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { @@ -30,7 +30,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':libraries') implementation project(':interfaces') - implementation project(':core') + implementation project(':core:core-main') api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8BLEScanActivity.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8BLEScanActivity.kt index 1dc392ba5b..8bf851e9c9 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8BLEScanActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8BLEScanActivity.kt @@ -73,7 +73,7 @@ class DiaconnG8BLEScanActivity : NoSplashAppCompatActivity() { startScan() } } else { - ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.needconnectpermission)) } } @@ -112,7 +112,7 @@ class DiaconnG8BLEScanActivity : NoSplashAppCompatActivity() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED ) { - ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.needconnectpermission)) return } if (device == null || device.name == null || device.name == "") { diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt index bdf6762e57..821b72c64a 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt @@ -89,7 +89,7 @@ class BLECommonService @Inject internal constructor( if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED ) { - ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + ToastUtils.errorToast(context, context.getString(info.nightscout.core.main.R.string.needconnectpermission)) aapsLogger.error(LTag.PUMPBTCOMM, "missing permission: $from") return false } diff --git a/pump/eopatch/build.gradle b/pump/eopatch/build.gradle index 5ecc00dce6..dd99534517 100644 --- a/pump/eopatch/build.gradle +++ b/pump/eopatch/build.gradle @@ -6,10 +6,10 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.androidaps.plugins.pump.eopatch' @@ -25,7 +25,7 @@ dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':database') - implementation project(':core') + implementation project(':core:core-main') implementation project(':interfaces') //RxAndroidBle diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index 30055959ab..6c70dd41d8 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -320,7 +320,7 @@ class EopatchPumpPlugin @Inject constructor( patchManager.addBolusToHistory(detailedBolusInfo) return PumpEnactResultImpl(injector).success(true).enacted(true).bolusDelivered(0.0) - .carbsDelivered(detailedBolusInfo.carbs).comment(rh.gs(info.nightscout.androidaps.core.R.string.ok)) + .carbsDelivered(detailedBolusInfo.carbs).comment(rh.gs(info.nightscout.core.main.R.string.ok)) } } @@ -421,7 +421,7 @@ class EopatchPumpPlugin @Inject constructor( .map { PumpEnactResultImpl(injector).success(true).enacted(true) } .onErrorReturnItem( PumpEnactResultImpl(injector).success(false).enacted(false).bolusDelivered(0.0) - .comment(rh.gs(info.nightscout.androidaps.core.R.string.error)) + .comment(rh.gs(info.nightscout.core.main.R.string.error)) ) .blockingGet() } @@ -458,7 +458,7 @@ class EopatchPumpPlugin @Inject constructor( .map { PumpEnactResultImpl(injector).success(true).enacted(true).isTempCancel(true) } .onErrorReturnItem( PumpEnactResultImpl(injector).success(false).enacted(false) - .comment(rh.gs(info.nightscout.androidaps.core.R.string.error)) + .comment(rh.gs(info.nightscout.core.main.R.string.error)) ) .blockingGet() } @@ -479,7 +479,7 @@ class EopatchPumpPlugin @Inject constructor( .map { PumpEnactResultImpl(injector).success(true).enacted(true).isTempCancel(true) } .onErrorReturnItem( PumpEnactResultImpl(injector).success(false).enacted(false) - .comment(rh.gs(info.nightscout.androidaps.core.R.string.error)) + .comment(rh.gs(info.nightscout.core.main.R.string.error)) ) .blockingGet() } else { diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt index 3fa5f1eedc..69f6086c4e 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/AlarmHelperActivity.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui import android.os.Bundle import androidx.appcompat.app.AlertDialog import info.nightscout.androidaps.activities.DialogAppCompatActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode import info.nightscout.androidaps.plugins.pump.eopatch.event.EventDialog import info.nightscout.androidaps.plugins.pump.eopatch.event.EventProgressDialog diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt index 5751066837..294b0eca79 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/DialogHelperActivity.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ui import android.os.Bundle import info.nightscout.androidaps.activities.DialogAppCompatActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.plugins.pump.eopatch.ui.dialogs.ActivationNotCompleteDialog class DialogHelperActivity : DialogAppCompatActivity() { diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt index 4a349c175e..d197239f5c 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/EoBaseActivity.kt @@ -8,7 +8,7 @@ import androidx.databinding.DataBindingUtil import androidx.databinding.ViewDataBinding import androidx.lifecycle.ViewModelProvider import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.plugins.pump.eopatch.dagger.EopatchPluginQualifier import info.nightscout.rx.AapsSchedulers import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt index a70db271dc..d5b824b01a 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/dialogs/AlarmDialog.kt @@ -10,7 +10,7 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmProcess import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmProcess diff --git a/pump/medtronic/build.gradle b/pump/medtronic/build.gradle index ade2787122..7873cba6e7 100644 --- a/pump/medtronic/build.gradle +++ b/pump/medtronic/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.androidaps.plugins.pump.medtronic' } @@ -19,7 +19,7 @@ dependencies { implementation project(':libraries') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') - implementation project(':core') + implementation project(':core:core-main') implementation project(':pump:pump-common') implementation project(':pump:pump-core') implementation project(':pump:rileylink') diff --git a/pump/omnipod-common/build.gradle b/pump/omnipod-common/build.gradle index eb2d92e808..e445bc5d99 100644 --- a/pump/omnipod-common/build.gradle +++ b/pump/omnipod-common/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.androidaps.plugins.pump.omnipod.common' @@ -18,7 +18,7 @@ android { dependencies { implementation project(':libraries') - implementation project(':core') + implementation project(':core:core-main') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') diff --git a/pump/omnipod-dash/build.gradle b/pump/omnipod-dash/build.gradle index c9f3cc718a..0fd002ff78 100644 --- a/pump/omnipod-dash/build.gradle +++ b/pump/omnipod-dash/build.gradle @@ -8,11 +8,11 @@ plugins { id "org.jlleitschuh.gradle.ktlint" // TODO move to `subprojects` section in global build.gradle } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" detekt { // TODO move to `subprojects` section in global build.gradle toolVersion = "1.15.0-RC2" @@ -37,7 +37,7 @@ dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':libraries') - implementation project(':core') + implementation project(':core:core-main') implementation project(':pump:pump-common') implementation project(':pump:omnipod-common') implementation project(':interfaces') diff --git a/pump/omnipod-eros/build.gradle b/pump/omnipod-eros/build.gradle index 46fba25214..9e7f496a67 100644 --- a/pump/omnipod-eros/build.gradle +++ b/pump/omnipod-eros/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { @@ -30,7 +30,7 @@ dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':libraries') - implementation project(':core') + implementation project(':core:core-main') implementation project(':pump:pump-common') implementation project(':pump:pump-core') implementation project(':pump:rileylink') diff --git a/pump/pump-common/build.gradle b/pump/pump-common/build.gradle index 2c974a7c88..a5bdc109f9 100644 --- a/pump/pump-common/build.gradle +++ b/pump/pump-common/build.gradle @@ -6,17 +6,17 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.androidaps.plugins.pump.common' } dependencies { - implementation project(':core') + implementation project(':core:core-main') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') diff --git a/pump/pump-core/build.gradle b/pump/pump-core/build.gradle index eb744c9963..05256720e0 100644 --- a/pump/pump-core/build.gradle +++ b/pump/pump-core/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.pump.core' } diff --git a/pump/rileylink/build.gradle b/pump/rileylink/build.gradle index 5d7e629096..68cd0ebdd4 100644 --- a/pump/rileylink/build.gradle +++ b/pump/rileylink/build.gradle @@ -6,11 +6,11 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.androidaps.plugins.pump.common.hw.rileylink' } @@ -18,7 +18,7 @@ android { dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') - implementation project(':core') + implementation project(':core:core-main') implementation project(':pump:pump-common') implementation project(':pump:pump-core') implementation project(':interfaces') diff --git a/settings.gradle b/settings.gradle index 3ab7a61408..44e623fd1d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,7 @@ include ':app' include ':wear' include ':database' -include ':core' +include ':core:core-main' include ':app-wear-shared:rx' include ':app-wear-shared:shared' include ':app-wear-shared:shared-impl' diff --git a/ui/build.gradle b/ui/build.gradle index f7ca3d31e6..431f59397b 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -6,10 +6,10 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" android { namespace 'info.nightscout.ui' @@ -21,6 +21,6 @@ dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':database') - implementation project(':core') + implementation project(':core:core-main') implementation project(':interfaces') } \ No newline at end of file diff --git a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt index 4acf51ae66..e45d57feea 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt @@ -5,7 +5,7 @@ import android.content.Intent import android.os.Bundle import androidx.annotation.RawRes import info.nightscout.androidaps.activities.DialogAppCompatActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.dialogs.ErrorDialog diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index eef0a09e79..9411291005 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -15,7 +15,7 @@ import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.core.R +import info.nightscout.core.main.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TotalDailyDose import info.nightscout.rx.events.EventDanaRSyncStatus diff --git a/wear/build.gradle b/wear/build.gradle index f6545564b1..2a5e427588 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -19,9 +19,9 @@ plugins { id 'com.hiya.jacoco-android' } -apply from: "${project.rootDir}/core/test_dependencies.gradle" -apply from: "${project.rootDir}/core/android_dependencies.gradle" -apply from: "${project.rootDir}/core/jacoco_global.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" def generateGitBuild = { -> From be4dbc65522275ea148af53080212057c2b6e9a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 12:31:58 +0000 Subject: [PATCH 19/42] chore(deps): bump rxandroid from 3.0.0 to 3.0.1 Bumps [rxandroid](https://github.com/ReactiveX/RxAndroid) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/ReactiveX/RxAndroid/releases) - [Changelog](https://github.com/ReactiveX/RxAndroid/blob/3.x/CHANGES.md) - [Commits](https://github.com/ReactiveX/RxAndroid/compare/3.0.0...3.0.1) --- updated-dependencies: - dependency-name: io.reactivex.rxjava3:rxandroid dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c4af65575f..ace8da77fc 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { kotlin_version = '1.7.20' core_version = '1.9.0' rxjava_version = '3.1.5' - rxandroid_version = '3.0.0' + rxandroid_version = '3.0.1' rxkotlin_version = '3.0.1' room_version = '2.4.3' lifecycle_version = '2.5.1' From 62cdbdc41a1d939b277cbba3313e63d124ec7d09 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 9 Nov 2022 14:48:08 +0100 Subject: [PATCH 20/42] Update Crowdin configuration file --- crowdin.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crowdin.yml b/crowdin.yml index 0be1fc856d..6e8a4d5bb0 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -11,8 +11,9 @@ files: translation: /app/src/main/res/values-%android_code%/protection.xml - source: /core/src/main/res/values/validator.xml translation: /core/src/main/res/values-%android_code%/validator.xml - - source: /core/src/main/res/values/strings.xml - translation: /core/src/main/res/values-%android_code%/strings.xml + - source: /core/core-main/src/main/res/values/strings.xml + translation: /core/core-main/src/main/res/values-%android_code%/strings.xml + translate_attributes: 0 - source: /shared/src/main/res/values/strings.xml translation: /shared/src/main/res/values-%android_code%/strings.xml - source: /pump/combo/src/main/res/values/strings.xml From 1041de39c888fde93a515cf25c40d2c7b7c2e2ce Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 9 Nov 2022 15:56:59 +0100 Subject: [PATCH 21/42] core-fabric module --- app/build.gradle | 1 + .../nightscout/androidaps/MainActivity.kt | 6 +-- .../activities/HistoryBrowseActivity.kt | 12 ++--- .../activities/HistoryBrowserData.kt | 6 +-- .../activities/ProfileHelperActivity.kt | 8 ++-- .../nightscout/androidaps/di/AppModule.kt | 10 ++-- .../androidaps/dialogs/LoopDialog.kt | 26 +++++------ .../androidaps/dialogs/NtpProgressDialog.kt | 4 +- .../androidaps/dialogs/WizardDialog.kt | 20 ++++---- .../androidaps/plugins/aps/OpenAPSFragment.kt | 6 +-- .../plugins/aps/loop/LoopFragment.kt | 8 ++-- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 8 ++-- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 14 +++--- .../configBuilder/ConfigBuilderFragment.kt | 12 ++--- .../configBuilder/ProfileFunctionImpl.kt | 6 +-- .../objectives/ObjectivesFragment.kt | 8 ++-- .../general/actions/ActionsFragment.kt | 18 ++++---- .../dataBroadcaster/DataBroadcastPlugin.kt | 4 +- .../maintenance/MaintenanceFragment.kt | 10 ++-- .../general/overview/OverviewFragment.kt | 10 ++-- .../plugins/general/overview/OverviewMenus.kt | 6 +-- .../general/overview/OverviewPlugin.kt | 6 +-- .../activities/QuickWizardListActivity.kt | 10 ++-- .../persistentNotification/DummyService.kt | 2 +- .../PersistentNotificationPlugin.kt | 16 +++---- .../plugins/general/wear/WearFragment.kt | 2 +- .../plugins/general/wear/WearPlugin.kt | 14 +++--- .../wear/wearintegration/DataHandlerMobile.kt | 8 ++-- .../DataLayerListenerServiceMobile.kt | 6 +-- .../IobCobCalculatorPlugin.kt | 24 +++++----- .../iob/iobCobCalculator/IobCobOref1Worker.kt | 16 +++---- .../iob/iobCobCalculator/IobCobOrefWorker.kt | 16 +++---- .../plugins/source/GlunovoPlugin.kt | 4 +- .../plugins/source/IntelligoPlugin.kt | 4 +- .../androidaps/receivers/KeepAliveWorker.kt | 4 +- .../setupwizard/SetupWizardActivity.kt | 2 +- .../workflow/CalculationWorkflow.kt | 6 +-- .../androidaps/TestBaseWithProfile.kt | 8 ++-- .../plugins/aps/loop/LoopPluginTest.kt | 4 +- automation/build.gradle | 1 + .../automation/AutomationFragment.kt | 14 +++--- .../nightscout/automation/AutomationPlugin.kt | 18 ++++---- .../automation/dialogs/EditEventDialog.kt | 4 +- .../automation/dialogs/EditTriggerDialog.kt | 2 +- .../automation/services/LocationService.kt | 6 +-- .../androidaps/TestBaseWithProfile.kt | 10 ++-- core/core-main/build.gradle | 10 ---- .../nightscout/androidaps/di/CoreModule.kt | 8 ---- .../androidaps/dialogs/BolusProgressDialog.kt | 46 +++++++++---------- core/core-main/src/main/res/values/colors.xml | 5 -- .../core-main/src/main/res/values/strings.xml | 1 - .../androidaps/TestBaseWithProfile.kt | 6 +-- core/fabric/.gitignore | 1 + core/fabric/build.gradle | 34 ++++++++++++++ core/fabric/consumer-rules.pro | 0 core/fabric/proguard-rules.pro | 21 +++++++++ .../src/main/AndroidManifest.xml} | 5 +- .../nightscout/core/fabric}/FabricPrivacy.kt | 3 +- .../nightscout/core/fabric}/InstanceId.kt | 2 +- core/fabric/src/main/res/values/strings.xml | 4 ++ core/src/main/res/values/protection.xml | 3 -- core/src/main/res/values/strings.xml | 3 -- implementation/build.gradle | 3 +- .../implementation/di/ImplementationModule.kt | 12 ++++- .../queue/CommandQueueImplementation.kt | 8 ++-- .../resources/ResourceHelperImpl.kt | 16 +++++-- .../androidaps/TestBaseWithProfile.kt | 6 +-- .../implementation/BolusTimerImplTest.kt | 10 ++-- .../implementation/CarbTimerImplTest.kt | 12 ++--- .../queue/CommandQueueImplementationTest.kt | 16 +++---- insight/build.gradle | 1 + .../pump/insight/LocalInsightFragment.java | 2 +- interfaces/src/main/res/values/colors.xml | 8 ++++ plugins/build.gradle | 3 +- .../bgQualityCheck/BgQualityCheckPlugin.kt | 12 ++--- .../general/autotune/AutotuneFragment.kt | 16 +++---- .../plugins/general/food/FoodFragment.kt | 8 ++-- .../SmsCommunicatorFragment.kt | 6 +-- .../smsCommunicator/SmsCommunicatorPlugin.kt | 14 +++--- .../activities/SmsCommunicatorOtpActivity.kt | 4 +- .../xdripStatusline/StatusLinePlugin.kt | 10 ++-- .../plugins/profile/ProfileFragment.kt | 14 +++--- .../pump/virtual/VirtualPumpFragment.kt | 2 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 9 ++-- .../plugins/source/BGSourceFragment.kt | 4 +- .../plugins/sync/nsShared/NSClientFragment.kt | 8 ++-- .../plugins/sync/nsclient/NSClientPlugin.kt | 8 ++-- .../sync/nsclient/services/NSClientService.kt | 4 +- .../sync/nsclientV3/NSClientV3Plugin.kt | 8 ++-- .../plugins/sync/tidepool/TidepoolFragment.kt | 2 +- .../plugins/sync/tidepool/TidepoolPlugin.kt | 6 +-- .../androidaps/TestBaseWithProfile.kt | 6 +-- .../BgQualityCheckPluginTest.kt | 10 ++-- .../pump/virtual/VirtualPumpPluginUTest.kt | 4 +- pump/combo/build.gradle | 1 + .../plugins/pump/combo/ComboFragment.kt | 10 ++-- .../plugins/pump/combo/ComboPlugin.java | 28 +++++------ pump/dana/build.gradle | 1 + .../androidaps/dana/DanaFragment.kt | 18 ++++---- .../dana/activities/DanaHistoryActivity.kt | 10 ++-- .../activities/DanaUserOptionsActivity.kt | 6 +-- .../androidaps/TestBaseWithProfile.kt | 10 ++-- pump/danar/build.gradle | 1 + .../danaRKorean/DanaRKoreanPlugin.kt | 10 ++-- .../androidaps/danaRv2/DanaRv2Plugin.java | 14 +++--- .../androidaps/danar/DanaRPlugin.java | 12 ++--- .../AbstractDanaRExecutionService.java | 12 ++--- .../androidaps/TestBaseWithProfile.kt | 8 ++-- pump/danars/build.gradle | 1 + .../androidaps/danars/DanaRSPlugin.kt | 28 +++++------ .../danars/activities/EnterPinActivity.kt | 2 +- .../danars/dialogs/PairingProgressDialog.java | 4 +- .../danars/services/DanaRSService.kt | 18 ++++---- .../androidaps/TestBaseWithProfile.kt | 10 ++-- pump/diaconn/build.gradle | 1 + .../androidaps/diaconn/DiaconnG8Fragment.kt | 12 ++--- .../androidaps/diaconn/DiaconnG8Plugin.kt | 32 ++++++------- .../activities/DiaconnG8HistoryActivity.kt | 8 ++-- .../DiaconnG8UserOptionsActivity.kt | 7 ++- .../diaconn/service/DiaconnG8Service.kt | 18 ++++---- pump/eopatch/build.gradle | 1 + .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 30 ++++++------ .../pump/eopatch/alarm/AlarmManager.kt | 10 ++-- pump/medtronic/build.gradle | 1 + .../pump/medtronic/MedtronicFragment.kt | 2 +- .../pump/medtronic/MedtronicPumpPlugin.kt | 26 +++++------ pump/omnipod-dash/build.gradle | 1 + .../omnipod/dash/OmnipodDashPumpPlugin.kt | 34 +++++++------- .../dash/ui/DashPodManagementActivity.kt | 10 ++-- .../dash/ui/OmnipodDashOverviewFragment.kt | 18 ++++---- .../action/DashInsertCannulaViewModel.kt | 10 ++-- pump/omnipod-eros/build.gradle | 1 + .../omnipod/eros/OmnipodErosPumpPlugin.java | 30 ++++++------ .../eros/ui/ErosPodManagementActivity.kt | 12 ++--- .../eros/ui/OmnipodErosOverviewFragment.kt | 16 +++---- pump/pump-common/build.gradle | 1 + .../plugins/pump/common/PumpPluginAbstract.kt | 18 ++++---- settings.gradle | 1 + ui/build.gradle | 1 + .../nightscout/ui/activities/StatsActivity.kt | 2 +- .../ui/activities/SurveyActivity.kt | 5 +- .../ui/activities/TDDStatsActivity.kt | 8 ++-- .../fragments/TreatmentsBolusCarbsFragment.kt | 10 ++-- .../fragments/TreatmentsCareportalFragment.kt | 10 ++-- .../TreatmentsExtendedBolusesFragment.kt | 24 ++++++---- .../TreatmentsProfileSwitchFragment.kt | 10 ++-- .../fragments/TreatmentsTempTargetFragment.kt | 10 ++-- .../TreatmentsTemporaryBasalsFragment.kt | 15 +++--- .../fragments/TreatmentsUserEntryFragment.kt | 16 +++---- .../androidaps/TestBaseWithProfile.kt | 6 +-- 150 files changed, 750 insertions(+), 685 deletions(-) create mode 100644 core/fabric/.gitignore create mode 100644 core/fabric/build.gradle create mode 100644 core/fabric/consumer-rules.pro create mode 100644 core/fabric/proguard-rules.pro rename core/{src/main/res/values/validator.xml => fabric/src/main/AndroidManifest.xml} (61%) rename core/{core-main/src/main/java/info/nightscout/androidaps/utils => fabric/src/main/java/info/nightscout/core/fabric}/FabricPrivacy.kt (98%) rename core/{core-main/src/main/java/info/nightscout/androidaps/utils => fabric/src/main/java/info/nightscout/core/fabric}/InstanceId.kt (86%) create mode 100644 core/fabric/src/main/res/values/strings.xml delete mode 100644 core/src/main/res/values/protection.xml delete mode 100644 core/src/main/res/values/strings.xml rename core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt => implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt (89%) create mode 100644 interfaces/src/main/res/values/colors.xml diff --git a/app/build.gradle b/app/build.gradle index 6c3d114856..aaacccb505 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -186,6 +186,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:shared-impl') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':interfaces') implementation project(':ui') implementation project(':plugins') diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index d7a3b07112..a6ab0792d6 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -41,23 +41,23 @@ import info.nightscout.androidaps.databinding.ActivityMainBinding import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.IconsProvider import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils 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.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.core.fabric.FabricPrivacy import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.IconsProvider +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt index e5e409fbe9..e41cde7d3a 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt @@ -13,25 +13,25 @@ import com.jjoe64.graphview.GraphView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.ActivityHistorybrowseBinding -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.extensions.toVisibilityKeepSpace import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.plugins.general.overview.OverviewMenus import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.workflow.CalculationWorkflow +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventAutosensCalculationFinished import info.nightscout.rx.events.EventCustomCalculationFinished import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.events.EventScale import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.extensions.toVisibilityKeepSpace +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Calendar diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt index da614de8cd..cc2410960c 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt @@ -4,17 +4,17 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin 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.iob.iobCobCalculator.IobCobCalculatorPlugin -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.workflow.CalculationWorkflow +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt index f96c52231b..2069def3d6 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt @@ -15,18 +15,18 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.databinding.ActivityProfilehelperBinding import info.nightscout.androidaps.dialogs.ProfileViewerDialog -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.stats.TddCalculator -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.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventLocalProfileChanged +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.defaultProfile.DefaultProfile import info.nightscout.ui.defaultProfile.DefaultProfileDPV import io.reactivex.rxjava3.core.Single 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 9ee673a0f0..51e139b8e1 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -11,14 +11,10 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.implementations.ActivityNamesImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DataSyncSelector -import info.nightscout.interfaces.IconsProvider -import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.TrendCalculator @@ -33,12 +29,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.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.core.fabric.FabricPrivacy import info.nightscout.implementation.AndroidPermissionImpl import info.nightscout.implementation.BolusTimerImpl import info.nightscout.implementation.CarbTimerImpl @@ -58,8 +54,12 @@ import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.CarbTimer import info.nightscout.interfaces.Config +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.IconsProvider +import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.interfaces.NotificationHolder +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.storage.FileStorage import info.nightscout.interfaces.storage.Storage diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt index af9a28ce5f..ec9e2a8aab 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -21,35 +21,35 @@ import info.nightscout.androidaps.database.transactions.CancelCurrentOfflineEven import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.androidaps.databinding.DialogLoopBinding import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.shared.extensions.runOnUiThread -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesPlugin -import info.nightscout.interfaces.queue.Callback -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.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.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.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/dialogs/NtpProgressDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt index 0c067964ab..675dc279d5 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt @@ -6,15 +6,15 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerDialogFragment +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.main.R import info.nightscout.core.main.databinding.DialogBolusprogressBinding -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventNtpStatus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index 4848fdf97f..4bdbc87c4a 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -18,40 +18,40 @@ import android.widget.CompoundButton import androidx.fragment.app.FragmentManager import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.databinding.DialogWizardBinding import info.nightscout.androidaps.extensions.formatColor -import info.nightscout.shared.extensions.runOnUiThread -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.interfaces.utils.Round import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS import info.nightscout.androidaps.utils.wizard.BolusWizard +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.utils.HtmlHelper +import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAutosensCalculationFinished import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/OpenAPSFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/OpenAPSFragment.kt index 335bb0eca1..c94121a79d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/OpenAPSFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/OpenAPSFragment.kt @@ -16,16 +16,16 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.OpenapsFragmentBinding import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.JSONFormatter +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt index ace1bb1bca..f83e248508 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt @@ -14,18 +14,18 @@ import androidx.lifecycle.Lifecycle import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.databinding.LoopFragmentBinding -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject 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 b92011ad2d..2b7a5ebc0c 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 @@ -31,15 +31,12 @@ import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Loop.LastRun -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui @@ -48,15 +45,18 @@ import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotifi import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.buildDeviceStatus +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.interfaces.queue.Callback import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index cb2dee0959..66ba2dc1ce 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -9,30 +9,30 @@ import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.PluginBase -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.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.OpenAPSFragment import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONException import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt index 6592622cc3..623286d1b9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt @@ -19,20 +19,20 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.activities.SingleFragmentActivity import info.nightscout.androidaps.databinding.ConfigbuilderFragmentBinding -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui +import info.nightscout.androidaps.utils.protection.ProtectionCheck +import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.PREFERENCES +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.protection.ProtectionCheck -import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.PREFERENCES import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRebuildTabs +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImpl.kt index d18e935800..edcaae518e 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 @@ -1,6 +1,5 @@ package info.nightscout.androidaps.plugins.configBuilder -import info.nightscout.core.main.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper @@ -8,15 +7,16 @@ import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.database.transactions.InsertOrUpdateProfileSwitch import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.fromConstant +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.main.R import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt index d178ac41d0..4ecba0e9f4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt @@ -23,23 +23,23 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.databinding.ObjectivesFragmentBinding import info.nightscout.androidaps.databinding.ObjectivesItemBinding import info.nightscout.androidaps.dialogs.NtpProgressDialog -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.activities.ObjectivesExamDialog import info.nightscout.androidaps.plugins.constraints.objectives.events.EventObjectivesUpdateGui import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective.ExamTask import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.setupwizard.events.EventSWUpdate -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.SntpClient import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventNtpStatus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index 9a9f9d9db3..587dce9633 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -24,27 +24,24 @@ import info.nightscout.androidaps.dialogs.TempBasalDialog import info.nightscout.androidaps.dialogs.TempTargetDialog import info.nightscout.androidaps.extensions.toStringMedium import info.nightscout.androidaps.extensions.toStringShort -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.androidaps.plugins.general.overview.StatusLightHandler -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.skins.SkinProvider -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.ui.SingleClickButton import info.nightscout.androidaps.utils.ui.UIRunnable +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.pump.actions.CustomAction +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventCustomActionsChanged @@ -53,7 +50,10 @@ import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.events.EventTherapyEventChange import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import info.nightscout.ui.activities.TDDStatsActivity import info.nightscout.ui.dialogs.CareDialog import io.reactivex.rxjava3.disposables.CompositeDisposable 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 6c92c637f0..0a25f69a2a 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 @@ -11,15 +11,15 @@ 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.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.receivers.Intents import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index a16f2ff3bb..5f63e54276 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -16,27 +16,27 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.insight.database.InsightDatabase import info.nightscout.androidaps.interfaces.DataSyncSelector -import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.DashHistoryDatabase import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryDatabase -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.PREFERENCES +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ImportExportPrefs +import info.nightscout.interfaces.utils.HtmlHelper 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 io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign 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 13a468702b..1f5ea937df 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 @@ -49,12 +49,9 @@ import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.TrendCalculator @@ -68,13 +65,11 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOve import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewSensitivity import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.interfaces.pump.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.skins.SkinProvider import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck @@ -82,9 +77,14 @@ import info.nightscout.androidaps.utils.ui.SingleClickButton import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.automation.AutomationPlugin +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin import info.nightscout.plugins.general.overview.notifications.NotificationStore diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt index e32fef0f32..c19acdccab 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt @@ -12,15 +12,15 @@ import androidx.annotation.StringRes import androidx.appcompat.widget.PopupMenu import com.google.gson.Gson import info.nightscout.androidaps.R +import info.nightscout.androidaps.interfaces.Loop +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.events.EventScale import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton 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 cc9f7f862b..06e1c044bb 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,15 +13,15 @@ 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.Overview -import info.nightscout.interfaces.PluginBase 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.iob.iobCobCalculator.events.EventIobCalculationProgress -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Overview +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.general.overview.notifications.NotificationStore diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt index 9e0a4fdbf6..58f63598c4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt @@ -18,21 +18,21 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.databinding.OverviewQuickwizardlistActivityBinding import info.nightscout.androidaps.databinding.OverviewQuickwizardlistItemBinding -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWizardDialog import info.nightscout.androidaps.plugins.general.overview.events.EventQuickWizardChange import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.androidaps.utils.wizard.QuickWizard +import info.nightscout.androidaps.utils.wizard.QuickWizardEntry +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.dragHelpers.ItemTouchHelperAdapter import info.nightscout.interfaces.dragHelpers.OnStartDragListener import info.nightscout.interfaces.dragHelpers.SimpleItemTouchHelperCallback -import info.nightscout.androidaps.utils.wizard.QuickWizard -import info.nightscout.androidaps.utils.wizard.QuickWizardEntry import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.extensions.toVisibility import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/DummyService.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/DummyService.kt index 69e856b6d0..b125f38770 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/DummyService.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/DummyService.kt @@ -6,8 +6,8 @@ import android.content.Intent import android.os.Binder import android.os.IBinder import dagger.android.DaggerService +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.NotificationHolder -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index e9ef441e86..28933ed660 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -7,30 +7,30 @@ import android.content.Intent import androidx.core.app.NotificationCompat import androidx.core.app.RemoteInput import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.IconsProvider import info.nightscout.androidaps.interfaces.IobCobCalculator +import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.IconsProvider import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.PluginBase 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.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAutosensCalculationFinished import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/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 25b8a9287f..a95cb4f671 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,7 +6,7 @@ import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.databinding.WearFragmentBinding -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt index 1c6f577901..c5cb2570f7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt @@ -4,22 +4,22 @@ import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.events.EventPreferenceChange +import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui +import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning +import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataHandlerMobile +import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobileHelper +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui -import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataHandlerMobile -import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobileHelper -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAutosensCalculationFinished import info.nightscout.rx.events.EventMobileToWear +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.weardata.EventData +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign 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 efde04f06b..f879060531 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 @@ -25,12 +25,9 @@ import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.TrendCalculator @@ -41,14 +38,17 @@ import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.services.AlarmSoundServiceHelper 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.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.androidaps.utils.wizard.QuickWizardEntry +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.queue.Callback import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt index e8ddf0792e..0af169d2e4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt @@ -18,22 +18,22 @@ import dagger.android.AndroidInjection import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.wear.WearPlugin import info.nightscout.androidaps.plugins.general.wear.events.EventWearUpdateGui import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config 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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index a22318da4f..867f81ad66 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -2,11 +2,9 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator import androidx.collection.LongSparseArray import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.IobTotal -import info.nightscout.interfaces.data.MealData import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.Bolus @@ -22,27 +20,29 @@ import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator +import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.plugins.general.overview.OverviewData +import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.androidaps.workflow.CalculationWorkflow +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginBase 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.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.overview.OverviewData -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.interfaces.data.MealData import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.utils.T -import info.nightscout.androidaps.workflow.CalculationWorkflow import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event import info.nightscout.rx.events.EventConfigBuilderChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt index a5913840a8..e8e3f5144e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt @@ -6,36 +6,36 @@ 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.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.Profiler -import info.nightscout.shared.utils.T import info.nightscout.androidaps.workflow.CalculationWorkflow +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event import info.nightscout.rx.events.EventAutosensCalculationFinished import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import java.util.Calendar import java.util.GregorianCalendar import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt index 0709de9bb7..8f2868beaf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt @@ -6,34 +6,34 @@ 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.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.plugins.sensitivity.SensitivityAAPSPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAveragePlugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.Profiler -import info.nightscout.shared.utils.T import info.nightscout.androidaps.workflow.CalculationWorkflow +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event import info.nightscout.rx.events.EventAutosensCalculationFinished 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 javax.inject.Inject import kotlin.math.abs import kotlin.math.max 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 e23d50ac7b..41f78e2dc7 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 @@ -13,11 +13,11 @@ import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 cf7c7c6c9c..74cd9c4d9a 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 @@ -15,11 +15,11 @@ import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 0282023c88..9aab525609 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -20,14 +20,14 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.buildDeviceStatus +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.LocalAlertUtils +import info.nightscout.interfaces.PluginBase import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventProfileSwitchChanged 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 10c2a4af07..8e6f5882bf 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt @@ -14,8 +14,8 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange 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.core.fabric.FabricPrivacy import info.nightscout.interfaces.locale.LocaleHelper.update import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/CalculationWorkflow.kt b/app/src/main/java/info/nightscout/androidaps/workflow/CalculationWorkflow.kt index 9adfdb307b..b734ecc19d 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/CalculationWorkflow.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/CalculationWorkflow.kt @@ -14,15 +14,13 @@ import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOref1Worker import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobOrefWorker import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.Event @@ -31,6 +29,8 @@ import info.nightscout.rx.events.EventOfflineChange import info.nightscout.rx.events.EventTherapyEventChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index cb737bf581..693e5b0a30 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -6,16 +6,16 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.embedments.InsulinConfiguration import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.rx.bus.RxBus import org.json.JSONObject import org.junit.Before import org.mockito.ArgumentMatchers.anyDouble 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 f5987cef9f..f478c59f20 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 @@ -12,13 +12,13 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.bus.RxBus diff --git a/automation/build.gradle b/automation/build.gradle index c7f2486120..e34784b81f 100644 --- a/automation/build.gradle +++ b/automation/build.gradle @@ -19,6 +19,7 @@ android { dependencies { implementation project(':graphview') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':database') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt b/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt index 0ce2afe3df..29239c18e2 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt @@ -25,24 +25,24 @@ import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import info.nightscout.interfaces.dragHelpers.ItemTouchHelperAdapter -import info.nightscout.interfaces.dragHelpers.OnStartDragListener -import info.nightscout.interfaces.dragHelpers.SimpleItemTouchHelperCallback import info.nightscout.automation.databinding.AutomationEventItemBinding import info.nightscout.automation.databinding.AutomationFragmentBinding import info.nightscout.automation.dialogs.EditEventDialog import info.nightscout.automation.events.EventAutomationDataChanged import info.nightscout.automation.events.EventAutomationUpdateGui import info.nightscout.automation.triggers.TriggerConnector +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.dragHelpers.ItemTouchHelperAdapter +import info.nightscout.interfaces.dragHelpers.OnStartDragListener +import info.nightscout.interfaces.dragHelpers.SimpleItemTouchHelperCallback +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt index bec9e6395c..0042eb21e8 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt @@ -8,17 +8,8 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.automation.actions.Action import info.nightscout.automation.actions.ActionAlarm import info.nightscout.automation.actions.ActionCarePortalEvent @@ -52,6 +43,12 @@ import info.nightscout.automation.triggers.TriggerTempTargetValue import info.nightscout.automation.triggers.TriggerTime import info.nightscout.automation.triggers.TriggerTimeRange import info.nightscout.automation.triggers.TriggerWifiSsid +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventBTChange @@ -59,7 +56,10 @@ 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 info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray diff --git a/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt b/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt index 72bcdfab9d..8684bacef0 100644 --- a/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt +++ b/automation/src/main/java/info/nightscout/automation/dialogs/EditEventDialog.kt @@ -11,8 +11,6 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dialogs.DialogFragmentWithDate -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.automation.AutomationEvent import info.nightscout.automation.AutomationPlugin @@ -24,8 +22,10 @@ import info.nightscout.automation.events.EventAutomationDataChanged import info.nightscout.automation.events.EventAutomationUpdateAction import info.nightscout.automation.events.EventAutomationUpdateGui import info.nightscout.automation.events.EventAutomationUpdateTrigger +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.extensions.toVisibility import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt b/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt index 5d7bd3cc27..1d3d73de47 100644 --- a/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt +++ b/automation/src/main/java/info/nightscout/automation/dialogs/EditTriggerDialog.kt @@ -6,7 +6,6 @@ import android.view.View import android.view.ViewGroup import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dialogs.DialogFragmentWithDate -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.automation.databinding.AutomationDialogEditTriggerBinding import info.nightscout.automation.events.EventAutomationUpdateTrigger import info.nightscout.automation.events.EventTriggerChanged @@ -15,6 +14,7 @@ import info.nightscout.automation.events.EventTriggerRemove import info.nightscout.automation.triggers.Trigger import info.nightscout.automation.triggers.TriggerConnector import info.nightscout.automation.triggers.TriggerDummy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/automation/src/main/java/info/nightscout/automation/services/LocationService.kt b/automation/src/main/java/info/nightscout/automation/services/LocationService.kt index 21f6b21732..04319d01cc 100644 --- a/automation/src/main/java/info/nightscout/automation/services/LocationService.kt +++ b/automation/src/main/java/info/nightscout/automation/services/LocationService.kt @@ -16,17 +16,17 @@ import android.os.IBinder import androidx.core.app.ActivityCompat import com.google.android.gms.location.LocationServices import dagger.android.DaggerService -import info.nightscout.interfaces.NotificationHolder -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.automation.R import info.nightscout.automation.events.EventLocationChange +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.NotificationHolder import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject diff --git a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 85a097a29c..d954e24b51 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,17 +4,17 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore +import info.nightscout.androidaps.utils.DefaultValueHelper +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.rx.bus.RxBus import org.json.JSONObject import org.junit.Before import org.mockito.Mock diff --git a/core/core-main/build.gradle b/core/core-main/build.gradle index a9c7b2c2bc..a001098465 100644 --- a/core/core-main/build.gradle +++ b/core/core-main/build.gradle @@ -63,16 +63,6 @@ dependencies { api "androidx.work:work-rxjava3:$work_version" - //Firebase - api platform('com.google.firebase:firebase-bom:30.5.0') - api "com.google.firebase:firebase-analytics-ktx" - api "com.google.firebase:firebase-crashlytics-ktx" - // StatsActivity not in use now - // api "com.google.firebase:firebase-messaging-ktx" - // api 'com.google.firebase:firebase-auth-ktx' - // api 'com.google.firebase:firebase-database-ktx' - - //CryptoUtil api 'com.madgag.spongycastle:core:1.58.0.0' api "com.google.crypto.tink:tink-android:$tink_version" diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreModule.kt b/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreModule.kt index 7609530279..bb79bc7e9e 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreModule.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreModule.kt @@ -5,10 +5,6 @@ import android.os.Build import android.telephony.SmsManager import dagger.Module import dagger.Provides -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.resources.ResourceHelperImplementation -import javax.inject.Singleton @Module( includes = [ @@ -20,10 +16,6 @@ import javax.inject.Singleton ) open class CoreModule { - @Provides - @Singleton - fun provideResources(context: Context, fabricPrivacy: FabricPrivacy): ResourceHelper = ResourceHelperImplementation(context, fabricPrivacy) - @Suppress("DEPRECATION") @Provides fun smsManager(context: Context): SmsManager? = diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt index 873714cfe7..f78e1986b1 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt @@ -9,21 +9,20 @@ import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.activities.DialogAppCompatActivity -import info.nightscout.core.main.R -import info.nightscout.core.main.databinding.DialogBolusprogressBinding import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.main.R +import info.nightscout.core.main.databinding.DialogBolusprogressBinding 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 io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject @@ -34,7 +33,6 @@ class BolusProgressDialog : DaggerDialogFragment() { @Inject lateinit var rxBus: RxBus @Inject lateinit var rh: ResourceHelper @Inject lateinit var commandQueue: CommandQueue - @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var uel: UserEntryLogger @@ -122,30 +120,30 @@ class BolusProgressDialog : DaggerDialogFragment() { disposable += rxBus .toObservable(EventPumpStatusChanged::class.java) .observeOn(aapsSchedulers.main) - .subscribe({ binding.status.text = it.getStatus(rh) }, fabricPrivacy::logException) + .subscribe { binding.status.text = it.getStatus(rh) } disposable += rxBus .toObservable(EventDismissBolusProgressIfRunning::class.java) .observeOn(aapsSchedulers.main) - .subscribe({ - aapsLogger.debug(LTag.PUMP, "Running id $id. Close request id ${it.id}") - if (it.id == null || it.id == id) - if (running) dismiss() - }, fabricPrivacy::logException) + .subscribe { + aapsLogger.debug(LTag.PUMP, "Running id $id. Close request id ${it.id}") + if (it.id == null || it.id == id) + if (running) dismiss() + } disposable += rxBus .toObservable(EventOverviewBolusProgress::class.java) .observeOn(aapsSchedulers.main) - .subscribe({ - if (it.t?.id == id) { - aapsLogger.debug(LTag.UI, "Status: ${it.status} Percent: ${it.percent}") - binding.status.text = it.status - binding.progressbar.progress = it.percent - if (it.percent == 100) { - binding.stop.visibility = View.INVISIBLE - scheduleDismiss() - } - state = it.status - } - }, fabricPrivacy::logException) + .subscribe { + if (it.t?.id == id) { + aapsLogger.debug(LTag.UI, "Status: ${it.status} Percent: ${it.percent}") + binding.status.text = it.status + binding.progressbar.progress = it.percent + if (it.percent == 100) { + binding.stop.visibility = View.INVISIBLE + scheduleDismiss() + } + state = it.status + } + } } override fun dismiss() { diff --git a/core/core-main/src/main/res/values/colors.xml b/core/core-main/src/main/res/values/colors.xml index e83c322785..888bcbc062 100644 --- a/core/core-main/src/main/res/values/colors.xml +++ b/core/core-main/src/main/res/values/colors.xml @@ -143,11 +143,6 @@ #00000000 - - #66BB6A - #FF8C00 - #FF5555 - #666666 #000000 diff --git a/core/core-main/src/main/res/values/strings.xml b/core/core-main/src/main/res/values/strings.xml index 441a580345..8a6823005f 100644 --- a/core/core-main/src/main/res/values/strings.xml +++ b/core/core-main/src/main/res/values/strings.xml @@ -1,7 +1,6 @@ - enable_fabric2 units loop_openmode_min_change absorption_maxtime diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index aff38f1b2f..d59c1efa9d 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -9,15 +9,15 @@ import info.nightscout.androidaps.interfaces.ActivePlugin 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.shared.utils.DateUtil import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config 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.json.JSONObject import org.junit.Before import org.mockito.Mock diff --git a/core/fabric/.gitignore b/core/fabric/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/core/fabric/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/core/fabric/build.gradle b/core/fabric/build.gradle new file mode 100644 index 0000000000..df0915c06c --- /dev/null +++ b/core/fabric/build.gradle @@ -0,0 +1,34 @@ +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} + +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/allopen_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/test_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/jacoco_global.gradle" + +android { + + namespace 'info.nightscout.core.fabric' +} + +dependencies { + + implementation project(':interfaces') + implementation project(':app-wear-shared:rx') + implementation project(':app-wear-shared:shared') + + //Firebase + api platform('com.google.firebase:firebase-bom:30.5.0') + api "com.google.firebase:firebase-analytics-ktx" + api "com.google.firebase:firebase-crashlytics-ktx" + // StatsActivity not in use now + // api "com.google.firebase:firebase-messaging-ktx" + // api 'com.google.firebase:firebase-auth-ktx' + // api 'com.google.firebase:firebase-database-ktx' +} \ No newline at end of file diff --git a/core/fabric/consumer-rules.pro b/core/fabric/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/core/fabric/proguard-rules.pro b/core/fabric/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/core/fabric/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/core/src/main/res/values/validator.xml b/core/fabric/src/main/AndroidManifest.xml similarity index 61% rename from core/src/main/res/values/validator.xml rename to core/fabric/src/main/AndroidManifest.xml index 55344e5192..44008a4332 100644 --- a/core/src/main/res/values/validator.xml +++ b/core/fabric/src/main/AndroidManifest.xml @@ -1,3 +1,4 @@ - - \ No newline at end of file + + + \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt b/core/fabric/src/main/java/info/nightscout/core/fabric/FabricPrivacy.kt similarity index 98% rename from core/core-main/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt rename to core/fabric/src/main/java/info/nightscout/core/fabric/FabricPrivacy.kt index 8d3f433c62..916756c53a 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt +++ b/core/fabric/src/main/java/info/nightscout/core/fabric/FabricPrivacy.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.utils +package info.nightscout.core.fabric import android.os.Bundle import com.google.firebase.analytics.FirebaseAnalytics @@ -6,7 +6,6 @@ import com.google.firebase.analytics.ktx.analytics import com.google.firebase.crashlytics.FirebaseCrashlytics import com.google.firebase.ktx.Firebase import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.core.main.R import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/InstanceId.kt b/core/fabric/src/main/java/info/nightscout/core/fabric/InstanceId.kt similarity index 86% rename from core/core-main/src/main/java/info/nightscout/androidaps/utils/InstanceId.kt rename to core/fabric/src/main/java/info/nightscout/core/fabric/InstanceId.kt index a5cd3187f0..5eff95ff18 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/InstanceId.kt +++ b/core/fabric/src/main/java/info/nightscout/core/fabric/InstanceId.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.utils +package info.nightscout.core.fabric import com.google.firebase.installations.FirebaseInstallations diff --git a/core/fabric/src/main/res/values/strings.xml b/core/fabric/src/main/res/values/strings.xml new file mode 100644 index 0000000000..3ad8e4ea03 --- /dev/null +++ b/core/fabric/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + enable_fabric2 + \ No newline at end of file diff --git a/core/src/main/res/values/protection.xml b/core/src/main/res/values/protection.xml deleted file mode 100644 index 045e125f3d..0000000000 --- a/core/src/main/res/values/protection.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml deleted file mode 100644 index 045e125f3d..0000000000 --- a/core/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/implementation/build.gradle b/implementation/build.gradle index 5cc3ef317d..9f8d8e7a7c 100644 --- a/implementation/build.gradle +++ b/implementation/build.gradle @@ -16,10 +16,11 @@ android { } dependencies { - implementation project(':core:core-main') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':database') implementation project(':automation') implementation project(':interfaces') + implementation project(':core:core-main') + implementation project(':core:fabric') } \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt index 8c1a38101c..1ebf7218dd 100644 --- a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt +++ b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt @@ -1,6 +1,11 @@ package info.nightscout.implementation.di +import android.content.Context import dagger.Module +import dagger.Provides +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.shared.interfaces.ResourceHelper +import javax.inject.Singleton @Module( includes = [ @@ -9,4 +14,9 @@ import dagger.Module ) @Suppress("unused") -abstract class ImplementationModule \ No newline at end of file +open class ImplementationModule { + @Provides + @Singleton + fun provideResources(context: Context, fabricPrivacy: FabricPrivacy): ResourceHelper = + info.nightscout.implementation.resources.ResourceHelperImpl(context, fabricPrivacy) +} \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index b0393e8115..c4b984e8a4 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -18,20 +18,17 @@ import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.queue.commands.Command.CommandType -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.getCustomizedName +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus import info.nightscout.implementation.queue.commands.CommandCancelExtendedBolus @@ -54,6 +51,7 @@ import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.queue.Callback @@ -65,7 +63,9 @@ import info.nightscout.rx.events.EventMobileToWear import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import io.reactivex.rxjava3.kotlin.subscribeBy diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt similarity index 89% rename from core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt rename to implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt index ea58448e7c..9893ba50cf 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/resources/ResourceHelperImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/resources/ResourceHelperImpl.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.utils.resources +package info.nightscout.implementation.resources import android.annotation.SuppressLint import android.content.Context @@ -9,20 +9,26 @@ import android.graphics.Bitmap import android.graphics.BitmapFactory import android.graphics.drawable.Drawable import android.util.DisplayMetrics -import androidx.annotation.* +import androidx.annotation.ArrayRes +import androidx.annotation.BoolRes +import androidx.annotation.ColorRes +import androidx.annotation.DrawableRes +import androidx.annotation.PluralsRes +import androidx.annotation.StringRes import androidx.appcompat.app.AppCompatDelegate import androidx.appcompat.view.ContextThemeWrapper import androidx.core.content.ContextCompat +import info.nightscout.androidaps.utils.resources.getThemeColor +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.main.R import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.FabricPrivacy -import java.util.* +import java.util.Locale import javax.inject.Inject /** * Created by adrian on 2019-12-23. */ -class ResourceHelperImplementation @Inject constructor(var context: Context, private val fabricPrivacy: FabricPrivacy) : ResourceHelper { +class ResourceHelperImpl @Inject constructor(var context: Context, private val fabricPrivacy: FabricPrivacy) : ResourceHelper { override fun updateContext(ctx: Context?) { ctx?.let { context = it } diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index e4d3ebdd2e..693e5b0a30 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -10,12 +10,12 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import org.junit.Before import org.mockito.ArgumentMatchers.anyDouble diff --git a/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt index acfd1d5a8c..96cf5a9926 100644 --- a/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/BolusTimerImplTest.kt @@ -5,19 +5,19 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.services.LocationServiceHelper import info.nightscout.automation.triggers.Trigger +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.GlucoseUnit 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/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt b/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt index 861d0b9a59..e2d4ffcd90 100644 --- a/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/CarbTimerImplTest.kt @@ -5,20 +5,20 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.TimerUtil import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.services.LocationServiceHelper import info.nightscout.automation.triggers.Trigger +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.utils.TimerUtil 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/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index 09de233ff3..5fde100e47 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -12,30 +12,30 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus import info.nightscout.implementation.queue.commands.CommandCustomCommand import info.nightscout.implementation.queue.commands.CommandExtendedBolus import info.nightscout.implementation.queue.commands.CommandLoadHistory import info.nightscout.implementation.queue.commands.CommandTempBasalPercent +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.queue.CustomCommand import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before diff --git a/insight/build.gradle b/insight/build.gradle index 7cf99ebb59..6e5bc131cc 100644 --- a/insight/build.gradle +++ b/insight/build.gradle @@ -28,6 +28,7 @@ android { dependencies { implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':interfaces') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') 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 f90414e021..9e8e2907c1 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 @@ -31,7 +31,7 @@ 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.androidaps.utils.DecimalFormatter; -import info.nightscout.androidaps.utils.FabricPrivacy; +import info.nightscout.core.fabric.FabricPrivacy; import info.nightscout.interfaces.queue.Callback; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; diff --git a/interfaces/src/main/res/values/colors.xml b/interfaces/src/main/res/values/colors.xml new file mode 100644 index 0000000000..6a01b0f440 --- /dev/null +++ b/interfaces/src/main/res/values/colors.xml @@ -0,0 +1,8 @@ + + + + #66BB6A + #FF8C00 + #FF5555 + + \ No newline at end of file diff --git a/plugins/build.gradle b/plugins/build.gradle index 9a6b3b6c7a..1c771254e2 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -21,6 +21,7 @@ dependencies { implementation project(':database') implementation project(':graphview') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':interfaces') implementation project(':ns-sdk') @@ -34,7 +35,7 @@ dependencies { } api "com.squareup.okhttp3:okhttp:$okhttp3_version" api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" -// api "com.squareup.retrofit2:retrofit:$retrofit2_version" + //api "com.squareup.retrofit2:retrofit:$retrofit2_version" api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version" api "com.squareup.retrofit2:converter-gson:$retrofit2_version" diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt index f3875cc2cd..993b6ebdd2 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt @@ -1,22 +1,22 @@ package info.nightscout.plugins.constraints.bgQualityCheck import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator +import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated -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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 07037437f9..7020d10943 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -19,26 +19,22 @@ import android.widget.TableRow import android.widget.TextView import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.dialogs.ProfileViewerDialog -import info.nightscout.shared.extensions.runOnUiThread -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.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.logging.UserEntryLogger -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.interfaces.utils.Round -import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation import info.nightscout.plugins.R import info.nightscout.plugins.databinding.AutotuneFragmentBinding import info.nightscout.plugins.general.autotune.data.ATProfile @@ -48,7 +44,11 @@ import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventLocalProfileChanged import info.nightscout.shared.SafeParse +import info.nightscout.shared.extensions.runOnUiThread +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject 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 54b0bd1ca9..7a57274a65 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 @@ -17,14 +17,12 @@ import info.nightscout.androidaps.database.entities.Food import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.transactions.InvalidateFoodTransaction -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.interfaces.ActivityNames -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.ui.UIRunnable +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames import info.nightscout.plugins.R import info.nightscout.plugins.databinding.FoodFragmentBinding import info.nightscout.plugins.databinding.FoodItemBinding @@ -33,6 +31,8 @@ import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventFoodDatabaseChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Locale diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt index fcd2a46985..8709b172e9 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt @@ -5,15 +5,15 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment -import info.nightscout.interfaces.data.smsCommunicator.Sms +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.interfaces.data.smsCommunicator.Sms import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.plugins.databinding.SmscommunicatorFragmentBinding import info.nightscout.plugins.general.smsCommunicator.events.EventSmsCommunicatorUpdateGui import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.Collections diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index e8f7c6acd6..48d0084c44 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 @@ -27,28 +27,25 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper 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.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.SmsCommunicator @@ -65,7 +62,10 @@ import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.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.apache.commons.lang3.StringUtils diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index a11d9d6d03..33a53bf472 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -15,11 +15,11 @@ import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.interfaces.SmsCommunicator import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.SmsCommunicator import info.nightscout.plugins.R import info.nightscout.plugins.databinding.SmscommunicatorActivityOtpBinding import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword diff --git a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt index 824c9dbc13..936b78fd40 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -8,14 +8,13 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop +import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.PluginBase 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.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.plugins.R import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -27,6 +26,7 @@ import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.events.EventTreatmentChange 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/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index e5c63c6df1..141c97d3de 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -10,24 +10,21 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import com.google.android.material.tabs.TabLayout import dagger.android.support.DaggerFragment -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.ValueWithUnit -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.plugins.R import info.nightscout.plugins.databinding.ProfileFragmentBinding import info.nightscout.plugins.ui.TimeListEdit @@ -37,6 +34,9 @@ import info.nightscout.rx.events.EventLocalProfileChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.math.RoundingMode diff --git a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpFragment.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpFragment.kt index 25234cee59..cc6bb57714 100644 --- a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpFragment.kt @@ -10,7 +10,7 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.plugins.R import info.nightscout.plugins.databinding.VirtualPumpFragmentBinding import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui diff --git a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt index 016cf57de4..9ab739ee3f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -15,13 +15,10 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.pump.PumpType -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.InstanceId +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType @@ -29,6 +26,8 @@ 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.pump.PumpDescription +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.plugins.R import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui @@ -384,7 +383,7 @@ open class VirtualPumpPlugin @Inject constructor( override fun model(): PumpType = pumpDescription.pumpType - override fun serialNumber(): String = InstanceId.instanceId + override fun serialNumber(): String = info.nightscout.core.fabric.InstanceId.instanceId override fun shortStatus(veryShort: Boolean): String = "Virtual Pump" diff --git a/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt index 77a3f3df4b..bbd9fa5650 100644 --- a/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt @@ -24,12 +24,12 @@ import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.PluginBase import info.nightscout.plugins.R import info.nightscout.plugins.databinding.SourceFragmentBinding import info.nightscout.plugins.databinding.SourceItemBinding diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index 64a76e27ca..9f15c82c92 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -16,13 +16,13 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.DataSyncSelector +import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginFragment -import info.nightscout.androidaps.logging.UserEntryLogger -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 diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt index 96dcdfbacd..6590746f28 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt @@ -14,16 +14,16 @@ import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.DataSyncSelector -import info.nightscout.interfaces.NsClient -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.Sync -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.Sync import info.nightscout.interfaces.utils.HtmlHelper.fromHtml import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.NSClientFragment diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt index e5887e21e7..5f604a7199 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt @@ -19,13 +19,13 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.DataSyncSelector -import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.interfaces.utils.JsonHelper.safeGetStringAllowNull diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index ceb462d5c1..b45e2c0e01 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -13,16 +13,16 @@ import androidx.work.WorkInfo import androidx.work.WorkManager import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.interfaces.NsClient -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.Sync -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.Sync import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.NSClientFragment diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt index 2438b321a8..6d53ad1691 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolFragment.kt @@ -6,7 +6,7 @@ import android.view.View import android.view.ViewGroup import android.widget.ScrollView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.plugins.R import info.nightscout.plugins.databinding.TidepoolFragmentBinding import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt index f42290a305..2bdcaab27c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt @@ -7,14 +7,14 @@ import androidx.preference.PreferenceFragmentCompat import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.Sync import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.Sync import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.plugins.R import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index e4d3ebdd2e..693e5b0a30 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -10,12 +10,12 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import org.junit.Before import org.mockito.ArgumentMatchers.anyDouble diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt index f883b67ba8..ed30a2a16e 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt @@ -4,15 +4,15 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constraint import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt index 1c0fbcb153..4905016c15 100644 --- a/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt @@ -6,9 +6,9 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.pump.PumpType -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config +import info.nightscout.interfaces.pump.PumpType import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/pump/combo/build.gradle b/pump/combo/build.gradle index 42fcb70cfe..835e9aafd9 100644 --- a/pump/combo/build.gradle +++ b/pump/combo/build.gradle @@ -18,6 +18,7 @@ android { dependencies { implementation project(':libraries') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.kt b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.kt index dd0eaef99a..6b3a1edb1f 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.kt +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.kt @@ -10,19 +10,19 @@ import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.androidaps.combo.R import info.nightscout.androidaps.combo.databinding.CombopumpFragmentBinding -import info.nightscout.shared.extensions.runOnUiThread import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.combo.data.ComboErrorUtil import info.nightscout.androidaps.plugins.pump.combo.data.ComboErrorUtil.DisplayType import info.nightscout.androidaps.plugins.pump.combo.events.EventComboPumpUpdateGUI import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.PumpState +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventQueueChanged +import info.nightscout.shared.extensions.runOnUiThread +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 1a886cd10c..5c2a8f8831 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -1,6 +1,5 @@ package info.nightscout.androidaps.plugins.pump.combo; -import android.content.Context; import android.os.SystemClock; import androidx.annotation.NonNull; @@ -23,25 +22,17 @@ import javax.inject.Singleton; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.combo.R; import info.nightscout.androidaps.data.DetailedBolusInfo; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.Pump; -import info.nightscout.interfaces.pump.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.EventDismissNotification; 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.combo.events.EventComboPumpUpdateGUI; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.BasalProfile; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.BolusProgressReporter; @@ -55,17 +46,25 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistory; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistoryRequest; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Tdd; -import info.nightscout.interfaces.pump.PumpType; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.androidaps.utils.InstanceId; -import info.nightscout.shared.utils.T; +import info.nightscout.core.fabric.InstanceId; +import info.nightscout.interfaces.Constraint; +import info.nightscout.interfaces.PluginDescription; import info.nightscout.interfaces.PluginType; +import info.nightscout.interfaces.data.PumpEnactResult; +import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.pump.ManufacturerType; +import info.nightscout.interfaces.pump.PumpDescription; +import info.nightscout.interfaces.pump.PumpType; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventRefreshOverview; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; /** * Driver for the Roche Accu-Chek Combo pump, using the ruffy app for BT communication. @@ -96,7 +95,6 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints { private final SP sp; private RxBus rxBus; private final CommandQueue commandQueue; - private final Context context; private final PumpSync pumpSync; private final DateUtil dateUtil; private final RuffyCommands ruffyScripter; @@ -152,7 +150,6 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints { ProfileFunction profileFunction, SP sp, CommandQueue commandQueue, - Context context, PumpSync pumpSync, DateUtil dateUtil, RuffyScripter ruffyScripter @@ -171,7 +168,6 @@ public class ComboPlugin extends PumpPluginBase implements Pump, Constraints { this.profileFunction = profileFunction; this.sp = sp; this.commandQueue = commandQueue; - this.context = context; this.pumpSync = pumpSync; this.dateUtil = dateUtil; this.ruffyScripter = ruffyScripter; diff --git a/pump/dana/build.gradle b/pump/dana/build.gradle index 0d2f194186..44a7cb416f 100644 --- a/pump/dana/build.gradle +++ b/pump/dana/build.gradle @@ -28,6 +28,7 @@ android { dependencies { implementation project(':libraries') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt index 8fdd2a7429..e284fa66c8 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt @@ -16,31 +16,31 @@ import info.nightscout.androidaps.dana.databinding.DanarFragmentBinding import info.nightscout.androidaps.dana.events.EventDanaRNewStatus import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Dana import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.pump.PumpType -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.userEntry.UserEntryMapper.Action import info.nightscout.androidaps.utils.userEntry.UserEntryMapper.Sources +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Dana +import info.nightscout.interfaces.pump.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.events.EventInitializationChanged +import info.nightscout.rx.events.EventQueueChanged import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt index a6a1dc7531..758db789a5 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt @@ -8,7 +8,6 @@ import android.widget.AdapterView import android.widget.ArrayAdapter import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.dana.R import info.nightscout.androidaps.dana.comm.RecordTypes @@ -21,15 +20,16 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constants import info.nightscout.interfaces.pump.PumpType 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.utils.T import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.rx.logging.LTag +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt index 0f187cae8e..d59ebb424f 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt @@ -2,17 +2,17 @@ package info.nightscout.androidaps.dana.activities import android.content.Context import android.os.Bundle -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.dana.R import info.nightscout.androidaps.dana.databinding.DanarUserOptionsActivityBinding import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Constants import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.logging.LTag diff --git a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index de8003dd46..9231da44ec 100644 --- a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,17 +3,17 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore +import info.nightscout.androidaps.utils.DefaultValueHelper +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.rx.bus.RxBus import org.json.JSONObject import org.junit.Before import org.mockito.Mock diff --git a/pump/danar/build.gradle b/pump/danar/build.gradle index 06808b1162..2cdabf540c 100644 --- a/pump/danar/build.gradle +++ b/pump/danar/build.gradle @@ -19,6 +19,7 @@ dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':pump:dana') implementation project(':interfaces') } \ No newline at end of file diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index be0cde9827..d4f99224f8 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -15,16 +15,14 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.PumpType -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -32,7 +30,9 @@ import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index 737b5f6f53..ae88a17e18 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -17,29 +17,29 @@ import info.nightscout.androidaps.danaRv2.services.DanaRv2ExecutionService; import info.nightscout.androidaps.danar.AbstractDanaRPlugin; import info.nightscout.androidaps.danar.R; import info.nightscout.androidaps.data.DetailedBolusInfo; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage; +import info.nightscout.core.fabric.FabricPrivacy; +import info.nightscout.interfaces.Constraint; +import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.interfaces.pump.PumpType; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.interfaces.utils.Round; -import info.nightscout.shared.utils.T; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventAppExit; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; import io.reactivex.rxjava3.disposables.CompositeDisposable; @Singleton diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index a8968809ae..9e1eae94a9 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -15,27 +15,27 @@ import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.danar.services.DanaRExecutionService; import info.nightscout.androidaps.data.DetailedBolusInfo; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.rx.events.EventOverviewBolusProgress; +import info.nightscout.core.fabric.FabricPrivacy; +import info.nightscout.interfaces.Constraint; +import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.interfaces.pump.PumpType; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.interfaces.utils.Round; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventAppExit; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; import io.reactivex.rxjava3.disposables.CompositeDisposable; @Singleton diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java index a5c0c2bf43..1791ccce0b 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java @@ -39,26 +39,26 @@ import info.nightscout.androidaps.danar.comm.MsgHistoryRefill; import info.nightscout.androidaps.danar.comm.MsgHistorySuspend; import info.nightscout.androidaps.danar.comm.MsgPCCommStart; import info.nightscout.androidaps.danar.comm.MsgPCCommStop; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.ToastUtils; +import info.nightscout.core.fabric.FabricPrivacy; +import info.nightscout.interfaces.data.PumpEnactResult; +import info.nightscout.interfaces.notifications.Notification; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventAppExit; import info.nightscout.rx.events.EventBTChange; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; import io.reactivex.rxjava3.disposables.CompositeDisposable; /** diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 2278cd9707..6a8937c4af 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,16 +4,16 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.rx.bus.RxBus import org.json.JSONObject import org.junit.Before import org.mockito.ArgumentMatchers.anyDouble diff --git a/pump/danars/build.gradle b/pump/danars/build.gradle index 5628f1e947..27215a116c 100644 --- a/pump/danars/build.gradle +++ b/pump/danars/build.gradle @@ -32,6 +32,7 @@ android { dependencies { implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':pump:dana') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index 93b0d7a7e2..6d5ffdd808 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -14,44 +14,44 @@ import info.nightscout.androidaps.dana.comm.RecordTypes import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange import info.nightscout.androidaps.danars.services.DanaRSService import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.Dana -import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.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.EventDismissNotification 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.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage -import info.nightscout.interfaces.pump.PumpType -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.Round -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.Dana +import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.ManufacturerType +import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.events.EventConfigBuilderChange +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONException diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt index a6ea3fd30d..bc2986c2e4 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt @@ -9,10 +9,10 @@ import info.nightscout.androidaps.danars.databinding.DanarsEnterPinActivityBindi import info.nightscout.androidaps.danars.services.BLEComm import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.hexStringToByteArray -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.textValidator.DefaultEditTextValidator import info.nightscout.androidaps.utils.textValidator.EditTextValidator +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java b/pump/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java index 9bc29513ec..19ee210b56 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java @@ -19,10 +19,10 @@ import info.nightscout.androidaps.danars.R; import info.nightscout.androidaps.danars.activities.PairingHelperActivity; import info.nightscout.androidaps.danars.databinding.DanarsPairingProgressDialogBinding; import info.nightscout.androidaps.danars.events.EventDanaRSPairingSuccess; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.androidaps.utils.FabricPrivacy; +import info.nightscout.core.fabric.FabricPrivacy; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; +import info.nightscout.shared.interfaces.ResourceHelper; import io.reactivex.rxjava3.disposables.CompositeDisposable; diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt index 0fd5afdd5f..01ff1567be 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt @@ -8,7 +8,6 @@ import android.os.IBinder import android.os.SystemClock import dagger.android.DaggerService import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.dana.comm.RecordTypes import info.nightscout.androidaps.dana.events.EventDanaRNewStatus @@ -55,34 +54,35 @@ import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionGetUserOption import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionSetPumpTime import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionSetPumpUTCAndTimeZone import info.nightscout.androidaps.danars.comm.DanaRSPacketOptionSetUserOption -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.rx.events.EventOverviewBolusProgress +import info.nightscout.androidaps.queue.commands.Command +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.queue.Callback -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.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.events.EventInitializationChanged +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.joda.time.DateTime diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index e73715ea9d..27d702dd8a 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,17 +3,17 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore +import info.nightscout.androidaps.utils.DefaultValueHelper +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Config +import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.rx.bus.RxBus import org.json.JSONObject import org.junit.Before import org.mockito.Mock diff --git a/pump/diaconn/build.gradle b/pump/diaconn/build.gradle index e8dfecc216..0f899fc708 100644 --- a/pump/diaconn/build.gradle +++ b/pump/diaconn/build.gradle @@ -30,6 +30,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':libraries') implementation project(':interfaces') + implementation project(':core:fabric') implementation project(':core:core-main') api "androidx.room:room-ktx:$room_version" diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt index ec139af39d..5c7738a7c4 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt @@ -15,23 +15,23 @@ import info.nightscout.androidaps.diaconn.databinding.DiaconnG8FragmentBinding import info.nightscout.androidaps.diaconn.events.EventDiaconnG8NewStatus import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.WarnColors +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.events.EventInitializationChanged +import info.nightscout.rx.events.EventQueueChanged import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index 1fea57bb3a..6857f3036e 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -10,48 +10,48 @@ import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.diaconn.events.EventDiaconnG8DeviceChange import info.nightscout.androidaps.diaconn.service.DiaconnG8Service import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.Diaconn -import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.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.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification 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.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage -import info.nightscout.interfaces.pump.PumpType -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.Round -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.Diaconn +import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.ManufacturerType +import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.actions.CustomAction +import info.nightscout.interfaces.pump.actions.CustomActionType +import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.events.EventConfigBuilderChange +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import org.json.JSONException import org.json.JSONObject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt index 1e08f22bff..3d6dd0cda2 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt @@ -19,12 +19,12 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.ProfileFunction -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.utils.T +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt index 6c4e978ec7..49b8f8418f 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt @@ -10,13 +10,12 @@ import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.databinding.DiaconnG8UserOptionsActivityBinding import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.LTag - import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import java.text.DecimalFormat diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index 5b8abc171f..3d2c3405ef 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -8,8 +8,6 @@ import android.os.IBinder import android.os.SystemClock import dagger.android.DaggerService import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.diaconn.DiaconnG8Plugin import info.nightscout.androidaps.diaconn.DiaconnG8Pump @@ -50,30 +48,32 @@ import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper 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.bolusInfo.DetailedBolusInfoStorage +import info.nightscout.androidaps.queue.commands.Command +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.events.EventInitializationChanged +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import org.joda.time.DateTime import org.joda.time.DateTimeZone diff --git a/pump/eopatch/build.gradle b/pump/eopatch/build.gradle index dd99534517..e8c8b6a3f7 100644 --- a/pump/eopatch/build.gradle +++ b/pump/eopatch/build.gradle @@ -26,6 +26,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':database') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':interfaces') //RxAndroidBle diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index 6c70dd41d8..9970889317 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -3,24 +3,14 @@ package info.nightscout.androidaps.plugins.pump.eopatch import android.os.SystemClock import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.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.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager @@ -28,17 +18,27 @@ import info.nightscout.androidaps.plugins.pump.eopatch.code.BolusExDuration import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.ui.EopatchOverviewFragment import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T -import info.nightscout.interfaces.utils.TimeChangeType +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.ManufacturerType +import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.actions.CustomAction +import info.nightscout.interfaces.pump.actions.CustomActionType +import info.nightscout.interfaces.queue.CustomCommand +import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppInitialized +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.functions.Consumer import io.reactivex.rxjava3.subjects.BehaviorSubject diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt index 3521fc2489..219cb88236 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt @@ -5,10 +5,7 @@ import android.content.Intent import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.eopatch.EONotification import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus import info.nightscout.androidaps.plugins.pump.eopatch.R @@ -24,13 +21,16 @@ import info.nightscout.androidaps.plugins.pump.eopatch.code.AlarmCategory import info.nightscout.androidaps.plugins.pump.eopatch.event.EventEoPatchAlarm import info.nightscout.androidaps.plugins.pump.eopatch.ui.AlarmHelperActivity import info.nightscout.androidaps.plugins.pump.eopatch.vo.Alarms -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/pump/medtronic/build.gradle b/pump/medtronic/build.gradle index 7873cba6e7..7df54d4cfb 100644 --- a/pump/medtronic/build.gradle +++ b/pump/medtronic/build.gradle @@ -24,4 +24,5 @@ dependencies { implementation project(':pump:pump-core') implementation project(':pump:rileylink') implementation project(':interfaces') + implementation project(path: ':core:fabric') } diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index 57d90464c3..f747d48f85 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -26,9 +26,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpValuesChanged import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.queue.Callback import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.rx.AapsSchedulers diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index d7477803ad..6c45c97847 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -8,27 +8,17 @@ import android.os.SystemClock import androidx.preference.Preference import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState -import info.nightscout.interfaces.pump.PumpType -import info.nightscout.rx.events.EventRefreshButtonState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpInfo @@ -63,16 +53,26 @@ import info.nightscout.androidaps.plugins.pump.medtronic.service.RileyLinkMedtro import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.isSame -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.TimeChangeType +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.ManufacturerType +import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.actions.CustomAction +import info.nightscout.interfaces.pump.actions.CustomActionType +import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventRefreshButtonState import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.joda.time.LocalDateTime import java.util.Calendar import java.util.GregorianCalendar diff --git a/pump/omnipod-dash/build.gradle b/pump/omnipod-dash/build.gradle index 0fd002ff78..7d43659091 100644 --- a/pump/omnipod-dash/build.gradle +++ b/pump/omnipod-dash/build.gradle @@ -38,6 +38,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':libraries') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':pump:pump-common') implementation project(':pump:omnipod-common') implementation project(':interfaces') diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 6eff10b3eb..70546aa3fe 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -6,30 +6,19 @@ import android.os.HandlerThread import android.text.format.DateFormat import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.extensions.toStringFull -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.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.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod @@ -60,23 +49,34 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.OmnipodDashOvervi import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.Constants import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.mapProfileToBasalProgram import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.interfaces.queue.CustomCommand -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.interfaces.utils.Round -import info.nightscout.shared.utils.T -import info.nightscout.interfaces.utils.TimeChangeType +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.ManufacturerType +import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.actions.CustomAction +import info.nightscout.interfaces.pump.actions.CustomActionType +import info.nightscout.interfaces.queue.CustomCommand +import info.nightscout.interfaces.utils.Round +import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt index 91af859843..ac8018229d 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt @@ -5,8 +5,6 @@ import android.content.Intent import android.os.Bundle import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandPlayTestBeep import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity @@ -16,11 +14,13 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definitio import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation.DashPodActivationWizardActivity import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.DashPodDeactivationWizardActivity -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.events.EventQueueChanged +import info.nightscout.shared.extensions.toVisibility import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt index d7cbdffd91..a1c4702eb2 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt @@ -9,15 +9,10 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewButtonsBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.databinding.OmnipodCommonOverviewPodInfoBinding import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandHandleTimeChange @@ -33,16 +28,21 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definitio import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.AlertType import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.PodConstants import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.ui.UIRunnable +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventQueueChanged +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.apache.commons.lang3.StringUtils diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index c5f038025c..016313ed48 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -3,14 +3,10 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activatio import androidx.annotation.StringRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InsertCannulaViewModel import info.nightscout.androidaps.plugins.pump.omnipod.dash.R @@ -23,11 +19,15 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.Resolve import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.Constants import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.I8n import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.mapProfileToBasalProgram -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpType 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 io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/pump/omnipod-eros/build.gradle b/pump/omnipod-eros/build.gradle index 9e7f496a67..c486f714d4 100644 --- a/pump/omnipod-eros/build.gradle +++ b/pump/omnipod-eros/build.gradle @@ -31,6 +31,7 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':libraries') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':pump:pump-common') implementation project(':pump:pump-core') implementation project(':pump:rileylink') diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index a627f4d4cc..80c8001410 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -35,26 +35,17 @@ import javax.inject.Singleton; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.data.DetailedBolusInfo; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; -import info.nightscout.interfaces.ActivityNames; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.Pump; -import info.nightscout.interfaces.pump.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.interfaces.pump.actions.CustomActionType; 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.interfaces.pump.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; @@ -95,16 +86,22 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.service.Ri import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.OmnipodErosOverviewFragment; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; +import info.nightscout.androidaps.services.AlarmSoundService; +import info.nightscout.androidaps.utils.DecimalFormatter; +import info.nightscout.core.fabric.FabricPrivacy; +import info.nightscout.interfaces.ActivityNames; +import info.nightscout.interfaces.PluginDescription; +import info.nightscout.interfaces.PluginType; +import info.nightscout.interfaces.data.PumpEnactResult; +import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.pump.ManufacturerType; +import info.nightscout.interfaces.pump.PumpDescription; +import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.actions.CustomActionType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.interfaces.queue.CustomCommand; -import info.nightscout.androidaps.services.AlarmSoundService; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.androidaps.utils.DecimalFormatter; -import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.interfaces.utils.Round; -import info.nightscout.shared.utils.T; import info.nightscout.interfaces.utils.TimeChangeType; -import info.nightscout.interfaces.PluginType; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventAppExit; @@ -112,7 +109,10 @@ import info.nightscout.rx.events.EventAppInitialized; import info.nightscout.rx.events.EventRefreshOverview; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; import io.reactivex.rxjava3.disposables.CompositeDisposable; /** diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt index 1911a480e2..aefc980840 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt @@ -7,9 +7,6 @@ import android.os.Handler import android.os.HandlerThread import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.dialog.RileyLinkStatusActivity @@ -28,12 +25,15 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodE import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandReadPulseLog import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activation.ErosPodActivationWizardActivity import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivation.ErosPodDeactivationWizardActivity -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.ui.UIRunnable +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.events.EventQueueChanged +import info.nightscout.shared.extensions.toVisibility import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt index dac4584837..e41288b454 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt @@ -9,14 +9,10 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice @@ -41,16 +37,20 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodE import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandGetPodStatus import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil -import info.nightscout.interfaces.queue.Callback -import info.nightscout.rx.events.EventQueueChanged -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.ui.UIRunnable +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventQueueChanged +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.apache.commons.lang3.StringUtils diff --git a/pump/pump-common/build.gradle b/pump/pump-common/build.gradle index a5bdc109f9..e80f89e88a 100644 --- a/pump/pump-common/build.gradle +++ b/pump/pump-common/build.gradle @@ -17,6 +17,7 @@ android { dependencies { implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index 492827ab9a..b07988cb07 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -7,7 +7,6 @@ import android.text.format.DateFormat import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -15,32 +14,33 @@ import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpPluginBase import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState -import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryCarbs import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal -import info.nightscout.androidaps.utils.FabricPrivacy +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.pump.ManufacturerType +import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.events.EventCustomActionsChanged +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import org.json.JSONException import org.json.JSONObject diff --git a/settings.gradle b/settings.gradle index 44e623fd1d..2547623dd4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,6 +2,7 @@ include ':app' include ':wear' include ':database' include ':core:core-main' +include ':core:fabric' include ':app-wear-shared:rx' include ':app-wear-shared:shared' include ':app-wear-shared:shared-impl' diff --git a/ui/build.gradle b/ui/build.gradle index 431f59397b..23491ad85b 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -22,5 +22,6 @@ dependencies { implementation project(':app-wear-shared:shared') implementation project(':database') implementation project(':core:core-main') + implementation project(':core:fabric') implementation project(':interfaces') } \ No newline at end of file diff --git a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt index 3e4c485afe..4e1933517f 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator import info.nightscout.androidaps.interfaces.stats.TddCalculator import info.nightscout.androidaps.interfaces.stats.TirCalculator import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers import info.nightscout.ui.R import info.nightscout.ui.databinding.ActivityStatsBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt index a2ba838417..73d40f1253 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/SurveyActivity.kt @@ -7,7 +7,6 @@ import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.stats.TddCalculator -import info.nightscout.androidaps.utils.InstanceId import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.SafeParse import info.nightscout.shared.utils.DateUtil @@ -31,7 +30,7 @@ class SurveyActivity : NoSplashAppCompatActivity() { binding = ActivitySurveyBinding.inflate(layoutInflater) setContentView(binding.root) - binding.id.text = InstanceId.instanceId + binding.id.text = info.nightscout.core.fabric.InstanceId.instanceId val profileStore = activePlugin.activeProfileSource.profile val profileList = profileStore?.getProfileList() ?: return @@ -70,7 +69,7 @@ class SurveyActivity : NoSplashAppCompatActivity() { binding.submit.setOnClickListener { val r = FirebaseRecord() - r.id = InstanceId.instanceId + r.id = info.nightscout.core.fabric.InstanceId.instanceId r.age = SafeParse.stringToInt(binding.age.text.toString()) r.weight = SafeParse.stringToInt(binding.weight.text.toString()) if (r.age < 1 || r.age > 120) { diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index 9411291005..c716e7dab4 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -15,22 +15,22 @@ import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.core.main.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.TotalDailyDose -import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.total import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.main.R import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback -import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.shared.utils.T import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.shared.SafeParse import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.T import info.nightscout.ui.databinding.ActivityTddStatsBinding import io.reactivex.rxjava3.disposables.CompositeDisposable import java.text.DateFormat diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index 4b58fcd6f6..91d375a83e 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -29,17 +29,13 @@ import info.nightscout.androidaps.database.transactions.InvalidateBolusTransacti import info.nightscout.androidaps.database.transactions.InvalidateCarbsTransaction import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.iobCalc -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin 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.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -47,7 +43,11 @@ import info.nightscout.rx.events.EventNSClientRestart import info.nightscout.rx.events.EventTreatmentChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.databinding.TreatmentsBolusCarbsFragmentBinding import info.nightscout.ui.databinding.TreatmentsBolusCarbsItemBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt index 8fdac45234..20c633edc4 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -21,16 +21,12 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InvalidateAAPSStartedTherapyEventTransaction import info.nightscout.androidaps.database.transactions.InvalidateTherapyEventTransaction -import info.nightscout.shared.extensions.toVisibility -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.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -38,7 +34,11 @@ import info.nightscout.rx.events.EventNSClientRestart import info.nightscout.rx.events.EventTherapyEventChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsCareportalFragment.RecyclerViewAdapter.TherapyEventsViewHolder import info.nightscout.ui.databinding.TreatmentsCareportalFragmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt index 87ffa156e9..bdc86cc466 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -3,14 +3,18 @@ package info.nightscout.ui.activities.fragments import android.annotation.SuppressLint import android.os.Bundle import android.util.SparseArray -import android.view.* +import android.view.LayoutInflater +import android.view.Menu +import android.view.MenuInflater +import android.view.MenuItem +import android.view.View +import android.view.ViewGroup import androidx.core.util.forEach import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.ui.activities.fragments.TreatmentsExtendedBolusesFragment.RecyclerViewAdapter.ExtendedBolusesViewHolder import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.entities.ExtendedBolus import info.nightscout.androidaps.database.entities.UserEntry.Action @@ -18,26 +22,26 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.database.transactions.InvalidateExtendedBolusTransaction -import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.isInProgress -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.rx.bus.RxBus 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.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.R +import info.nightscout.ui.activities.fragments.TreatmentsExtendedBolusesFragment.RecyclerViewAdapter.ExtendedBolusesViewHolder import info.nightscout.ui.databinding.TreatmentsExtendedbolusFragmentBinding import info.nightscout.ui.databinding.TreatmentsExtendedbolusItemBinding import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 6b513d45fc..4761dfbb33 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -25,17 +25,13 @@ import info.nightscout.androidaps.database.transactions.InvalidateProfileSwitchT import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewHistoryData -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -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.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.getCustomizedName +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -44,7 +40,11 @@ import info.nightscout.rx.events.EventNSClientRestart import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsProfileSwitchFragment.RecyclerProfileViewAdapter.ProfileSwitchViewHolder import info.nightscout.ui.databinding.TreatmentsProfileswitchFragmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt index a2c45426b1..e56ab42886 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -28,17 +28,13 @@ import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.friendlyDescription import info.nightscout.androidaps.extensions.highValueToUnitsToString import info.nightscout.androidaps.extensions.lowValueToUnitsToString -import info.nightscout.shared.extensions.toVisibility 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.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus @@ -47,7 +43,11 @@ import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.events.EventTempTargetChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsTempTargetFragment.RecyclerViewAdapter.TempTargetsViewHolder import info.nightscout.ui.databinding.TreatmentsTemptargetFragmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 331c1d000c..2a5298df25 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -26,26 +26,25 @@ import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.database.transactions.InvalidateExtendedBolusTransaction import info.nightscout.androidaps.database.transactions.InvalidateTemporaryBasalTransaction -import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.extensions.toTemporaryBasal -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.rx.bus.RxBus 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.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.events.EventTempBasalChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.activities.fragments.TreatmentsTemporaryBasalsFragment.RecyclerViewAdapter.TempBasalsViewHolder import info.nightscout.ui.databinding.TreatmentsTempbasalsFragmentBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index fbcc9eabbe..60e7a27fd5 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -17,19 +17,19 @@ import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.rx.bus.RxBus -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.androidaps.utils.alertDialogs.OKDialog -import info.nightscout.rx.AapsSchedulers import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper +import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.ImportExportPrefs +import info.nightscout.rx.AapsSchedulers +import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.databinding.TreatmentsUserEntryFragmentBinding import info.nightscout.ui.databinding.TreatmentsUserEntryItemBinding diff --git a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index e4d3ebdd2e..693e5b0a30 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -10,12 +10,12 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import org.junit.Before import org.mockito.ArgumentMatchers.anyDouble From f870a747967f269b69104a023d549b492826040b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 9 Nov 2022 16:49:36 +0100 Subject: [PATCH 22/42] :database:impl --- app/build.gradle | 2 +- automation/build.gradle | 2 +- core/core-main/build.gradle | 2 +- database/{ => impl}/.gitignore | 0 database/{ => impl}/build.gradle | 0 database/{ => impl}/consumer-rules.pro | 0 database/{ => impl}/proguard-rules.pro | 0 .../info.nightscout.androidaps.database.AppDatabase/1.json | 0 .../info.nightscout.androidaps.database.AppDatabase/10.json | 0 .../info.nightscout.androidaps.database.AppDatabase/11.json | 0 .../info.nightscout.androidaps.database.AppDatabase/12.json | 0 .../info.nightscout.androidaps.database.AppDatabase/14.json | 0 .../info.nightscout.androidaps.database.AppDatabase/15.json | 0 .../info.nightscout.androidaps.database.AppDatabase/16.json | 0 .../info.nightscout.androidaps.database.AppDatabase/18.json | 0 .../info.nightscout.androidaps.database.AppDatabase/2.json | 0 .../info.nightscout.androidaps.database.AppDatabase/20.json | 0 .../info.nightscout.androidaps.database.AppDatabase/21.json | 0 .../info.nightscout.androidaps.database.AppDatabase/22.json | 0 .../info.nightscout.androidaps.database.AppDatabase/4.json | 0 .../info.nightscout.androidaps.database.AppDatabase/5.json | 0 .../info.nightscout.androidaps.database.AppDatabase/6.json | 0 .../info.nightscout.androidaps.database.AppDatabase/7.json | 0 .../info.nightscout.androidaps.database.AppDatabase/8.json | 0 .../info.nightscout.androidaps.database.AppDatabase/9.json | 0 .../info/nightscout/androidaps/annotations/DbOpenForTesting.kt | 0 database/{ => impl}/src/main/AndroidManifest.xml | 0 .../java/info/nightscout/androidaps/database/AppDatabase.kt | 0 .../java/info/nightscout/androidaps/database/AppRepository.kt | 0 .../main/java/info/nightscout/androidaps/database/Converters.kt | 0 .../java/info/nightscout/androidaps/database/DatabaseModule.kt | 0 .../info/nightscout/androidaps/database/DelegatedAppDatabase.kt | 0 .../main/java/info/nightscout/androidaps/database/TableNames.kt | 0 .../info/nightscout/androidaps/database/daos/APSResultDao.kt | 0 .../nightscout/androidaps/database/daos/APSResultLinkDao.kt | 0 .../androidaps/database/daos/BolusCalculatorResultDao.kt | 0 .../java/info/nightscout/androidaps/database/daos/BolusDao.kt | 0 .../java/info/nightscout/androidaps/database/daos/CarbsDao.kt | 0 .../info/nightscout/androidaps/database/daos/DeviceStatusDao.kt | 0 .../androidaps/database/daos/EffectiveProfileSwitchDao.kt | 0 .../nightscout/androidaps/database/daos/ExtendedBolusDao.kt | 0 .../java/info/nightscout/androidaps/database/daos/FoodDao.kt | 0 .../info/nightscout/androidaps/database/daos/GlucoseValueDao.kt | 0 .../androidaps/database/daos/MultiwaveBolusLinkDao.kt | 0 .../info/nightscout/androidaps/database/daos/OfflineEventDao.kt | 0 .../nightscout/androidaps/database/daos/PreferenceChangeDao.kt | 0 .../nightscout/androidaps/database/daos/ProfileSwitchDao.kt | 0 .../nightscout/androidaps/database/daos/TemporaryBasalDao.kt | 0 .../nightscout/androidaps/database/daos/TemporaryTargetDao.kt | 0 .../info/nightscout/androidaps/database/daos/TherapyEventDao.kt | 0 .../nightscout/androidaps/database/daos/TotalDailyDoseDao.kt | 0 .../info/nightscout/androidaps/database/daos/TraceableDao.kt | 0 .../info/nightscout/androidaps/database/daos/UserEntryDao.kt | 0 .../nightscout/androidaps/database/daos/VersionChangeDao.kt | 0 .../androidaps/database/daos/delegated/DelegatedAPSResultDao.kt | 0 .../database/daos/delegated/DelegatedAPSResultLinkDao.kt | 0 .../daos/delegated/DelegatedBolusCalculatorResultDao.kt | 0 .../androidaps/database/daos/delegated/DelegatedBolusDao.kt | 0 .../androidaps/database/daos/delegated/DelegatedCarbsDao.kt | 0 .../androidaps/database/daos/delegated/DelegatedDao.kt | 0 .../database/daos/delegated/DelegatedDeviceStatusDao.kt | 0 .../daos/delegated/DelegatedEffectiveProfileSwitchDao.kt | 0 .../database/daos/delegated/DelegatedExtendedBolusDao.kt | 0 .../androidaps/database/daos/delegated/DelegatedFoodDao.kt | 0 .../database/daos/delegated/DelegatedGlucoseValueDao.kt | 0 .../database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt | 0 .../database/daos/delegated/DelegatedOfflineEventDao.kt | 0 .../database/daos/delegated/DelegatedPreferenceChangeDao.kt | 0 .../database/daos/delegated/DelegatedProfileSwitchDao.kt | 0 .../database/daos/delegated/DelegatedTemporaryBasalDao.kt | 0 .../database/daos/delegated/DelegatedTemporaryTargetDao.kt | 0 .../database/daos/delegated/DelegatedTherapyEventDao.kt | 0 .../database/daos/delegated/DelegatedTotalDailyDoseDao.kt | 0 .../androidaps/database/daos/delegated/DelegatedUserEntryDao.kt | 0 .../database/daos/delegated/DelegatedVersionChangeDao.kt | 0 .../database/daos/workaround/ProfileSwitchDaoWorkaround.java | 0 .../database/daos/workaround/TraceableDaoWorkaround.java | 0 .../androidaps/database/daos/workaround/package-info.java | 0 .../main/java/info/nightscout/androidaps/database/data/Block.kt | 0 .../java/info/nightscout/androidaps/database/data/NewEntries.kt | 0 .../info/nightscout/androidaps/database/data/TargetBlock.kt | 0 .../androidaps/database/embedments/InsulinConfiguration.kt | 0 .../nightscout/androidaps/database/embedments/InterfaceIDs.kt | 0 .../info/nightscout/androidaps/database/entities/APSResult.kt | 0 .../nightscout/androidaps/database/entities/APSResultLink.kt | 0 .../java/info/nightscout/androidaps/database/entities/Bolus.kt | 0 .../androidaps/database/entities/BolusCalculatorResult.kt | 0 .../java/info/nightscout/androidaps/database/entities/Carbs.kt | 0 .../nightscout/androidaps/database/entities/DeviceStatus.kt | 0 .../androidaps/database/entities/EffectiveProfileSwitch.kt | 0 .../nightscout/androidaps/database/entities/ExtendedBolus.kt | 0 .../java/info/nightscout/androidaps/database/entities/Food.kt | 0 .../nightscout/androidaps/database/entities/GlucoseValue.kt | 0 .../androidaps/database/entities/MultiwaveBolusLink.kt | 0 .../nightscout/androidaps/database/entities/OfflineEvent.kt | 0 .../nightscout/androidaps/database/entities/PreferenceChange.kt | 0 .../nightscout/androidaps/database/entities/ProfileSwitch.kt | 0 .../nightscout/androidaps/database/entities/TemporaryBasal.kt | 0 .../nightscout/androidaps/database/entities/TemporaryTarget.kt | 0 .../nightscout/androidaps/database/entities/TherapyEvent.kt | 0 .../nightscout/androidaps/database/entities/TotalDailyDose.kt | 0 .../info/nightscout/androidaps/database/entities/UserEntry.kt | 0 .../nightscout/androidaps/database/entities/ValueWithUnit.kt | 0 .../nightscout/androidaps/database/entities/VersionChange.kt | 0 .../info/nightscout/androidaps/database/interfaces/DBEntry.kt | 0 .../androidaps/database/interfaces/DBEntryWithDuration.kt | 0 .../androidaps/database/interfaces/DBEntryWithTime.kt | 0 .../database/interfaces/DBEntryWithTimeAndDuration.kt | 0 .../androidaps/database/interfaces/TraceableDBEntry.kt | 0 .../androidaps/database/serialisation/SealedClassHelper.kt | 0 .../transactions/CancelCurrentOfflineEventIfAnyTransaction.kt | 0 .../CancelCurrentTemporaryTargetIfAnyTransaction.kt | 0 .../androidaps/database/transactions/CgmSourceTransaction.kt | 0 .../androidaps/database/transactions/CutCarbsTransaction.kt | 0 .../InsertAndCancelCurrentOfflineEventTransaction.kt | 0 .../InsertAndCancelCurrentTemporaryTargetTransaction.kt | 0 .../database/transactions/InsertBolusWithTempIdTransaction.kt | 0 .../database/transactions/InsertGlucoseValueTransaction.kt | 0 .../transactions/InsertIfNewByTimestampCarbsTransaction.kt | 0 .../InsertIfNewByTimestampTherapyEventTransaction.kt | 0 .../InsertOrUpdateBolusCalculatorResultTransaction.kt | 0 .../database/transactions/InsertOrUpdateBolusTransaction.kt | 0 .../database/transactions/InsertOrUpdateCarbsTransaction.kt | 0 .../database/transactions/InsertOrUpdateFoodTransaction.kt | 0 .../database/transactions/InsertOrUpdateProfileSwitch.kt | 0 .../transactions/InsertTemporaryBasalWithTempIdTransaction.kt | 0 .../transactions/InsertTherapyEventAnnouncementTransaction.kt | 0 .../InvalidateAAPSStartedTherapyEventTransaction.kt | 0 .../transactions/InvalidateBolusCalculatorResultTransaction.kt | 0 .../database/transactions/InvalidateBolusTransaction.kt | 0 .../database/transactions/InvalidateCarbsTransaction.kt | 0 .../database/transactions/InvalidateExtendedBolusTransaction.kt | 0 .../database/transactions/InvalidateFoodTransaction.kt | 0 .../database/transactions/InvalidateGlucoseValueTransaction.kt | 0 .../transactions/InvalidateNsIdProfileSwitchTransaction.kt | 0 .../database/transactions/InvalidateOfflineEventTransaction.kt | 0 .../database/transactions/InvalidateProfileSwitchTransaction.kt | 0 .../transactions/InvalidateTemporaryBasalTransaction.kt | 0 .../InvalidateTemporaryBasalTransactionWithPumpId.kt | 0 .../InvalidateTemporaryBasalWithTempIdTransaction.kt | 0 .../transactions/InvalidateTemporaryTargetTransaction.kt | 0 .../database/transactions/InvalidateTherapyEventTransaction.kt | 0 .../database/transactions/SyncBolusWithTempIdTransaction.kt | 0 .../transactions/SyncNsBolusCalculatorResultTransaction.kt | 0 .../androidaps/database/transactions/SyncNsBolusTransaction.kt | 0 .../androidaps/database/transactions/SyncNsCarbsTransaction.kt | 0 .../transactions/SyncNsEffectiveProfileSwitchTransaction.kt | 0 .../database/transactions/SyncNsExtendedBolusTransaction.kt | 0 .../androidaps/database/transactions/SyncNsFoodTransaction.kt | 0 .../database/transactions/SyncNsOfflineEventTransaction.kt | 0 .../database/transactions/SyncNsProfileSwitchTransaction.kt | 0 .../database/transactions/SyncNsTemporaryBasalTransaction.kt | 0 .../database/transactions/SyncNsTemporaryTargetTransaction.kt | 0 .../database/transactions/SyncNsTherapyEventTransaction.kt | 0 .../database/transactions/SyncPumpBolusTransaction.kt | 0 .../transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt | 0 .../SyncPumpCancelTemporaryBasalIfAnyTransaction.kt | 0 .../database/transactions/SyncPumpExtendedBolusTransaction.kt | 0 .../database/transactions/SyncPumpTemporaryBasalTransaction.kt | 0 .../database/transactions/SyncPumpTotalDailyDoseTransaction.kt | 0 .../transactions/SyncTemporaryBasalWithTempIdTransaction.kt | 0 .../nightscout/androidaps/database/transactions/Transaction.kt | 0 .../database/transactions/UpdateGlucoseValueTransaction.kt | 0 .../transactions/UpdateNsIdBolusCalculatorResultTransaction.kt | 0 .../database/transactions/UpdateNsIdBolusTransaction.kt | 0 .../database/transactions/UpdateNsIdCarbsTransaction.kt | 0 .../database/transactions/UpdateNsIdDeviceStatusTransaction.kt | 0 .../transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt | 0 .../database/transactions/UpdateNsIdExtendedBolusTransaction.kt | 0 .../database/transactions/UpdateNsIdFoodTransaction.kt | 0 .../database/transactions/UpdateNsIdGlucoseValueTransaction.kt | 0 .../database/transactions/UpdateNsIdOfflineEventTransaction.kt | 0 .../database/transactions/UpdateNsIdProfileSwitchTransaction.kt | 0 .../transactions/UpdateNsIdTemporaryBasalTransaction.kt | 0 .../transactions/UpdateNsIdTemporaryTargetTransaction.kt | 0 .../database/transactions/UpdateNsIdTherapyEventTransaction.kt | 0 .../androidaps/database/transactions/UserEntryTransaction.kt | 0 .../database/transactions/VersionChangeTransaction.kt | 0 .../info/nightscout/androidaps/annotations/DbOpenForTesting.kt | 0 implementation/build.gradle | 2 +- openhumans/build.gradle | 2 +- plugins/build.gradle | 2 +- pump/eopatch/build.gradle | 2 +- pump/omnipod-dash/build.gradle | 2 +- pump/omnipod-eros/build.gradle | 2 +- settings.gradle | 2 +- ui/build.gradle | 2 +- 187 files changed, 11 insertions(+), 11 deletions(-) rename database/{ => impl}/.gitignore (100%) rename database/{ => impl}/build.gradle (100%) rename database/{ => impl}/consumer-rules.pro (100%) rename database/{ => impl}/proguard-rules.pro (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/1.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/10.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/11.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/12.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/14.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/15.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/16.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/18.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/2.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/20.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/21.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/22.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/4.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/5.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/6.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/7.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/8.json (100%) rename database/{ => impl}/schemas/info.nightscout.androidaps.database.AppDatabase/9.json (100%) rename database/{ => impl}/src/debug/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt (100%) rename database/{ => impl}/src/main/AndroidManifest.xml (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/AppRepository.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/Converters.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/DatabaseModule.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/TableNames.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/APSResultDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/APSResultLinkDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/MultiwaveBolusLinkDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/TraceableDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultLinkDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusCalculatorResultDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedCarbsDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedExtendedBolusDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedFoodDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedGlucoseValueDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedOfflineEventDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedPreferenceChangeDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedProfileSwitchDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryBasalDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryTargetDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTherapyEventDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTotalDailyDoseDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedUserEntryDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedVersionChangeDao.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/workaround/ProfileSwitchDaoWorkaround.java (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/workaround/TraceableDaoWorkaround.java (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/daos/workaround/package-info.java (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/data/Block.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/data/TargetBlock.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/embedments/InsulinConfiguration.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/embedments/InterfaceIDs.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/APSResult.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/Bolus.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/BolusCalculatorResult.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/Carbs.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/DeviceStatus.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/EffectiveProfileSwitch.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/ExtendedBolus.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/Food.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/GlucoseValue.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/OfflineEvent.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/PreferenceChange.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/ProfileSwitch.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/TemporaryBasal.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/TemporaryTarget.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/TotalDailyDose.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/ValueWithUnit.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/entities/VersionChange.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithDuration.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTime.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTimeAndDuration.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/interfaces/TraceableDBEntry.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/CutCarbsTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertBolusWithTempIdTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertGlucoseValueTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampCarbsTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateCarbsTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateFoodTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateProfileSwitch.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertTemporaryBasalWithTempIdTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InsertTherapyEventAnnouncementTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusCalculatorResultTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateCarbsTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateExtendedBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateFoodTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateGlucoseValueTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateNsIdProfileSwitchTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateOfflineEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateProfileSwitchTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryTargetTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTherapyEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsFoodTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpExtendedBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTemporaryBasalTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTotalDailyDoseTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryBasalWithTempIdTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/Transaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateGlucoseValueTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdCarbsTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdDeviceStatusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdExtendedBolusTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdFoodTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdGlucoseValueTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdOfflineEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdProfileSwitchTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryBasalTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryTargetTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTherapyEventTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt (100%) rename database/{ => impl}/src/main/java/info/nightscout/androidaps/database/transactions/VersionChangeTransaction.kt (100%) rename database/{ => impl}/src/release/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt (100%) diff --git a/app/build.gradle b/app/build.gradle index aaacccb505..7fb11a0e7d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -191,7 +191,7 @@ dependencies { implementation project(':ui') implementation project(':plugins') implementation project(':implementation') - implementation project(':database') + implementation project(':database:impl') implementation project(':pump:combo') implementation project(':pump:dana') implementation project(':pump:danars') diff --git a/automation/build.gradle b/automation/build.gradle index e34784b81f..b19cd3347b 100644 --- a/automation/build.gradle +++ b/automation/build.gradle @@ -20,7 +20,7 @@ dependencies { implementation project(':graphview') implementation project(':core:core-main') implementation project(':core:fabric') - implementation project(':database') + implementation project(':database:impl') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':interfaces') diff --git a/core/core-main/build.gradle b/core/core-main/build.gradle index a001098465..45cb57f011 100644 --- a/core/core-main/build.gradle +++ b/core/core-main/build.gradle @@ -17,7 +17,7 @@ dependencies { implementation project(':graphview') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') - implementation project(':database') + implementation project(':database:impl') implementation project(':interfaces') api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" diff --git a/database/.gitignore b/database/impl/.gitignore similarity index 100% rename from database/.gitignore rename to database/impl/.gitignore diff --git a/database/build.gradle b/database/impl/build.gradle similarity index 100% rename from database/build.gradle rename to database/impl/build.gradle diff --git a/database/consumer-rules.pro b/database/impl/consumer-rules.pro similarity index 100% rename from database/consumer-rules.pro rename to database/impl/consumer-rules.pro diff --git a/database/proguard-rules.pro b/database/impl/proguard-rules.pro similarity index 100% rename from database/proguard-rules.pro rename to database/impl/proguard-rules.pro diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/1.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/1.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/1.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/1.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/10.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/10.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/10.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/10.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/11.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/11.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/11.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/11.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/12.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/12.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/12.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/12.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/14.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/14.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/14.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/14.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/15.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/15.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/15.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/15.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/16.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/16.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/16.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/16.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/18.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/18.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/18.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/18.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/2.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/2.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/2.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/2.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/20.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/20.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/20.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/20.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/21.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/21.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/21.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/21.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/22.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/22.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/22.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/22.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/4.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/4.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/4.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/4.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/5.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/5.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/5.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/5.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/6.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/6.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/6.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/6.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/7.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/7.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/7.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/7.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/8.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/8.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/8.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/8.json diff --git a/database/schemas/info.nightscout.androidaps.database.AppDatabase/9.json b/database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/9.json similarity index 100% rename from database/schemas/info.nightscout.androidaps.database.AppDatabase/9.json rename to database/impl/schemas/info.nightscout.androidaps.database.AppDatabase/9.json diff --git a/database/src/debug/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt b/database/impl/src/debug/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt similarity index 100% rename from database/src/debug/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt rename to database/impl/src/debug/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt diff --git a/database/src/main/AndroidManifest.xml b/database/impl/src/main/AndroidManifest.xml similarity index 100% rename from database/src/main/AndroidManifest.xml rename to database/impl/src/main/AndroidManifest.xml diff --git a/database/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/AppRepository.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/AppRepository.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/Converters.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/Converters.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/Converters.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/Converters.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/DatabaseModule.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/DatabaseModule.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/DatabaseModule.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/DatabaseModule.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/TableNames.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/TableNames.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/TableNames.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/TableNames.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/APSResultDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/APSResultDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/APSResultLinkDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultLinkDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/APSResultLinkDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultLinkDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/MultiwaveBolusLinkDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/MultiwaveBolusLinkDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/MultiwaveBolusLinkDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/MultiwaveBolusLinkDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TraceableDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TraceableDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/TraceableDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/TraceableDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultLinkDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultLinkDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultLinkDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultLinkDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusCalculatorResultDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusCalculatorResultDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusCalculatorResultDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusCalculatorResultDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedCarbsDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedCarbsDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedCarbsDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedCarbsDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedExtendedBolusDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedExtendedBolusDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedExtendedBolusDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedExtendedBolusDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedFoodDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedFoodDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedFoodDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedFoodDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedGlucoseValueDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedGlucoseValueDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedGlucoseValueDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedGlucoseValueDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedOfflineEventDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedOfflineEventDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedOfflineEventDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedOfflineEventDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedPreferenceChangeDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedPreferenceChangeDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedPreferenceChangeDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedPreferenceChangeDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedProfileSwitchDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedProfileSwitchDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedProfileSwitchDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryBasalDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryBasalDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryBasalDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryBasalDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryTargetDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryTargetDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryTargetDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryTargetDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTherapyEventDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTherapyEventDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTherapyEventDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTherapyEventDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTotalDailyDoseDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTotalDailyDoseDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTotalDailyDoseDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTotalDailyDoseDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedUserEntryDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedUserEntryDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedUserEntryDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedUserEntryDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedVersionChangeDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedVersionChangeDao.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedVersionChangeDao.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedVersionChangeDao.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/workaround/ProfileSwitchDaoWorkaround.java b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/ProfileSwitchDaoWorkaround.java similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/workaround/ProfileSwitchDaoWorkaround.java rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/ProfileSwitchDaoWorkaround.java diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/workaround/TraceableDaoWorkaround.java b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/TraceableDaoWorkaround.java similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/workaround/TraceableDaoWorkaround.java rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/TraceableDaoWorkaround.java diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/workaround/package-info.java b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/package-info.java similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/daos/workaround/package-info.java rename to database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/package-info.java diff --git a/database/src/main/java/info/nightscout/androidaps/database/data/Block.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/data/Block.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/data/Block.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/data/Block.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/data/TargetBlock.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/data/TargetBlock.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/data/TargetBlock.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/data/TargetBlock.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/embedments/InsulinConfiguration.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InsulinConfiguration.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/embedments/InsulinConfiguration.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InsulinConfiguration.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/embedments/InterfaceIDs.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InterfaceIDs.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/embedments/InterfaceIDs.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InterfaceIDs.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/APSResult.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResult.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/APSResult.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResult.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/Bolus.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Bolus.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/Bolus.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/Bolus.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/BolusCalculatorResult.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/BolusCalculatorResult.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/BolusCalculatorResult.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/BolusCalculatorResult.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/Carbs.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Carbs.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/Carbs.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/Carbs.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/DeviceStatus.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/DeviceStatus.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/DeviceStatus.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/DeviceStatus.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/EffectiveProfileSwitch.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/EffectiveProfileSwitch.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/EffectiveProfileSwitch.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/EffectiveProfileSwitch.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/ExtendedBolus.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ExtendedBolus.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/ExtendedBolus.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/ExtendedBolus.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/Food.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Food.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/Food.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/Food.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/GlucoseValue.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/GlucoseValue.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/GlucoseValue.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/GlucoseValue.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/OfflineEvent.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/OfflineEvent.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/OfflineEvent.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/OfflineEvent.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/PreferenceChange.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/PreferenceChange.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/PreferenceChange.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/PreferenceChange.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/ProfileSwitch.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ProfileSwitch.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/ProfileSwitch.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/ProfileSwitch.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/TemporaryBasal.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryBasal.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/TemporaryBasal.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryBasal.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/TemporaryTarget.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryTarget.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/TemporaryTarget.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryTarget.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/TotalDailyDose.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TotalDailyDose.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/TotalDailyDose.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/TotalDailyDose.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/ValueWithUnit.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ValueWithUnit.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/ValueWithUnit.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/ValueWithUnit.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/entities/VersionChange.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/VersionChange.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/entities/VersionChange.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/entities/VersionChange.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithDuration.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithDuration.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithDuration.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithDuration.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTime.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTime.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTime.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTime.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTimeAndDuration.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTimeAndDuration.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTimeAndDuration.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTimeAndDuration.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/interfaces/TraceableDBEntry.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/TraceableDBEntry.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/interfaces/TraceableDBEntry.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/TraceableDBEntry.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/CutCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CutCarbsTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/CutCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CutCarbsTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertBolusWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertBolusWithTempIdTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertBolusWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertBolusWithTempIdTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertGlucoseValueTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertGlucoseValueTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertGlucoseValueTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampCarbsTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampCarbsTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateCarbsTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateCarbsTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateFoodTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateFoodTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateFoodTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateProfileSwitch.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateProfileSwitch.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateProfileSwitch.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateProfileSwitch.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTemporaryBasalWithTempIdTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertTemporaryBasalWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTemporaryBasalWithTempIdTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InsertTherapyEventAnnouncementTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTherapyEventAnnouncementTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InsertTherapyEventAnnouncementTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTherapyEventAnnouncementTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusCalculatorResultTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusCalculatorResultTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusCalculatorResultTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateCarbsTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateCarbsTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateExtendedBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateExtendedBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateExtendedBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateFoodTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateFoodTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateFoodTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateGlucoseValueTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateGlucoseValueTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateGlucoseValueTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateNsIdProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateNsIdProfileSwitchTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateNsIdProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateNsIdProfileSwitchTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateOfflineEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateOfflineEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateOfflineEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateProfileSwitchTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateProfileSwitchTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryTargetTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryTargetTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryTargetTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTherapyEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTherapyEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsFoodTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsFoodTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsFoodTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpExtendedBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpExtendedBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpExtendedBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTemporaryBasalTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTemporaryBasalTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTemporaryBasalTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTotalDailyDoseTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTotalDailyDoseTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTotalDailyDoseTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTotalDailyDoseTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryBasalWithTempIdTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryBasalWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryBasalWithTempIdTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/Transaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/Transaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/Transaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/Transaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateGlucoseValueTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateGlucoseValueTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateGlucoseValueTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdCarbsTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdCarbsTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdDeviceStatusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdDeviceStatusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdDeviceStatusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdDeviceStatusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdExtendedBolusTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdExtendedBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdExtendedBolusTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdFoodTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdFoodTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdFoodTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdGlucoseValueTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdGlucoseValueTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdGlucoseValueTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdOfflineEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdOfflineEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdOfflineEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdProfileSwitchTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdProfileSwitchTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryBasalTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryBasalTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryBasalTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryTargetTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryTargetTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryTargetTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTherapyEventTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTherapyEventTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt diff --git a/database/src/main/java/info/nightscout/androidaps/database/transactions/VersionChangeTransaction.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/VersionChangeTransaction.kt similarity index 100% rename from database/src/main/java/info/nightscout/androidaps/database/transactions/VersionChangeTransaction.kt rename to database/impl/src/main/java/info/nightscout/androidaps/database/transactions/VersionChangeTransaction.kt diff --git a/database/src/release/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt b/database/impl/src/release/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt similarity index 100% rename from database/src/release/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt rename to database/impl/src/release/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt diff --git a/implementation/build.gradle b/implementation/build.gradle index 9f8d8e7a7c..21b9282f74 100644 --- a/implementation/build.gradle +++ b/implementation/build.gradle @@ -18,7 +18,7 @@ android { dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') - implementation project(':database') + implementation project(':database:impl') implementation project(':automation') implementation project(':interfaces') implementation project(':core:core-main') diff --git a/openhumans/build.gradle b/openhumans/build.gradle index 5e9a0b01f2..e6736d3ad3 100644 --- a/openhumans/build.gradle +++ b/openhumans/build.gradle @@ -18,7 +18,7 @@ android { dependencies { implementation project(':core:core-main') - implementation project(':database') + implementation project(':database:impl') implementation project(':interfaces') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/plugins/build.gradle b/plugins/build.gradle index 1c771254e2..2578589722 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -18,7 +18,7 @@ android { dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') - implementation project(':database') + implementation project(':database:impl') implementation project(':graphview') implementation project(':core:core-main') implementation project(':core:fabric') diff --git a/pump/eopatch/build.gradle b/pump/eopatch/build.gradle index e8c8b6a3f7..e78198d09d 100644 --- a/pump/eopatch/build.gradle +++ b/pump/eopatch/build.gradle @@ -24,7 +24,7 @@ dependencies { implementation project(':libraries') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') - implementation project(':database') + implementation project(':database:impl') implementation project(':core:core-main') implementation project(':core:fabric') implementation project(':interfaces') diff --git a/pump/omnipod-dash/build.gradle b/pump/omnipod-dash/build.gradle index 7d43659091..141bc8d846 100644 --- a/pump/omnipod-dash/build.gradle +++ b/pump/omnipod-dash/build.gradle @@ -33,7 +33,7 @@ android { } dependencies { - implementation project(':database') + implementation project(':database:impl') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':libraries') diff --git a/pump/omnipod-eros/build.gradle b/pump/omnipod-eros/build.gradle index c486f714d4..cbf0d8cb7e 100644 --- a/pump/omnipod-eros/build.gradle +++ b/pump/omnipod-eros/build.gradle @@ -26,7 +26,7 @@ android { } dependencies { - implementation project(':database') + implementation project(':database:impl') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') implementation project(':libraries') diff --git a/settings.gradle b/settings.gradle index 2547623dd4..32c50837b6 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,6 @@ include ':app' include ':wear' -include ':database' +include ':database:impl' include ':core:core-main' include ':core:fabric' include ':app-wear-shared:rx' diff --git a/ui/build.gradle b/ui/build.gradle index 23491ad85b..1d4809a88c 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -20,7 +20,7 @@ dependencies { implementation project(':graphview') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') - implementation project(':database') + implementation project(':database:impl') implementation project(':core:core-main') implementation project(':core:fabric') implementation project(':interfaces') From 253601980d8d61a3b227b00a82a39b106ec22b7b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 9 Nov 2022 23:28:48 +0100 Subject: [PATCH 23/42] :database:entities --- app/build.gradle | 2 + .../nightscout/androidaps/MainActivity.kt | 4 +- .../info/nightscout/androidaps/MainApp.kt | 14 +-- .../activities/HistoryBrowserData.kt | 2 +- .../activities/ProfileHelperActivity.kt | 4 +- .../androidaps/db/CompatDBHelper.kt | 24 ++--- .../nightscout/androidaps/di/AppComponent.kt | 4 +- .../nightscout/androidaps/di/AppModule.kt | 2 +- .../androidaps/dialogs/ExtendedBolusDialog.kt | 16 +-- .../androidaps/dialogs/FillDialog.kt | 22 ++--- .../androidaps/dialogs/InsulinDialog.kt | 32 +++--- .../androidaps/dialogs/LoopDialog.kt | 14 +-- .../androidaps/dialogs/ProfileSwitchDialog.kt | 24 ++--- .../androidaps/dialogs/TempBasalDialog.kt | 26 ++--- .../androidaps/dialogs/TempTargetDialog.kt | 37 +++---- .../androidaps/dialogs/TreatmentDialog.kt | 32 +++--- .../androidaps/dialogs/WizardDialog.kt | 4 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 16 +-- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 4 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 4 +- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 2 +- .../OpenAPSSMBDynamicISFPlugin.kt | 2 +- .../configBuilder/ConfigBuilderPlugin.kt | 12 +-- .../configBuilder/ProfileFunctionImpl.kt | 8 +- .../objectives/ObjectivesFragment.kt | 6 +- .../objectives/objectives/Objective0.kt | 4 +- .../general/actions/ActionsFragment.kt | 8 +- .../maintenance/ImportExportPrefsImpl.kt | 40 ++++---- .../maintenance/MaintenanceFragment.kt | 6 +- .../general/overview/OverviewFragment.kt | 8 +- .../general/overview/StatusLightHandler.kt | 14 +-- .../wear/wearintegration/DataHandlerMobile.kt | 24 ++--- .../DataLayerListenerServiceMobile.kt | 2 +- .../IobCobCalculatorPlugin.kt | 12 +-- .../iob/iobCobCalculator/IobCobOref1Worker.kt | 4 +- .../iob/iobCobCalculator/IobCobOrefWorker.kt | 2 +- .../sensitivity/SensitivityAAPSPlugin.kt | 10 +- .../sensitivity/SensitivityOref1Plugin.kt | 10 +- .../SensitivityWeightedAveragePlugin.kt | 10 +- .../androidaps/plugins/source/AidexPlugin.kt | 8 +- .../androidaps/plugins/source/DexcomPlugin.kt | 18 ++-- .../plugins/source/EversensePlugin.kt | 12 +-- .../androidaps/plugins/source/GlimpPlugin.kt | 8 +- .../plugins/source/GlunovoPlugin.kt | 12 +-- .../plugins/source/IntelligoPlugin.kt | 12 +-- .../androidaps/plugins/source/MM640gPlugin.kt | 8 +- .../plugins/source/PoctechPlugin.kt | 8 +- .../plugins/source/RandomBgPlugin.kt | 8 +- .../androidaps/plugins/source/TomatoPlugin.kt | 8 +- .../androidaps/plugins/source/XdripPlugin.kt | 8 +- .../androidaps/receivers/KeepAliveWorker.kt | 2 +- .../androidaps/utils/wizard/BolusWizard.kt | 38 +++---- .../utils/wizard/QuickWizardEntry.kt | 10 +- .../androidaps/workflow/LoadBgDataWorker.kt | 2 +- .../workflow/PrepareBgDataWorker.kt | 2 +- .../PrepareIobAutosensGraphDataWorker.kt | 4 +- .../workflow/PreparePredictionsWorker.kt | 2 +- .../PrepareTemporaryTargetDataWorker.kt | 4 +- .../workflow/PrepareTreatmentsDataWorker.kt | 14 +-- .../androidaps/TestBaseWithProfile.kt | 4 +- .../interfaces/ConstraintsCheckerTest.kt | 2 +- .../plugins/aps/loop/LoopPluginTest.kt | 2 +- .../constraints/safety/SafetyPluginTest.kt | 2 +- automation/build.gradle | 1 + .../automation/AutomationFragment.kt | 4 +- .../actions/ActionCarePortalEvent.kt | 19 ++-- .../automation/actions/ActionLoopDisable.kt | 10 +- .../automation/actions/ActionLoopEnable.kt | 10 +- .../automation/actions/ActionLoopResume.kt | 14 +-- .../automation/actions/ActionLoopSuspend.kt | 10 +- .../automation/actions/ActionNotification.kt | 4 +- .../automation/actions/ActionProfileSwitch.kt | 13 ++- .../actions/ActionProfileSwitchPercent.kt | 11 +-- .../actions/ActionStartTempTarget.kt | 25 +++-- .../actions/ActionStopTempTarget.kt | 13 ++- .../elements/InputCarePortalMenu.kt | 4 +- .../nightscout/automation/triggers/Trigger.kt | 2 +- .../automation/triggers/TriggerBolusAgo.kt | 9 +- .../automation/triggers/TriggerTempTarget.kt | 2 +- .../triggers/TriggerTempTargetValue.kt | 2 +- .../androidaps/TestBaseWithProfile.kt | 2 +- .../actions/ActionCarePortalEventTest.kt | 4 +- .../actions/ActionLoopResumeTest.kt | 8 +- .../actions/ActionNotificationTest.kt | 6 +- .../actions/ActionStartTempTargetTest.kt | 10 +- .../actions/ActionStopTempTargetTest.kt | 8 +- .../automation/actions/ActionsTestBase.kt | 14 +-- .../automation/triggers/TriggerBgTest.kt | 4 +- .../triggers/TriggerBolusAgoTest.kt | 4 +- .../automation/triggers/TriggerDeltaTest.kt | 4 +- .../triggers/TriggerTempTargetValueTest.kt | 6 +- core/core-main/build.gradle | 1 + .../androidaps/data/DetailedBolusInfo.kt | 12 +-- .../androidaps/data/InMemoryGlucoseValue.kt | 2 +- .../androidaps/data/LocalInsulin.kt | 2 +- .../androidaps/data/ProfileSealed.kt | 26 ++--- .../nightscout/androidaps/data/PureProfile.kt | 6 +- .../androidaps/dialogs/BolusProgressDialog.kt | 4 +- .../androidaps/dialogs/ErrorDialog.kt | 10 +- .../androidaps/dialogs/ProfileViewerDialog.kt | 4 +- .../EventEffectiveProfileSwitchChanged.kt | 2 +- .../androidaps/events/EventNewBG.kt | 2 +- .../androidaps/events/EventNewHistoryData.kt | 2 +- .../androidaps/extensions/BlockExtension.kt | 4 +- .../BolusCalculatorResultExtension.kt | 7 +- .../androidaps/extensions/BolusExtension.kt | 9 +- .../extensions/ExtendedBolusExtension.kt | 16 +-- .../androidaps/extensions/FoodExtension.kt | 2 +- .../extensions/GlucoseValueExtension.kt | 4 +- .../extensions/ProfileSwitchExtension.kt | 8 +- .../extensions/PumpTypeExtension.kt | 4 +- .../extensions/TemporaryBasalExtension.kt | 8 +- .../extensions/TemporaryTargetExtension.kt | 10 +- .../extensions/TherapyEventExtension.kt | 2 +- .../extensions/TotalDailyDoseExtension.kt | 4 +- .../androidaps/extensions/TrendArrowIcon.kt | 2 +- .../androidaps/extensions/UserEntryExt.kt | 2 +- .../androidaps/interfaces/BgSource.kt | 2 +- .../androidaps/interfaces/DataSyncSelector.kt | 15 ++- .../androidaps/interfaces/Insulin.kt | 6 +- .../androidaps/interfaces/IobCobCalculator.kt | 6 +- .../nightscout/androidaps/interfaces/Loop.kt | 4 +- .../androidaps/interfaces/ProfileFunction.kt | 2 +- .../androidaps/interfaces/PumpSync.kt | 2 +- .../androidaps/interfaces/TrendCalculator.kt | 2 +- .../androidaps/interfaces/XDripBroadcast.kt | 2 +- .../interfaces/stats/TddCalculator.kt | 2 +- .../androidaps/logging/UserEntryLogger.kt | 12 +-- .../androidaps/plugins/aps/loop/APSResult.kt | 13 ++- .../plugins/general/overview/OverviewData.kt | 10 +- .../graphExtensions/BolusDataPoint.kt | 6 +- .../graphExtensions/CarbsDataPoint.kt | 2 +- .../EffectiveProfileSwitchDataPoint.kt | 2 +- .../graphExtensions/ExtendedBolusDataPoint.kt | 4 +- .../graphExtensions/GlucoseValueDataPoint.kt | 10 +- .../graphExtensions/TherapyEventDataPoint.kt | 8 +- .../iob/iobCobCalculator/AutosensDataStore.kt | 8 +- .../iob/iobCobCalculator/data/AutosensData.kt | 12 +-- .../androidaps/queue/commands/Command.kt | 2 +- .../nightscout/androidaps/utils/HardLimits.kt | 4 +- .../nightscout/androidaps/utils/Translator.kt | 12 +-- .../nightscout/androidaps/utils/WarnColors.kt | 4 +- ...rialiser.kt => ValueWithUnitSerializer.kt} | 11 ++- .../utils/userEntry/UserEntryMapper.kt | 2 +- .../userEntry/UserEntryPresentationHelper.kt | 20 ++-- .../utils/userEntry/ValueWithUnitMapper.kt | 6 +- .../androidaps/TestBaseWithProfile.kt | 2 +- .../androidaps/data/DetailedBolusInfoTest.kt | 6 +- .../nightscout/androidaps/data/ProfileTest.kt | 2 +- .../extensions/BlockExtensionKtTest.kt | 6 +- .../plugins/aps/loop/APSResultTest.kt | 4 +- .../iob/iobCalculator/GlucoseStatusTest.kt | 3 +- .../iobCobCalculator/AutosensDataStoreTest.kt | 3 +- ...Test.kt => ValueWithUnitSerializerTest.kt} | 12 +-- database/entities/.gitignore | 1 + database/entities/build.gradle | 30 ++++++ database/entities/consumer-rules.pro | 0 database/entities/proguard-rules.pro | 21 ++++ .../entities/src/main/AndroidManifest.xml | 4 + .../database/entities/APSResult.kt | 21 ++-- .../database/entities/APSResultLink.kt | 45 +++++++++ .../nightscout}/database/entities/Bolus.kt | 13 ++- .../entities/BolusCalculatorResult.kt | 11 +-- .../nightscout}/database/entities/Carbs.kt | 15 ++- .../database/entities/DeviceStatus.kt | 13 ++- .../entities/EffectiveProfileSwitch.kt | 17 ++-- .../database/entities/ExtendedBolus.kt | 11 +-- .../nightscout}/database/entities/Food.kt | 7 +- .../database/entities/GlucoseValue.kt | 11 +-- .../database/entities/MultiwaveBolusLink.kt | 40 ++++++++ .../database/entities/OfflineEvent.kt | 11 +-- .../database/entities/PreferenceChange.kt | 7 +- .../database/entities/ProfileSwitch.kt | 17 ++-- .../database/entities}/TableNames.kt | 2 +- .../database/entities/TemporaryBasal.kt | 15 ++- .../database/entities/TemporaryTarget.kt | 18 +--- .../database/entities/TherapyEvent.kt | 9 +- .../database/entities/TotalDailyDose.kt | 15 ++- .../database/entities/UserEntry.kt | 11 +-- .../database/entities/ValueWithUnit.kt | 38 +++---- .../database/entities/VersionChange.kt | 7 +- .../database/entities}/data/Block.kt | 2 +- .../database/entities/data/NewEntries.kt | 39 ++++++++ .../database/entities}/data/TargetBlock.kt | 2 +- .../embedments/InsulinConfiguration.kt | 2 +- .../entities}/embedments/InterfaceIDs.kt | 2 +- .../database/entities/interfaces/DBEntry.kt | 5 + .../interfaces/DBEntryWithDuration.kt | 2 +- .../entities}/interfaces/DBEntryWithTime.kt | 2 +- .../interfaces/DBEntryWithTimeAndDuration.kt | 2 +- .../entities}/interfaces/TraceableDBEntry.kt | 4 +- database/impl/build.gradle | 4 +- .../annotations/DbOpenForTesting.kt | 4 +- .../androidaps/database/AppDatabase.kt | 61 ------------ .../database/DelegatedAppDatabase.kt | 31 ------ .../delegated/DelegatedDeviceStatusDao.kt | 6 -- .../androidaps/database/data/NewEntries.kt | 23 ----- .../database/entities/APSResultLink.kt | 42 -------- .../database/entities/MultiwaveBolusLink.kt | 37 ------- .../androidaps/database/interfaces/DBEntry.kt | 5 - .../serialisation/SealedClassHelper.kt | 52 ---------- .../nightscout/database/impl/AppDatabase.kt | 99 +++++++++++++++++++ .../impl}/AppRepository.kt | 30 ++++-- .../database => database/impl}/Converters.kt | 35 ++++--- .../impl}/DatabaseModule.kt | 2 +- .../database/impl/DelegatedAppDatabase.kt | 68 +++++++++++++ .../impl}/daos/APSResultDao.kt | 6 +- .../impl}/daos/APSResultLinkDao.kt | 8 +- .../impl}/daos/BolusCalculatorResultDao.kt | 6 +- .../impl}/daos/BolusDao.kt | 8 +- .../impl}/daos/CarbsDao.kt | 6 +- .../impl}/daos/DeviceStatusDao.kt | 6 +- .../impl}/daos/EffectiveProfileSwitchDao.kt | 6 +- .../impl}/daos/ExtendedBolusDao.kt | 8 +- .../impl}/daos/FoodDao.kt | 6 +- .../impl}/daos/GlucoseValueDao.kt | 6 +- .../impl}/daos/MultiwaveBolusLinkDao.kt | 6 +- .../impl}/daos/OfflineEventDao.kt | 6 +- .../impl}/daos/PreferenceChangeDao.kt | 6 +- .../impl}/daos/ProfileSwitchDao.kt | 11 +-- .../impl}/daos/TemporaryBasalDao.kt | 8 +- .../impl}/daos/TemporaryTargetDao.kt | 6 +- .../impl}/daos/TherapyEventDao.kt | 6 +- .../impl}/daos/TotalDailyDoseDao.kt | 8 +- .../impl}/daos/TraceableDao.kt | 7 +- .../impl}/daos/UserEntryDao.kt | 8 +- .../impl}/daos/VersionChangeDao.kt | 6 +- .../daos/delegated/DelegatedAPSResultDao.kt | 8 +- .../delegated/DelegatedAPSResultLinkDao.kt | 8 +- .../DelegatedBolusCalculatorResultDao.kt | 8 +- .../impl}/daos/delegated/DelegatedBolusDao.kt | 8 +- .../impl}/daos/delegated/DelegatedCarbsDao.kt | 8 +- .../impl}/daos/delegated/DelegatedDao.kt | 4 +- .../delegated/DelegatedDeviceStatusDao.kt | 6 ++ .../DelegatedEffectiveProfileSwitchDao.kt | 8 +- .../delegated/DelegatedExtendedBolusDao.kt | 8 +- .../impl}/daos/delegated/DelegatedFoodDao.kt | 8 +- .../delegated/DelegatedGlucoseValueDao.kt | 8 +- .../DelegatedMultiwaveBolusLinkDao.kt | 8 +- .../delegated/DelegatedOfflineEventDao.kt | 8 +- .../delegated/DelegatedPreferenceChangeDao.kt | 8 +- .../delegated/DelegatedProfileSwitchDao.kt | 8 +- .../delegated/DelegatedTemporaryBasalDao.kt | 8 +- .../delegated/DelegatedTemporaryTargetDao.kt | 8 +- .../delegated/DelegatedTherapyEventDao.kt | 8 +- .../delegated/DelegatedTotalDailyDoseDao.kt | 8 +- .../daos/delegated/DelegatedUserEntryDao.kt | 8 +- .../delegated/DelegatedVersionChangeDao.kt | 8 +- .../ProfileSwitchDaoWorkaround.java | 10 +- .../workaround/TraceableDaoWorkaround.java | 8 +- .../impl}/daos/workaround/package-info.java | 2 +- .../impl}/serialisation/SealedClassHelper.kt | 2 +- ...ncelCurrentOfflineEventIfAnyTransaction.kt | 6 +- ...lCurrentTemporaryTargetIfAnyTransaction.kt | 6 +- .../transactions/CgmSourceTransaction.kt | 7 +- .../impl}/transactions/CutCarbsTransaction.kt | 6 +- ...AndCancelCurrentOfflineEventTransaction.kt | 6 +- ...CancelCurrentTemporaryTargetTransaction.kt | 6 +- .../InsertBolusWithTempIdTransaction.kt | 4 +- .../InsertGlucoseValueTransaction.kt | 4 +- .../InsertIfNewByTimestampCarbsTransaction.kt | 12 ++- ...IfNewByTimestampTherapyEventTransaction.kt | 4 +- ...rUpdateBolusCalculatorResultTransaction.kt | 5 +- .../InsertOrUpdateBolusTransaction.kt | 14 +-- .../InsertOrUpdateCarbsTransaction.kt | 12 ++- .../InsertOrUpdateFoodTransaction.kt | 4 +- .../InsertOrUpdateProfileSwitch.kt | 4 +- ...sertTemporaryBasalWithTempIdTransaction.kt | 4 +- ...sertTherapyEventAnnouncementTransaction.kt | 6 +- ...idateAAPSStartedTherapyEventTransaction.kt | 4 +- ...alidateBolusCalculatorResultTransaction.kt | 4 +- .../InvalidateBolusTransaction.kt | 4 +- .../InvalidateCarbsTransaction.kt | 4 +- .../InvalidateExtendedBolusTransaction.kt | 4 +- .../transactions/InvalidateFoodTransaction.kt | 2 +- .../InvalidateGlucoseValueTransaction.kt | 4 +- .../InvalidateNsIdProfileSwitchTransaction.kt | 5 +- .../InvalidateOfflineEventTransaction.kt | 2 +- .../InvalidateProfileSwitchTransaction.kt | 4 +- .../InvalidateTemporaryBasalTransaction.kt | 4 +- ...dateTemporaryBasalTransactionWithPumpId.kt | 6 +- ...dateTemporaryBasalWithTempIdTransaction.kt | 4 +- .../InvalidateTemporaryTargetTransaction.kt | 2 +- .../InvalidateTherapyEventTransaction.kt | 4 +- .../SyncBolusWithTempIdTransaction.kt | 4 +- .../SyncNsBolusCalculatorResultTransaction.kt | 4 +- .../transactions/SyncNsBolusTransaction.kt | 4 +- .../transactions/SyncNsCarbsTransaction.kt | 4 +- ...SyncNsEffectiveProfileSwitchTransaction.kt | 4 +- .../SyncNsExtendedBolusTransaction.kt | 6 +- .../transactions/SyncNsFoodTransaction.kt | 4 +- .../SyncNsOfflineEventTransaction.kt | 6 +- .../SyncNsProfileSwitchTransaction.kt | 4 +- .../SyncNsTemporaryBasalTransaction.kt | 6 +- .../SyncNsTemporaryTargetTransaction.kt | 6 +- .../SyncNsTherapyEventTransaction.kt | 4 +- .../transactions/SyncPumpBolusTransaction.kt | 4 +- ...PumpCancelExtendedBolusIfAnyTransaction.kt | 8 +- ...umpCancelTemporaryBasalIfAnyTransaction.kt | 10 +- .../SyncPumpExtendedBolusTransaction.kt | 6 +- .../SyncPumpTemporaryBasalTransaction.kt | 8 +- .../SyncPumpTotalDailyDoseTransaction.kt | 4 +- ...SyncTemporaryBasalWithTempIdTransaction.kt | 4 +- .../impl}/transactions/Transaction.kt | 4 +- .../UpdateGlucoseValueTransaction.kt | 4 +- ...ateNsIdBolusCalculatorResultTransaction.kt | 4 +- .../UpdateNsIdBolusTransaction.kt | 4 +- .../UpdateNsIdCarbsTransaction.kt | 4 +- .../UpdateNsIdDeviceStatusTransaction.kt | 4 +- ...teNsIdEffectiveProfileSwitchTransaction.kt | 4 +- .../UpdateNsIdExtendedBolusTransaction.kt | 4 +- .../transactions/UpdateNsIdFoodTransaction.kt | 4 +- .../UpdateNsIdGlucoseValueTransaction.kt | 4 +- .../UpdateNsIdOfflineEventTransaction.kt | 4 +- .../UpdateNsIdProfileSwitchTransaction.kt | 4 +- .../UpdateNsIdTemporaryBasalTransaction.kt | 4 +- .../UpdateNsIdTemporaryTargetTransaction.kt | 4 +- .../UpdateNsIdTherapyEventTransaction.kt | 4 +- .../transactions/UserEntryTransaction.kt | 10 +- .../transactions/VersionChangeTransaction.kt | 11 ++- implementation/build.gradle | 1 + .../implementation/LocalAlertUtilsImpl.kt | 28 +++--- .../implementation/TrendCalculatorImpl.kt | 8 +- .../implementation/XDripBroadcastImpl.kt | 9 +- .../pump/PumpSyncImplementation.kt | 58 +++++------ .../queue/CommandQueueImplementation.kt | 10 +- .../queue/commands/CommandSetProfile.kt | 2 +- .../stats/DexcomTirCalculatorImpl.kt | 2 +- .../implementation/stats/TddCalculatorImpl.kt | 19 ++-- .../implementation/stats/TirCalculatorImpl.kt | 2 +- .../androidaps/TestBaseWithProfile.kt | 4 +- .../queue/CommandQueueImplementationTest.kt | 6 +- .../implementation/queue/QueueThreadTest.kt | 2 +- openhumans/build.gradle | 1 + .../general/openhumans/OpenHumansUploader.kt | 26 +++-- plugins/build.gradle | 1 + .../general/autotune/AutotuneFragment.kt | 4 +- .../plugins/general/autotune/AutotuneIob.kt | 22 ++--- .../general/autotune/AutotunePlugin.kt | 22 ++--- .../plugins/general/autotune/AutotunePrep.kt | 10 +- .../general/autotune/data/ATProfile.kt | 12 +-- .../plugins/general/autotune/data/BGDatum.kt | 4 +- .../plugins/general/food/FoodFragment.kt | 10 +- .../plugins/general/food/FoodPlugin.kt | 10 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 20 ++-- .../activities/SmsCommunicatorOtpActivity.kt | 4 +- .../plugins/insulin/ActivityGraph.kt | 3 +- .../plugins/insulin/InsulinOrefBasePlugin.kt | 18 ++-- .../plugins/profile/ProfileFragment.kt | 4 +- .../plugins/source/BGSourceFragment.kt | 12 +-- .../plugins/source/NSClientSourcePlugin.kt | 8 +- .../plugins/sync/nsShared/NSClientFragment.kt | 2 +- .../plugins/sync/nsShared/StoreDataForDb.kt | 68 ++++++------- .../DataSyncSelectorImplementation.kt | 30 +++--- .../sync/nsclient/data/NSSettingsStatus.kt | 4 +- .../nsclient/extensions/BolusExtension.kt | 9 +- .../nsclient/extensions/CarbsExtension.kt | 9 +- .../extensions/DeviceStatusExtension.kt | 2 +- .../EffectiveProfileSwitchExtension.kt | 11 +-- .../extensions/ExtendedBolusExtension.kt | 10 +- .../extensions/OfflineEventExtension.kt | 9 +- .../extensions/ProfileSwitchExtension.kt | 11 +-- .../extensions/TemporaryBasalExtension.kt | 11 +-- .../extensions/TemporaryTargetExtension.kt | 11 +-- .../extensions/TherapyEventExtension.kt | 4 +- .../sync/nsclient/services/NSClientService.kt | 2 +- .../nsclient/workers/NSClientAddAckWorker.kt | 34 +++---- .../workers/NSClientAddUpdateWorker.kt | 4 +- .../workers/NSClientUpdateRemoveAckWorker.kt | 2 +- .../BolusCalculatorResultExtension.kt | 2 +- .../nsclientV3/extensions/BolusExtension.kt | 4 +- .../nsclientV3/extensions/CarbsExtension.kt | 4 +- .../EffectiveProfileSwitchExtension.kt | 4 +- .../extensions/ExtendedBolusExtension.kt | 4 +- .../extensions/OfflineEventExtension.kt | 4 +- .../extensions/ProfileSwitchExtension.kt | 4 +- .../extensions/TemporaryBasalExtension.kt | 4 +- .../extensions/TemporaryTargetExtension.kt | 4 +- .../extensions/TherapyEventExtension.kt | 4 +- .../workers/ProcessTreatmentsWorker.kt | 2 +- .../plugins/sync/tidepool/comm/UploadChunk.kt | 6 +- .../sync/tidepool/elements/BasalElement.kt | 2 +- .../tidepool/elements/BloodGlucoseElement.kt | 2 +- .../sync/tidepool/elements/BolusElement.kt | 2 +- .../sync/tidepool/elements/ProfileElement.kt | 2 +- .../tidepool/elements/SensorGlucoseElement.kt | 2 +- .../sync/tidepool/elements/WizardElement.kt | 4 +- .../androidaps/TestBaseWithProfile.kt | 4 +- .../BgQualityCheckPluginTest.kt | 2 +- .../general/autotune/AutotuneCoreTest.kt | 8 +- .../general/autotune/AutotunePrepTest.kt | 18 ++-- .../SmsCommunicatorPluginTest.kt | 28 +++--- .../insulin/InsulinOrefBasePluginTest.kt | 8 +- pump/eopatch/build.gradle | 1 + pump/omnipod-dash/build.gradle | 1 + pump/omnipod-eros/build.gradle | 1 + settings.gradle | 1 + ui/build.gradle | 1 + .../ui/activities/ErrorHelperActivity.kt | 4 +- .../nightscout/ui/activities/StatsActivity.kt | 4 +- .../ui/activities/TDDStatsActivity.kt | 4 +- .../fragments/TreatmentsBolusCarbsFragment.kt | 22 ++--- .../fragments/TreatmentsCareportalFragment.kt | 14 +-- .../TreatmentsExtendedBolusesFragment.kt | 14 +-- .../TreatmentsProfileSwitchFragment.kt | 10 +- .../fragments/TreatmentsTempTargetFragment.kt | 16 +-- .../TreatmentsTemporaryBasalsFragment.kt | 20 ++-- .../fragments/TreatmentsUserEntryFragment.kt | 8 +- .../ui/dialogs/CalibrationDialog.kt | 18 ++-- .../info/nightscout/ui/dialogs/CarbsDialog.kt | 33 +++---- .../info/nightscout/ui/dialogs/CareDialog.kt | 21 ++-- .../nightscout/ui/dialogs/WizardInfoDialog.kt | 4 +- .../java/info/nightscout/ui/widget/Widget.kt | 19 ++-- .../androidaps/TestBaseWithProfile.kt | 4 +- 414 files changed, 1983 insertions(+), 1863 deletions(-) rename core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/{ValueWithUnitSerialiser.kt => ValueWithUnitSerializer.kt} (55%) rename core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/{ValueWithUnitSerialiserTest.kt => ValueWithUnitSerializerTest.kt} (63%) create mode 100644 database/entities/.gitignore create mode 100644 database/entities/build.gradle create mode 100644 database/entities/consumer-rules.pro create mode 100644 database/entities/proguard-rules.pro create mode 100644 database/entities/src/main/AndroidManifest.xml rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/APSResult.kt (66%) create mode 100644 database/entities/src/main/java/info/nightscout/database/entities/APSResultLink.kt rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/Bolus.kt (83%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/BolusCalculatorResult.kt (91%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/Carbs.kt (79%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/DeviceStatus.kt (78%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/EffectiveProfileSwitch.kt (82%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/ExtendedBolus.kt (84%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/Food.kt (91%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/GlucoseValue.kt (92%) create mode 100644 database/entities/src/main/java/info/nightscout/database/entities/MultiwaveBolusLink.kt rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/OfflineEvent.kt (84%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/PreferenceChange.kt (62%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/ProfileSwitch.kt (81%) rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/TableNames.kt (95%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/TemporaryBasal.kt (84%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/TemporaryTarget.kt (78%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/TherapyEvent.kt (93%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/TotalDailyDose.kt (75%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/UserEntry.kt (96%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/ValueWithUnit.kt (62%) rename database/{impl/src/main/java/info/nightscout/androidaps => entities/src/main/java/info/nightscout}/database/entities/VersionChange.kt (66%) rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/data/Block.kt (82%) create mode 100644 database/entities/src/main/java/info/nightscout/database/entities/data/NewEntries.kt rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/data/TargetBlock.kt (84%) rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/embedments/InsulinConfiguration.kt (75%) rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/embedments/InterfaceIDs.kt (96%) create mode 100644 database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntry.kt rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/interfaces/DBEntryWithDuration.kt (68%) rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/interfaces/DBEntryWithTime.kt (58%) rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/interfaces/DBEntryWithTimeAndDuration.kt (87%) rename database/{impl/src/main/java/info/nightscout/androidaps/database => entities/src/main/java/info/nightscout/database/entities}/interfaces/TraceableDBEntry.kt (84%) rename database/impl/src/debug/java/info/nightscout/{androidaps => database}/annotations/DbOpenForTesting.kt (80%) delete mode 100644 database/impl/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt delete mode 100644 database/impl/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt delete mode 100644 database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt delete mode 100644 database/impl/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt delete mode 100644 database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt delete mode 100644 database/impl/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt delete mode 100644 database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt delete mode 100644 database/impl/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt create mode 100644 database/impl/src/main/java/info/nightscout/database/impl/AppDatabase.kt rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/AppRepository.kt (97%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/Converters.kt (83%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/DatabaseModule.kt (99%) create mode 100644 database/impl/src/main/java/info/nightscout/database/impl/DelegatedAppDatabase.kt rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/APSResultDao.kt (82%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/APSResultLinkDao.kt (77%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/BolusCalculatorResultDao.kt (93%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/BolusDao.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/CarbsDao.kt (96%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/DeviceStatusDao.kt (89%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/EffectiveProfileSwitchDao.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/ExtendedBolusDao.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/FoodDao.kt (90%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/GlucoseValueDao.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/MultiwaveBolusLinkDao.kt (82%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/OfflineEventDao.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/PreferenceChangeDao.kt (74%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/ProfileSwitchDao.kt (91%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/TemporaryBasalDao.kt (95%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/TemporaryTargetDao.kt (93%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/TherapyEventDao.kt (95%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/TotalDailyDoseDao.kt (89%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/TraceableDao.kt (87%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/UserEntryDao.kt (77%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/VersionChangeDao.kt (78%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedAPSResultDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedAPSResultLinkDao.kt (64%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedBolusCalculatorResultDao.kt (64%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedBolusDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedCarbsDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedDao.kt (55%) create mode 100644 database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDeviceStatusDao.kt rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt (64%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedExtendedBolusDao.kt (64%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedFoodDao.kt (62%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedGlucoseValueDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt (64%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedOfflineEventDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedPreferenceChangeDao.kt (55%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedProfileSwitchDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedTemporaryBasalDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedTemporaryTargetDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedTherapyEventDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedTotalDailyDoseDao.kt (63%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedUserEntryDao.kt (52%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/delegated/DelegatedVersionChangeDao.kt (54%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/workaround/ProfileSwitchDaoWorkaround.java (60%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/workaround/TraceableDaoWorkaround.java (71%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/daos/workaround/package-info.java (74%) rename {core/core-main/src/main/java/info/nightscout/androidaps/utils => database/impl/src/main/java/info/nightscout/database/impl}/serialisation/SealedClassHelper.kt (97%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt (78%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt (78%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/CgmSourceTransaction.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/CutCarbsTransaction.kt (85%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt (84%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt (86%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertBolusWithTempIdTransaction.kt (88%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertGlucoseValueTransaction.kt (64%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertIfNewByTimestampCarbsTransaction.kt (82%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt (90%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt (82%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertOrUpdateBolusTransaction.kt (81%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertOrUpdateCarbsTransaction.kt (83%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertOrUpdateFoodTransaction.kt (86%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertOrUpdateProfileSwitch.kt (86%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertTemporaryBasalWithTempIdTransaction.kt (88%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InsertTherapyEventAnnouncementTransaction.kt (86%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt (85%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateBolusCalculatorResultTransaction.kt (85%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateBolusTransaction.kt (83%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateCarbsTransaction.kt (83%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateExtendedBolusTransaction.kt (84%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateFoodTransaction.kt (85%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateGlucoseValueTransaction.kt (85%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateNsIdProfileSwitchTransaction.kt (77%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateOfflineEventTransaction.kt (87%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateProfileSwitchTransaction.kt (84%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateTemporaryBasalTransaction.kt (84%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt (80%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt (85%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateTemporaryTargetTransaction.kt (87%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/InvalidateTherapyEventTransaction.kt (84%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncBolusWithTempIdTransaction.kt (90%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsBolusCalculatorResultTransaction.kt (93%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsBolusTransaction.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsCarbsTransaction.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsEffectiveProfileSwitchTransaction.kt (93%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsExtendedBolusTransaction.kt (95%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsFoodTransaction.kt (91%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsOfflineEventTransaction.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsProfileSwitchTransaction.kt (93%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsTemporaryBasalTransaction.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsTemporaryTargetTransaction.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncNsTherapyEventTransaction.kt (94%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncPumpBolusTransaction.kt (92%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt (82%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt (78%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncPumpExtendedBolusTransaction.kt (92%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncPumpTemporaryBasalTransaction.kt (90%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncPumpTotalDailyDoseTransaction.kt (92%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/SyncTemporaryBasalWithTempIdTransaction.kt (91%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/Transaction.kt (69%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateGlucoseValueTransaction.kt (65%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt (80%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdBolusTransaction.kt (78%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdCarbsTransaction.kt (78%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdDeviceStatusTransaction.kt (79%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt (80%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdExtendedBolusTransaction.kt (78%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdFoodTransaction.kt (78%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdGlucoseValueTransaction.kt (79%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdOfflineEventTransaction.kt (79%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdProfileSwitchTransaction.kt (79%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdTemporaryBasalTransaction.kt (79%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdTemporaryTargetTransaction.kt (80%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UpdateNsIdTherapyEventTransaction.kt (79%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/UserEntryTransaction.kt (69%) rename database/impl/src/main/java/info/nightscout/{androidaps/database => database/impl}/transactions/VersionChangeTransaction.kt (77%) diff --git a/app/build.gradle b/app/build.gradle index 7fb11a0e7d..49cdffb837 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -191,6 +191,8 @@ dependencies { implementation project(':ui') implementation project(':plugins') implementation project(':implementation') + implementation project(':database:entities') + implementation project(':database:entities') implementation project(':database:impl') implementation project(':pump:combo') implementation project(':pump:dana') diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index a6ab0792d6..7d74e8e14d 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -35,8 +35,6 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.activities.PreferencesActivity import info.nightscout.androidaps.activities.ProfileHelperActivity import info.nightscout.androidaps.activities.SingleFragmentActivity -import info.nightscout.androidaps.database.entities.UserEntry.Action -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 @@ -53,6 +51,8 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.tabs.TabPageAdapter import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index f5ff42cd2d..758a5fedc8 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -15,16 +15,12 @@ import androidx.work.PeriodicWorkRequest import androidx.work.WorkManager import dagger.android.AndroidInjector import dagger.android.DaggerApplication -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction -import info.nightscout.androidaps.database.transactions.VersionChangeTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.database.impl.transactions.VersionChangeTransaction import info.nightscout.androidaps.db.CompatDBHelper import info.nightscout.androidaps.di.DaggerAppComponent import info.nightscout.androidaps.di.StaticInjector -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.PluginStore import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils @@ -35,9 +31,13 @@ import info.nightscout.androidaps.receivers.NetworkChangeReceiver import info.nightscout.androidaps.receivers.TimeDateOrTZChangeReceiver import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.androidaps.utils.ProcessLifecycleListener +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.LocalAlertUtils +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.interfaces.notifications.Notification import info.nightscout.plugins.general.overview.notifications.NotificationStore diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt index cc2410960c..f1adf86de2 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowserData.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.activities import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.overview.OverviewData diff --git a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt index 2069def3d6..a666b777c7 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt @@ -11,8 +11,7 @@ import com.google.common.collect.Lists import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.databinding.ActivityProfilehelperBinding import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin @@ -21,6 +20,7 @@ import info.nightscout.androidaps.interfaces.stats.TddCalculator import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventLocalProfileChanged diff --git a/app/src/main/java/info/nightscout/androidaps/db/CompatDBHelper.kt b/app/src/main/java/info/nightscout/androidaps/db/CompatDBHelper.kt index 6240ad62de..ae715ad866 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/CompatDBHelper.kt +++ b/app/src/main/java/info/nightscout/androidaps/db/CompatDBHelper.kt @@ -1,21 +1,21 @@ package info.nightscout.androidaps.db import android.content.Context -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.Food -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.entities.ProfileSwitch -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventNewHistoryData +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.Food +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange import info.nightscout.rx.events.EventFoodDatabaseChanged diff --git a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt index e6789a9b8c..0d598198f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt @@ -4,13 +4,13 @@ import dagger.BindsInstance import dagger.Component import dagger.android.AndroidInjectionModule import dagger.android.AndroidInjector +import info.nightcout.shared.impl.di.SharedImplModule import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.combo.di.ComboModule import info.nightscout.androidaps.dana.di.DanaHistoryModule import info.nightscout.androidaps.dana.di.DanaModule import info.nightscout.androidaps.danar.di.DanaRModule import info.nightscout.androidaps.danars.di.DanaRSModule -import info.nightscout.androidaps.database.DatabaseModule import info.nightscout.androidaps.diaconn.di.DiaconnG8Module import info.nightscout.androidaps.insight.di.InsightDatabaseModule import info.nightscout.androidaps.insight.di.InsightModule @@ -22,10 +22,10 @@ import info.nightscout.androidaps.plugins.pump.medtronic.di.MedtronicModule import info.nightscout.androidaps.plugins.pump.omnipod.dash.di.OmnipodDashModule import info.nightscout.androidaps.plugins.pump.omnipod.eros.di.OmnipodErosModule import info.nightscout.automation.di.AutomationModule +import info.nightscout.database.impl.DatabaseModule import info.nightscout.implementation.di.ImplementationModule import info.nightscout.plugins.di.PluginsModule import info.nightscout.rx.di.RxModule -import info.nightcout.shared.impl.di.SharedImplModule import info.nightscout.shared.di.SharedModule import info.nightscout.ui.di.UiModule import javax.inject.Singleton 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 51e139b8e1..bf2d90a912 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -7,7 +7,7 @@ import dagger.Module import dagger.Provides import dagger.android.HasAndroidInjector import info.nightscout.androidaps.MainApp -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.implementations.ActivityNamesImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt index 45d260c25c..45e2d14775 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt @@ -7,26 +7,26 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R -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.databinding.DialogExtendedbolusBinding import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import java.text.DecimalFormat import java.util.LinkedList import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index 9896c9612b..08bec3cf63 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -8,30 +8,30 @@ import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TherapyEvent -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.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.databinding.DialogFillBinding import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.util.LinkedList diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index a16c9cf0ef..85ce90fa01 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -10,39 +10,39 @@ import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TemporaryTarget -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.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogInsulinBinding import info.nightscout.androidaps.extensions.formatColor -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.BolusTimer import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.toSignedString import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.BolusTimer +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt index ec9e2a8aab..5ce44dc903 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -12,13 +12,9 @@ import android.view.WindowManager import androidx.fragment.app.FragmentManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.OfflineEvent -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.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentOfflineEventTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.androidaps.databinding.DialogLoopBinding import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin @@ -33,6 +29,10 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.Constraint diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt index 379d769d54..cda87b566e 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt @@ -9,33 +9,33 @@ import android.view.View import android.view.ViewGroup import android.widget.ArrayAdapter import com.google.common.base.Joiner -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TemporaryTarget -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.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogProfileswitchBinding -import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index 30babfb9fa..4cc9372866 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -7,29 +7,29 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R -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.databinding.DialogTempbasalBinding import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import java.text.DecimalFormat import java.util.LinkedList import javax.inject.Inject @@ -137,13 +137,13 @@ class TempBasalDialog : DialogFragmentWithDate() { } if (isPercentPump) { uel.log(Action.TEMP_BASAL, Sources.TempBasalDialog, - ValueWithUnit.Percent(percent), - ValueWithUnit.Minute(durationInMinutes)) + ValueWithUnit.Percent(percent), + ValueWithUnit.Minute(durationInMinutes)) commandQueue.tempBasalPercent(percent, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.NORMAL, callback) } else { uel.log(Action.TEMP_BASAL, Sources.TempBasalDialog, - ValueWithUnit.Insulin(absolute), - ValueWithUnit.Minute(durationInMinutes)) + ValueWithUnit.Insulin(absolute), + ValueWithUnit.Minute(durationInMinutes)) commandQueue.tempBasalAbsolute(absolute, durationInMinutes, true, profile, PumpSync.TemporaryBasalType.NORMAL, callback) } }) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index cf5a27bff2..244625183b 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -8,31 +8,30 @@ import android.view.ViewGroup import android.widget.ArrayAdapter import com.google.common.base.Joiner import com.google.common.collect.Lists -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.TemporaryTarget -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.CancelCurrentTemporaryTargetIfAnyTransaction -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogTemptargetBinding import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat @@ -184,10 +183,14 @@ class TempTargetDialog : DialogFragmentWithDate() { OKDialog.showConfirmation(activity, rh.gs(R.string.careportal_temporarytarget), HtmlHelper.fromHtml(Joiner.on("
").join(actions)), { val units = profileFunction.getUnits() when(reason) { - rh.gs(R.string.eatingsoon) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.EATING_SOON), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration)) - rh.gs(R.string.activity) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.ACTIVITY), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration)) - rh.gs(R.string.hypo) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.HYPOGLYCEMIA), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration)) - rh.gs(R.string.manual) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason(TemporaryTarget.Reason.CUSTOM), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration)) + rh.gs(R.string.eatingsoon) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason( + TemporaryTarget.Reason.EATING_SOON), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration)) + rh.gs(R.string.activity) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason( + TemporaryTarget.Reason.ACTIVITY), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration)) + rh.gs(R.string.hypo) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason( + TemporaryTarget.Reason.HYPOGLYCEMIA), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration)) + rh.gs(R.string.manual) -> uel.log(Action.TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }, ValueWithUnit.TherapyEventTTReason( + TemporaryTarget.Reason.CUSTOM), ValueWithUnit.fromGlucoseUnit(target, units.asText), ValueWithUnit.Minute(duration)) rh.gs(R.string.stoptemptarget) -> uel.log(Action.CANCEL_TT, Sources.TTDialog, ValueWithUnit.Timestamp(eventTime).takeIf { eventTimeChanged }) } if (target == 0.0 || duration == 0) { diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index 3dce3b467d..5d899aaa02 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -10,29 +10,29 @@ import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.AppRepository -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.database.impl.AppRepository import info.nightscout.androidaps.databinding.DialogTreatmentBinding import info.nightscout.androidaps.extensions.formatColor 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.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat @@ -156,10 +156,10 @@ class TreatmentDialog : DialogFragmentWithDate() { detailedBolusInfo.context = context if (recordOnlyChecked) { uel.log(action, Sources.TreatmentDialog, if (insulinAfterConstraints != 0.0) rh.gs(R.string.record) else "", - ValueWithUnit.Timestamp(detailedBolusInfo.timestamp).takeIf { eventTimeChanged }, - ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.record)).takeIf { insulinAfterConstraints != 0.0 }, - ValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 }, - ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 }) + ValueWithUnit.Timestamp(detailedBolusInfo.timestamp).takeIf { eventTimeChanged }, + ValueWithUnit.SimpleString(rh.gsNotLocalised(R.string.record)).takeIf { insulinAfterConstraints != 0.0 }, + ValueWithUnit.Insulin(insulinAfterConstraints).takeIf { insulinAfterConstraints != 0.0 }, + ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 }) if (detailedBolusInfo.insulin > 0) disposable += repository.runTransactionForResult(detailedBolusInfo.insertBolusTransaction()) .subscribe( @@ -175,8 +175,8 @@ class TreatmentDialog : DialogFragmentWithDate() { } else { if (detailedBolusInfo.insulin > 0) { uel.log(action, Sources.TreatmentDialog, - ValueWithUnit.Insulin(insulinAfterConstraints), - ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 }) + ValueWithUnit.Insulin(insulinAfterConstraints), + ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 }) commandQueue.bolus(detailedBolusInfo, object : Callback() { override fun run() { if (!result.success) { diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index 4bdbc87c4a..f0af37c084 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -20,8 +20,8 @@ import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.databinding.DialogWizardBinding import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.valueToUnits 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 2b7a5ebc0c..f5d71a1f49 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 @@ -18,14 +18,10 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.OfflineEvent -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.InsertAndCancelCurrentOfflineEventTransaction -import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -48,6 +44,10 @@ import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.buildDeviceStatus import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index 66ba2dc1ce..26e2f972d2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -4,8 +4,8 @@ import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index 18c28bbf39..fd1c4c8e0f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -6,8 +6,8 @@ import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index 87acf2fde3..e9d5687b6a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.data.IobTotal import info.nightscout.interfaces.data.MealData -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt index 3883b1ad57..995ecdffca 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt @@ -4,7 +4,7 @@ import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.Constraints 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 494903f745..923f18cfa2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt @@ -3,16 +3,10 @@ package info.nightscout.androidaps.plugins.configBuilder import androidx.fragment.app.FragmentActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -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.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.interfaces.NsClient -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpSync @@ -20,6 +14,12 @@ import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.rx.bus.RxBus 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 edcaae518e..67790fcef0 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 @@ -1,10 +1,9 @@ package info.nightscout.androidaps.plugins.configBuilder import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.ProfileSwitch -import info.nightscout.androidaps.database.transactions.InsertOrUpdateProfileSwitch +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InsertOrUpdateProfileSwitch import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile @@ -14,6 +13,7 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.fromConstant import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.main.R +import info.nightscout.database.entities.ProfileSwitch import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt index 4ecba0e9f4..0be07d510c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt @@ -17,9 +17,6 @@ import androidx.recyclerview.widget.LinearSmoothScroller import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R -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.databinding.ObjectivesFragmentBinding import info.nightscout.androidaps.databinding.ObjectivesItemBinding import info.nightscout.androidaps.dialogs.NtpProgressDialog @@ -32,6 +29,9 @@ import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.utils.SntpClient import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus 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 8adfac1242..45c6a41f79 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 @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index 587dce9633..445925b8aa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -12,10 +12,8 @@ import androidx.core.content.ContextCompat import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.HistoryBrowseActivity -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.databinding.ActionsFragmentBinding import info.nightscout.androidaps.dialogs.ExtendedBolusDialog import info.nightscout.androidaps.dialogs.FillDialog @@ -37,6 +35,8 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.ui.SingleClickButton import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt index aa32565319..5b3203fa67 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt @@ -24,42 +24,42 @@ import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.activities.PreferencesActivity -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.diaconn.events.EventDiaconnG8PumpLogReset -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.ImportExportPrefs -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat -import info.nightscout.interfaces.data.maintenance.PrefFileNotFoundError -import info.nightscout.interfaces.data.maintenance.PrefIOError -import info.nightscout.interfaces.data.maintenance.PrefMetadata -import info.nightscout.interfaces.data.maintenance.Prefs -import info.nightscout.interfaces.data.maintenance.PrefsFormat -import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.data.maintenance.PrefsStatus -import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.alertDialogs.PrefImportSummaryDialog import info.nightscout.androidaps.utils.alertDialogs.TwoMessagesAlertDialog import info.nightscout.androidaps.utils.alertDialogs.WarningDialog import info.nightscout.androidaps.utils.protection.PasswordCheck -import info.nightscout.interfaces.storage.Storage import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.interfaces.AndroidPermission +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.ImportExportPrefs +import info.nightscout.interfaces.data.maintenance.PrefFileNotFoundError +import info.nightscout.interfaces.data.maintenance.PrefIOError +import info.nightscout.interfaces.data.maintenance.PrefMetadata +import info.nightscout.interfaces.data.maintenance.Prefs import info.nightscout.interfaces.data.maintenance.PrefsFile +import info.nightscout.interfaces.data.maintenance.PrefsFormat +import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey +import info.nightscout.interfaces.data.maintenance.PrefsStatus +import info.nightscout.interfaces.storage.Storage +import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import java.io.File import java.io.FileNotFoundException import java.io.IOException diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index 5f63e54276..ce64fb49e3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -10,9 +10,7 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.SingleFragmentActivity import info.nightscout.androidaps.dana.database.DanaHistoryDatabase -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase import info.nightscout.androidaps.events.EventPreferenceChange @@ -29,6 +27,8 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.PREFERENCES import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers 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 1f5ea937df..9edba3b27b 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 @@ -29,10 +29,7 @@ import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.databinding.OverviewFragmentBinding import info.nightscout.androidaps.dialogs.InsulinDialog import info.nightscout.androidaps.dialogs.LoopDialog @@ -78,6 +75,9 @@ import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.automation.AutomationPlugin import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.interfaces.end import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt index 1f05372d6e..7d41714441 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt @@ -3,19 +3,19 @@ package info.nightscout.androidaps.plugins.general.overview import android.widget.TextView import androidx.annotation.StringRes import info.nightscout.androidaps.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.plugins.sync.nsclient.extensions.age +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.pump.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.WarnColors +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.pump.PumpType +import info.nightscout.plugins.sync.nsclient.extensions.age import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/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 f879060531..965ddc4426 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 @@ -5,18 +5,10 @@ import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.entities.TotalDailyDose -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.ValueWithUnit -import info.nightscout.androidaps.database.interfaces.end -import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.dialogs.InsulinDialog import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.toStringShort @@ -44,6 +36,14 @@ import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.androidaps.utils.wizard.QuickWizardEntry import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.entities.interfaces.end import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.Constraint diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt index 0af169d2e4..b8331cea44 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/DataLayerListenerServiceMobile.kt @@ -16,7 +16,7 @@ import com.google.android.gms.wearable.Wearable import com.google.android.gms.wearable.WearableListenerService import dagger.android.AndroidInjection import info.nightscout.androidaps.R -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index 867f81ad66..36175e3412 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -5,12 +5,8 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventNewHistoryData @@ -27,6 +23,10 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.workflow.CalculationWorkflow import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.interfaces.end import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt index e8e3f5144e..0da991feee 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Worker.kt @@ -7,8 +7,8 @@ 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.ValueWrapper +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt index 8f2868beaf..7c463efc71 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOrefWorker.kt @@ -7,7 +7,7 @@ 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.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt index ebad2db295..66614fc3a3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt @@ -3,24 +3,24 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.plugins.utils.Percentile import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import java.util.Arrays diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt index 2c0164e4e8..bba17187b8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt @@ -3,25 +3,25 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.plugins.utils.Percentile import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import java.util.Arrays diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt index 7e5b9b2bf2..377c0ac213 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -4,23 +4,23 @@ import androidx.collection.LongSparseArray import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType +import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/AidexPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/AidexPlugin.kt index 0d16097b67..c2952c2453 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 @@ -6,16 +6,16 @@ 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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents +import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 fcc9ba66a7..78d2cf94ef 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 @@ -9,23 +9,23 @@ 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.entities.TherapyEvent -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.CgmSourceTransaction -import info.nightscout.androidaps.database.transactions.InvalidateGlucoseValueTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile 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.database.entities.GlucoseValue +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 48bf1c7e09..abf984eadd 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 @@ -6,15 +6,15 @@ 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.entities.TherapyEvent -import info.nightscout.androidaps.database.transactions.CgmSourceTransaction -import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 a7563fd1b4..659ff06446 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 @@ -7,12 +7,12 @@ import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.transactions.CgmSourceTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 41f78e2dc7..4f91486fac 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 @@ -6,16 +6,16 @@ import android.os.Handler import android.os.HandlerThread 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.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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription 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 74cd9c4d9a..7b30df2780 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 @@ -8,16 +8,16 @@ import android.os.HandlerThread import android.util.Log 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.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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Constants import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription 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 08b9a9cafc..f4f29ba3c7 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 @@ -6,13 +6,13 @@ 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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 474ac21e5c..00ffd09c3f 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 @@ -6,13 +6,13 @@ 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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast +import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.utils.JsonHelper.safeGetString 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 462fed8b35..c293e1e3c7 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 @@ -5,14 +5,14 @@ import android.os.HandlerThread import android.os.SystemClock 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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.utils.extensions.isRunningTest +import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin 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 d49f2f9c95..4c6afa72b9 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 @@ -6,12 +6,12 @@ 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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 787ab8bec8..ba89e19878 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 @@ -6,13 +6,13 @@ 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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.plugins.source.BGSourceFragment 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 9aab525609..0e79e2697c 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -15,7 +15,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.IobCobCalculator diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index 27c4e76709..f0c350bc21 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -6,47 +6,47 @@ import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.entities.TemporaryTarget -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.InsertOrUpdateBolusCalculatorResultTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorResultTransaction import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.highValueToUnitsToString import info.nightscout.androidaps.extensions.lowValueToUnitsToString import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.BolusTimer -import info.nightscout.interfaces.CarbTimer import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider +import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.BolusTimer +import info.nightscout.interfaces.CarbTimer +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.Round -import info.nightscout.shared.utils.T -import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +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.LinkedList diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt index d0ef9fb08c..47b1b0cd60 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt @@ -2,21 +2,21 @@ package info.nightscout.androidaps.utils.wizard import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.utils.JsonHelper.safeGetInt import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import java.util.UUID diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/LoadBgDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/LoadBgDataWorker.kt index 213b808af0..6f8d816454 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/LoadBgDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/LoadBgDataWorker.kt @@ -5,7 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.shared.utils.DateUtil diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt index 4754c975d3..4a9e1146dc 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt @@ -5,7 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt index 5db55ebc88..0ee562bcce 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt @@ -11,8 +11,8 @@ import com.jjoe64.graphview.series.LineGraphSeries import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper 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 812323f3fe..9b61629a65 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PreparePredictionsWorker.kt @@ -5,7 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.overview.OverviewData diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt index dd2fca9b9b..eada8b4423 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt @@ -8,8 +8,8 @@ import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt index fb4d069430..ed3829557a 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt @@ -5,14 +5,10 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile 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.graphExtensions.BolusDataPoint import info.nightscout.androidaps.plugins.general.overview.graphExtensions.CarbsDataPoint @@ -24,10 +20,14 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Thera import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.interfaces.utils.Round -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.Translator +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.T import javax.inject.Inject class PrepareTreatmentsDataWorker( diff --git a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 693e5b0a30..6e2012ecd1 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,14 +4,14 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper 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 534c4c313c..0aa5358c57 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.insight.database.InsightDatabaseDao import info.nightscout.androidaps.insight.database.InsightDbHelper import info.nightscout.androidaps.logging.UserEntryLogger 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 f478c59f20..6e43a490ca 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt @@ -6,7 +6,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints 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 bcbaa1a06b..a4d6fd6682 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 @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBaseWithProfile -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints diff --git a/automation/build.gradle b/automation/build.gradle index b19cd3347b..773f670e36 100644 --- a/automation/build.gradle +++ b/automation/build.gradle @@ -20,6 +20,7 @@ dependencies { implementation project(':graphview') implementation project(':core:core-main') implementation project(':core:fabric') + implementation project(':database:entities') implementation project(':database:impl') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt b/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt index 29239c18e2..c1c606a002 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationFragment.kt @@ -23,8 +23,6 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog @@ -35,6 +33,8 @@ import info.nightscout.automation.events.EventAutomationDataChanged import info.nightscout.automation.events.EventAutomationUpdateGui import info.nightscout.automation.triggers.TriggerConnector import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.dragHelpers.ItemTouchHelperAdapter import info.nightscout.interfaces.dragHelpers.OnStartDragListener import info.nightscout.interfaces.dragHelpers.SimpleItemTouchHelperCallback diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt index 4a143b4f78..d9448b3dc5 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionCarePortalEvent.kt @@ -3,28 +3,27 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository -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.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.shared.utils.T import info.nightscout.automation.R import info.nightscout.automation.elements.InputCarePortalMenu import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputString import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.logging.LTag - import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt index e8b4121028..79a48efc99 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt @@ -3,16 +3,16 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Loop +import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.automation.R +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback -import info.nightscout.automation.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt index fb691a50fa..1a6e5bf0e7 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt @@ -3,15 +3,15 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Loop +import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.automation.R +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.interfaces.queue.Callback -import info.nightscout.automation.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt index 4a98b8105c..5e28a525f4 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopResume.kt @@ -3,19 +3,19 @@ package info.nightscout.automation.actions import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.utils.DateUtil import info.nightscout.automation.R +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.logging.LTag +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt index d7f6d46e48..3aed698e76 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopSuspend.kt @@ -4,17 +4,17 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import org.json.JSONObject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt index d240cc4670..3b08d91c72 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionNotification.kt @@ -4,8 +4,8 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.NotificationUserMessage import info.nightscout.interfaces.queue.Callback diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt index d556930ad1..9162401897 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitch.kt @@ -4,21 +4,20 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.InputProfileName import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt index 935e4de072..32ebcde01c 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionProfileSwitchPercent.kt @@ -4,13 +4,8 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputDuration @@ -18,8 +13,12 @@ import info.nightscout.automation.elements.InputPercent import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.triggers.TriggerProfilePercent +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.logging.LTag - import org.json.JSONObject import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt index 012941df62..a391b07170 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt @@ -3,24 +3,14 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.ValueWithUnit -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.extensions.friendlyDescription import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble import info.nightscout.automation.R import info.nightscout.automation.elements.ComparatorExists import info.nightscout.automation.elements.InputDuration @@ -28,8 +18,17 @@ import info.nightscout.automation.elements.InputTempTarget import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.triggers.TriggerTempTarget +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt index 48a6637cc3..c2f8ef349a 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionStopTempTarget.kt @@ -2,16 +2,15 @@ package info.nightscout.automation.actions import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.utils.DateUtil import info.nightscout.automation.R +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt b/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt index 488e8e4b34..cffb628db0 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputCarePortalMenu.kt @@ -8,9 +8,9 @@ import android.widget.LinearLayout import android.widget.Spinner import androidx.annotation.DrawableRes import androidx.annotation.StringRes -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.automation.R +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.shared.interfaces.ResourceHelper class InputCarePortalMenu(private val rh: ResourceHelper) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt b/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt index 37c1f23d67..d8a963b6db 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/Trigger.kt @@ -9,7 +9,7 @@ import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt index e7a5aa3439..a9c2f57870 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerBolusAgo.kt @@ -3,18 +3,17 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.interfaces.utils.JsonHelper.safeGetString +import info.nightscout.database.impl.ValueWrapper import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel +import info.nightscout.database.entities.Bolus +import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.rx.logging.LTag - import org.json.JSONObject class TriggerBolusAgo(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt index fe401a4eee..8d0884a9fc 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTarget.kt @@ -3,7 +3,7 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.ComparatorExists diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt index cf8ec87ac6..de161f96ab 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt @@ -4,7 +4,7 @@ import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.utils.JsonHelper diff --git a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index d954e24b51..19b9e62b99 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt index 61bebe6282..4491760ba6 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionCarePortalEventTest.kt @@ -1,7 +1,7 @@ package info.nightscout.automation.actions -import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction -import info.nightscout.androidaps.database.transactions.Transaction +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.database.impl.transactions.Transaction import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.elements.InputCarePortalMenu diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt index da7e057b1a..dc953fbbed 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopResumeTest.kt @@ -1,10 +1,10 @@ package info.nightscout.automation.actions -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.androidaps.database.transactions.Transaction -import info.nightscout.interfaces.queue.Callback +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction +import info.nightscout.database.impl.transactions.Transaction import info.nightscout.automation.R +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.interfaces.queue.Callback import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt index 9b5084943b..2c0ab3b5dc 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionNotificationTest.kt @@ -4,9 +4,9 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.androidaps.database.transactions.Transaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction +import info.nightscout.database.impl.transactions.Transaction import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.R diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt index 9959e3f08d..dc5f7f78cd 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionStartTempTargetTest.kt @@ -1,13 +1,13 @@ package info.nightscout.automation.actions -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.androidaps.database.transactions.Transaction -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.queue.Callback +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.transactions.Transaction import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputTempTarget +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.queue.Callback import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt index 8d2d889766..f56ea7ae3f 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionStopTempTargetTest.kt @@ -1,10 +1,10 @@ package info.nightscout.automation.actions -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction -import info.nightscout.androidaps.database.transactions.Transaction -import info.nightscout.interfaces.queue.Callback +import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction +import info.nightscout.database.impl.transactions.Transaction import info.nightscout.automation.R +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.interfaces.queue.Callback import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index 771befbe00..c77e943724 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -5,22 +5,22 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.entities.OfflineEvent import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue +import info.nightscout.androidaps.interfaces.Loop +import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.interfaces.ProfileSource +import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.automation.triggers.Trigger +import info.nightscout.database.entities.OfflineEvent import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Loop import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.ProfileSource -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.automation.triggers.Trigger import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Before import org.mockito.Mock diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt index da9cf0d5b2..c761573b75 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBgTest.kt @@ -1,9 +1,9 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.automation.elements.Comparator +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.GlucoseUnit import org.json.JSONObject import org.junit.Assert import org.junit.Before diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt index 30eff00a5a..78e69b7322 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerBolusAgoTest.kt @@ -1,9 +1,9 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.impl.ValueWrapper import info.nightscout.automation.elements.Comparator +import info.nightscout.database.entities.Bolus import io.reactivex.rxjava3.core.Single import org.json.JSONException import org.json.JSONObject diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt index 13ad7c396b..50007685a7 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerDeltaTest.kt @@ -1,11 +1,11 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputDelta.DeltaType +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.GlucoseUnit import org.json.JSONObject import org.junit.Assert import org.junit.Before diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt index bbff8ede27..393e231a47 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTempTargetValueTest.kt @@ -1,11 +1,11 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.database.impl.ValueWrapper import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.interfaces.GlucoseUnit import io.reactivex.rxjava3.core.Single import org.json.JSONObject import org.junit.Assert diff --git a/core/core-main/build.gradle b/core/core-main/build.gradle index 45cb57f011..5b2afde88d 100644 --- a/core/core-main/build.gradle +++ b/core/core-main/build.gradle @@ -17,6 +17,7 @@ dependencies { implementation project(':graphview') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') + implementation project(':database:entities') implementation project(':database:impl') implementation project(':interfaces') diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt index 8fd8fcfaab..74c62f0fb3 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt @@ -2,12 +2,12 @@ package info.nightscout.androidaps.data import android.content.Context import com.google.gson.Gson -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.database.transactions.InsertOrUpdateBolusTransaction -import info.nightscout.androidaps.database.transactions.InsertOrUpdateCarbsTransaction +import info.nightscout.database.impl.transactions.InsertOrUpdateBolusTransaction +import info.nightscout.database.impl.transactions.InsertOrUpdateCarbsTransaction +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.pump.PumpType class DetailedBolusInfo { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt index 00a89d48db..040a191bf6 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.data -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue class InMemoryGlucoseValue constructor(var timestamp: Long = 0L, var value: Double = 0.0, var interpolated: Boolean = false) { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt index 92c1b2e607..df103f7fdd 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.data -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus import info.nightscout.interfaces.data.Iob import kotlin.math.exp import kotlin.math.pow diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt index 2ffeeaaebf..feb2c409e8 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt @@ -1,32 +1,32 @@ package info.nightscout.androidaps.data -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.extensions.blockValueBySeconds import info.nightscout.androidaps.extensions.highTargetBlockValueBySeconds import info.nightscout.androidaps.extensions.lowTargetBlockValueBySeconds import info.nightscout.androidaps.extensions.shiftBlock import info.nightscout.androidaps.extensions.shiftTargetBlock import info.nightscout.androidaps.extensions.targetBlockValueBySeconds -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Profile.Companion.secondsFromMidnight import info.nightscout.androidaps.interfaces.Profile.Companion.toMgdl import info.nightscout.androidaps.interfaces.Profile.ProfileValue import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.notifications.Notification -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.shared.utils.T +import info.nightscout.core.main.R +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock +import info.nightscout.database.entities.embedments.InsulinConfiguration +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.notifications.Notification import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import java.text.DecimalFormat diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt index cad67c56e7..112640e877 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.data -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock import info.nightscout.interfaces.GlucoseUnit import org.json.JSONObject -import java.util.* +import java.util.TimeZone class PureProfile( var jsonObject: JSONObject, // source json data (must correspond to the rest of the profile) diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt index f78e1986b1..1ae58f23c0 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt @@ -9,14 +9,14 @@ import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.activities.DialogAppCompatActivity -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.core.main.R import info.nightscout.core.main.databinding.DialogBolusprogressBinding +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventOverviewBolusProgress diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt index 2faf1346d7..23e5067f88 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ErrorDialog.kt @@ -12,14 +12,14 @@ import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.activities.DialogAppCompatActivity -import info.nightscout.core.main.R -import info.nightscout.core.main.databinding.DialogErrorBinding -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.services.AlarmSoundServiceHelper -import info.nightscout.shared.utils.T +import info.nightscout.core.main.R +import info.nightscout.core.main.databinding.DialogErrorBinding +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.utils.T import javax.inject.Inject class ErrorDialog : DaggerDialogFragment() { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt index 83500f2793..b4f4ea79b1 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt @@ -12,8 +12,8 @@ import dagger.android.support.DaggerDialogFragment import info.nightscout.core.main.R import info.nightscout.core.main.databinding.DialogProfileviewerBinding import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.shared.extensions.toVisibility import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt index e81bba9c71..f162cfd51c 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventEffectiveProfileSwitchChanged.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.events -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.rx.events.Event class EventEffectiveProfileSwitchChanged(effectiveProfileSwitch: EffectiveProfileSwitch?) : Event() { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt index ae23b56a05..8760bde63f 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewBG.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.events -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue import info.nightscout.rx.events.EventLoop class EventNewBG(val glucoseValue: GlucoseValue?) : EventLoop() \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt index cf13925bb6..317b04d049 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/events/EventNewHistoryData.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.events -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue import info.nightscout.rx.events.Event import org.joda.time.DateTime import org.joda.time.format.DateTimeFormat diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt index 013b1536eb..0a8be6f26a 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BlockExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import org.json.JSONArray diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt index 001952e053..3703192377 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt @@ -2,17 +2,16 @@ package info.nightscout.androidaps.extensions import com.google.gson.Gson import com.google.gson.JsonSyntaxException -import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun BolusCalculatorResult.toJson(isAdd: Boolean, dateUtil: DateUtil, profileFunction: ProfileFunction): JSONObject = JSONObject() - .put("eventType", TherapyEvent.Type.BOLUS_WIZARD.text) + .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.BOLUS_WIZARD.text) .put("created_at", dateUtil.toISOString(timestamp)) .put("isValid", isValid) .put("bolusCalculatorResult", Gson().toJson(this)) diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt index 34162b2368..af0a005fad 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt @@ -1,15 +1,10 @@ package info.nightscout.androidaps.extensions -import info.nightscout.interfaces.data.Iob import info.nightscout.androidaps.data.LocalInsulin -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.JsonHelper -import org.json.JSONObject +import info.nightscout.database.entities.Bolus +import info.nightscout.interfaces.data.Iob fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob { if (!isValid || type == Bolus.Type.PRIMING ) return Iob() diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt index 619ae5c390..5651f1e0a8 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.interfaces.end +import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import kotlin.math.ceil import kotlin.math.max @@ -43,7 +43,7 @@ fun ExtendedBolus.toTemporaryBasal(profile: Profile): TemporaryBasal = isAbsolute = true, isValid = isValid, interfaceIDs_backing = interfaceIDs_backing, - type = TemporaryBasal.Type.FAKE_EXTENDED + type = info.nightscout.database.entities.TemporaryBasal.Type.FAKE_EXTENDED ) fun ExtendedBolus.iobCalc(time: Long, profile: Profile, insulinInterface: Insulin): IobTotal { @@ -62,7 +62,7 @@ fun ExtendedBolus.iobCalc(time: Long, profile: Profile, insulinInterface: Insuli val tempBolusPart = Bolus( timestamp = calcDate, amount = tempBolusSize, - type = Bolus.Type.NORMAL + type = info.nightscout.database.entities.Bolus.Type.NORMAL ) val aIOB = insulinInterface.iobCalcForTreatment(tempBolusPart, time, dia) result.iob += aIOB.iobContrib @@ -110,7 +110,7 @@ fun ExtendedBolus.iobCalc( val tempBolusPart = Bolus( timestamp = calcDate, amount = tempBolusSize, - type = Bolus.Type.NORMAL + type = info.nightscout.database.entities.Bolus.Type.NORMAL ) val aIOB = insulinInterface.iobCalcForTreatment(tempBolusPart, time, dia) result.iob += aIOB.iobContrib diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt index c77c73a607..f48f8b1bc3 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/FoodExtension.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.database.entities.Food +import info.nightscout.database.entities.Food import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt index 808ae79d6f..97f62fa922 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.extensions +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.interfaces.GlucoseUnit import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.DecimalFormatter import org.json.JSONObject fun GlucoseValue.valueToUnits(units: GlucoseUnit): Double = diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt index 8c41a81e4f..e4b873ac12 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps.utils.extensions -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.database.entities.ProfileSwitch import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.extensions.targetBlockFromJsonArray -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import org.json.JSONObject import java.util.TimeZone diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt index d6b4c13d3b..0514020c57 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.pump.PumpType fun PumpType.Companion.fromDbSource(s: UserEntry.Sources): PumpType.Source = diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt index 7553aa59f8..1e546136db 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.interfaces.end import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.interfaces.end +import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import kotlin.math.ceil import kotlin.math.max diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt index 763505043a..0ff7e6cdd8 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt @@ -1,13 +1,13 @@ package info.nightscout.androidaps.extensions -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.core.main.R +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.interfaces.Constants import java.util.concurrent.TimeUnit fun TemporaryTarget.isInProgress(dateUtil: DateUtil): Boolean = diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt index 66330481a8..9ea429cc47 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TherapyEventExtension.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.GlucoseUnit fun TherapyEvent.isOlderThan(hours: Double): Boolean { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt index 417daeaefb..f4b8301ad1 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TotalDailyDoseExtension.kt @@ -6,9 +6,9 @@ import android.view.Gravity import android.widget.TableRow import android.widget.TextView import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.TotalDailyDose -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.entities.TotalDailyDose import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil val TotalDailyDose.total get() = if (totalAmount > 0) totalAmount else basalAmount + bolusAmount diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt index 1331e7c4c5..5b852690f8 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TrendArrowIcon.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.extensions import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue fun GlucoseValue.TrendArrow.directionToIcon(): Int { return when { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt index f766b727f0..3c52968d4f 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/UserEntryExt.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.extensions import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.UserEntry.* +import info.nightscout.database.entities.UserEntry.ColorGroup fun ColorGroup.colorId(): Int { return when (this) { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt index 91e4638353..9a8eab4ba5 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/BgSource.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue interface BgSource { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt index bf215d0229..01018c833a 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DataSyncSelector.kt @@ -1,7 +1,18 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.database.entities.DeviceStatus -import info.nightscout.androidaps.database.entities.* +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.DeviceStatus +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.Food +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent import org.json.JSONObject interface DataSyncSelector { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt index 0fcd641363..d5f59886e2 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.interfaces.data.Iob -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.ConfigExportImport +import info.nightscout.interfaces.data.Iob interface Insulin : ConfigExportImport { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt index 9578f50cd0..df24dd5f67 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.data.IobTotal -import info.nightscout.interfaces.data.MealData -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.TemporaryBasal import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.BasalData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.interfaces.data.MealData import org.json.JSONArray interface IobCobCalculator { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt index 3523c8a16b..47ca978fc3 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.interfaces.data.PumpEnactResult -import info.nightscout.androidaps.database.entities.OfflineEvent import info.nightscout.androidaps.plugins.aps.loop.APSResult +import info.nightscout.database.entities.OfflineEvent import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.data.PumpEnactResult interface Loop { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt index e0d3dd46e2..fe1109cf19 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.database.entities.ProfileSwitch import info.nightscout.interfaces.GlucoseUnit interface ProfileFunction { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt index a137bb5ec8..3dde921289 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal import info.nightscout.interfaces.pump.PumpType /** diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt index 0235f355a3..41834b2937 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/TrendCalculator.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue /** * Convert BG direction value to trend arrow or calculate it if not provided diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt index 2cd6782c8b..009a062754 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/XDripBroadcast.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue import org.json.JSONArray import org.json.JSONObject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt index f8da1e0c74..dbe37c5233 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/stats/TddCalculator.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.interfaces.stats import android.content.Context import android.util.LongSparseArray import android.widget.TableLayout -import info.nightscout.androidaps.database.entities.TotalDailyDose +import info.nightscout.database.entities.TotalDailyDose interface TddCalculator { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt b/core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt index 36f87e20ae..1d34a47ac7 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt @@ -1,16 +1,16 @@ package info.nightscout.androidaps.logging import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.AppRepository -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.UserEntryTransaction -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.UserEntryTransaction import info.nightscout.androidaps.utils.userEntry.UserEntryMapper import info.nightscout.androidaps.utils.userEntry.ValueWithUnitMapper +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.utils.DateUtil import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt index 5820ea7c86..f1c9096f8b 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt @@ -2,25 +2,24 @@ package info.nightscout.androidaps.plugins.aps.loop import android.text.Spanned import dagger.android.HasAndroidInjector -import info.nightscout.core.main.R import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.core.main.R +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.interfaces.utils.HtmlHelper.fromHtml import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt index 894d572117..dd4c076fc1 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt @@ -7,12 +7,9 @@ import androidx.annotation.DrawableRes import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.core.main.R import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.entities.TemporaryTarget +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.extensions.isInProgress import info.nightscout.androidaps.extensions.toStringFull @@ -30,6 +27,9 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.utils.DefaultValueHelper +import info.nightscout.core.main.R +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.TemporaryTarget import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt index e457c921f7..00f5ae946d 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/BolusDataPoint.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper +import info.nightscout.core.main.R +import info.nightscout.database.entities.Bolus +import info.nightscout.shared.interfaces.ResourceHelper class BolusDataPoint( val data: Bolus, diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt index 9290e87b5e..c2a25ab4dc 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/CarbsDataPoint.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.database.entities.Carbs import info.nightscout.shared.interfaces.ResourceHelper class CarbsDataPoint( diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt index 05f3dcbe89..0e465db304 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.T diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt index 00ad4ce522..6a950bb0cc 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/ExtendedBolusDataPoint.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.ExtendedBolus import info.nightscout.androidaps.extensions.toStringTotal +import info.nightscout.core.main.R +import info.nightscout.database.entities.ExtendedBolus import info.nightscout.shared.interfaces.ResourceHelper class ExtendedBolusDataPoint( diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt index 433183be52..a5cef52fcd 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.interfaces.Constants -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DefaultValueHelper +import info.nightscout.core.main.R +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.shared.interfaces.ResourceHelper class GlucoseValueDataPoint( val data: GlucoseValue, diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt index 44a9af4aa9..916cf8c9fb 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt @@ -1,13 +1,13 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.interfaces.Constants -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.Translator +import info.nightscout.core.main.R +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.interfaces.Constants +import info.nightscout.shared.interfaces.ResourceHelper class TherapyEventDataPoint( val data: TherapyEvent, diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt index 56158ecff8..cf78d672d6 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt @@ -4,15 +4,15 @@ import androidx.collection.LongSparseArray import androidx.collection.size import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.InMemoryGlucoseValue -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.database.entities.GlucoseValue import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import kotlin.math.abs import kotlin.math.roundToLong diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt index d24d58611e..4416a32f03 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt @@ -2,20 +2,20 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator.data import android.content.Context import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.shared.utils.DateUtil +import info.nightscout.core.main.R +import info.nightscout.database.entities.Carbs +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import java.util.Locale import javax.inject.Inject import kotlin.math.min diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt b/core/core-main/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt index 652d04c773..7e78cf60d0 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/queue/commands/Command.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.core.main.R import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.AAPSLogger diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt index 42f95d4e2c..de39a4ef78 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.utils import android.content.Context import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.core.main.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/Translator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/Translator.kt index 86eadfbda1..0a8ee44dde 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/Translator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/Translator.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.utils import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.entities.TherapyEvent -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.database.entities.OfflineEvent +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt index 5567bf256c..5788becbb7 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/WarnColors.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.utils import android.widget.TextView -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.extensions.isOlderThan +import info.nightscout.core.main.R +import info.nightscout.database.entities.TherapyEvent import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiser.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerializer.kt similarity index 55% rename from core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiser.kt rename to core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerializer.kt index 42db084ddc..f2167eb2a3 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiser.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerializer.kt @@ -1,8 +1,11 @@ package info.nightscout.androidaps.utils.serialisation -import info.nightscout.androidaps.database.entities.ValueWithUnit +import com.google.gson.Gson +import com.google.gson.reflect.TypeToken +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.serialisation.SealedClassHelper -object ValueWithUnitSerialiser { +object ValueWithUnitSerializer { fun toSealedClassJson(list: List): String = list.map(::ValueWithUnitWrapper) .let(SealedClassHelper.gson::toJson) @@ -11,4 +14,6 @@ object ValueWithUnitSerialiser { .fromJson>(string).map { it.wrapped } private class ValueWithUnitWrapper(val wrapped: ValueWithUnit) -} \ No newline at end of file +} + +inline fun Gson.fromJson(json: String): T = fromJson(json, object : TypeToken() {}.type) diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt index da402ac9ee..5833281465 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryMapper.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.utils.userEntry -import info.nightscout.androidaps.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry class UserEntryMapper { enum class Action (val db: UserEntry.Action) { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt index cc6cc86028..b2f5da37e4 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt @@ -2,21 +2,21 @@ package info.nightscout.androidaps.utils.userEntry import android.text.Spanned import dagger.Reusable -import info.nightscout.interfaces.Constants -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.ColorGroup -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.entities.ValueWithUnit -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.Translator +import info.nightscout.core.main.R +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.ColorGroup +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject @Reusable diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt index 53834d3166..73f7b57b6b 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/ValueWithUnitMapper.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.utils.userEntry +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.database.entities.ValueWithUnit sealed class ValueWithUnitMapper { //I use a sealed class because of StringResource that contains a listOf as second parameter diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index d59c1efa9d..201d744fbf 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,7 +4,7 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt index 2e37734b64..8a47986297 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt @@ -2,9 +2,9 @@ package info.nightscout.androidaps.data import android.content.Context import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.TherapyEvent import org.apache.commons.lang3.builder.EqualsBuilder import org.junit.Assert import org.junit.Test diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt index 4fd5150895..c85e1fc21a 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt @@ -5,7 +5,7 @@ import dagger.android.AndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.core.main.R -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt index 7d905537b8..8d3dbd1e2e 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/extensions/BlockExtensionKtTest.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.database.data.checkSanity +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock +import info.nightscout.database.entities.data.checkSanity import info.nightscout.shared.utils.T import org.junit.Assert diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt index 2b03644c96..5e9f4108ec 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt @@ -3,10 +3,10 @@ package info.nightscout.androidaps.plugins.aps.loop import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble import org.junit.Assert diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt index f9d8736b23..c024b526a4 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCalculator/GlucoseStatusTest.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.plugins.iob.iobCalculator import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.plugins.iob.iobCobCalculator.asRounded +import info.nightscout.database.entities.GlucoseValue import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import org.junit.Assert @@ -14,7 +14,6 @@ import org.junit.Before import org.junit.Test import org.mockito.Mock import org.mockito.Mockito.`when` -import java.util.* /** * Created by mike on 26.03.2018. diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt index bca9698cb6..22475eccb1 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStoreTest.kt @@ -2,14 +2,13 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator import android.content.Context import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import org.junit.Assert import org.junit.Before import org.junit.Test import org.mockito.Mock -import java.util.* class AutosensDataStoreTest : TestBase() { diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiserTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerializerTest.kt similarity index 63% rename from core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiserTest.kt rename to core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerializerTest.kt index 16123cf67b..7fdbaada58 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerialiserTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/utils/serialisation/ValueWithUnitSerializerTest.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.utils.serialisation -import info.nightscout.androidaps.database.entities.ValueWithUnit +import info.nightscout.database.entities.ValueWithUnit import org.junit.Assert import org.junit.Test -internal class ValueWithUnitSerialiserTest { +internal class ValueWithUnitSerializerTest { @Test fun testSerialisationDeserization() { @@ -15,8 +15,8 @@ internal class ValueWithUnitSerialiserTest { ValueWithUnit.UNKNOWN ) - val serialized = ValueWithUnitSerialiser.toSealedClassJson(list) - val deserialized = ValueWithUnitSerialiser.fromJson(serialized) + val serialized = ValueWithUnitSerializer.toSealedClassJson(list) + val deserialized = ValueWithUnitSerializer.fromJson(serialized) Assert.assertEquals(3, list.size) Assert.assertEquals(list, deserialized) @@ -27,8 +27,8 @@ internal class ValueWithUnitSerialiserTest { val list = listOf() - val serialized = ValueWithUnitSerialiser.toSealedClassJson(list) - val deserialized = ValueWithUnitSerialiser.fromJson(serialized) + val serialized = ValueWithUnitSerializer.toSealedClassJson(list) + val deserialized = ValueWithUnitSerializer.fromJson(serialized) Assert.assertEquals(0, list.size) Assert.assertEquals(list, deserialized) diff --git a/database/entities/.gitignore b/database/entities/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/database/entities/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/database/entities/build.gradle b/database/entities/build.gradle new file mode 100644 index 0000000000..6a551950b7 --- /dev/null +++ b/database/entities/build.gradle @@ -0,0 +1,30 @@ +plugins { + id 'com.android.library' + id 'kotlin-android' + id 'kotlin-kapt' + id 'kotlin-allopen' + id 'com.hiya.jacoco-android' +} + +apply from: "${project.rootDir}/core/core-main/android_dependencies.gradle" +apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradle" + +android { + + namespace 'info.nightscout.database.entities' +} + +dependencies { + api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + + api "androidx.core:core-ktx:$core_version" + + kapt "androidx.room:room-compiler:$room_version" + api "androidx.room:room-ktx:$room_version" + +} + +allOpen { + // allows mocking for classes w/o directly opening them for release builds + annotation 'info.nightscout.androidaps.annotations.DbOpenForTesting' +} \ No newline at end of file diff --git a/database/entities/consumer-rules.pro b/database/entities/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/database/entities/proguard-rules.pro b/database/entities/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/database/entities/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/database/entities/src/main/AndroidManifest.xml b/database/entities/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..44008a4332 --- /dev/null +++ b/database/entities/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResult.kt b/database/entities/src/main/java/info/nightscout/database/entities/APSResult.kt similarity index 66% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResult.kt rename to database/entities/src/main/java/info/nightscout/database/entities/APSResult.kt index 42ef8e7dac..0f3f1ce826 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResult.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/APSResult.kt @@ -1,17 +1,20 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities -import androidx.room.* -import info.nightscout.androidaps.database.TABLE_APS_RESULTS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry +import androidx.room.Embedded +import androidx.room.Entity +import androidx.room.ForeignKey +import androidx.room.Index +import androidx.room.PrimaryKey +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTime +import info.nightscout.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity(tableName = TABLE_APS_RESULTS, foreignKeys = [ForeignKey( - entity = APSResult::class, - parentColumns = ["id"], - childColumns = ["referenceId"])], + entity = APSResult::class, + parentColumns = ["id"], + childColumns = ["referenceId"])], indices = [Index("referenceId"), Index("timestamp")]) data class APSResult( @PrimaryKey(autoGenerate = true) diff --git a/database/entities/src/main/java/info/nightscout/database/entities/APSResultLink.kt b/database/entities/src/main/java/info/nightscout/database/entities/APSResultLink.kt new file mode 100644 index 0000000000..8a3ae8a08f --- /dev/null +++ b/database/entities/src/main/java/info/nightscout/database/entities/APSResultLink.kt @@ -0,0 +1,45 @@ +package info.nightscout.database.entities + +import androidx.room.Embedded +import androidx.room.Entity +import androidx.room.ForeignKey +import androidx.room.Index +import androidx.room.PrimaryKey +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.TraceableDBEntry + +@Entity(tableName = TABLE_APS_RESULT_LINKS, + foreignKeys = [ForeignKey( + entity = APSResult::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("apsResultId")), ForeignKey( + + entity = Bolus::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("smbId")), ForeignKey( + + entity = TemporaryBasal::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("tbrId")), ForeignKey( + + entity = APSResultLink::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("referenceId"))], + indices = [Index("referenceId"), Index("apsResultId"), + Index("smbId"), Index("tbrId")]) +data class APSResultLink( + @PrimaryKey(autoGenerate = true) + override var id: Long = 0, + override var version: Int = 0, + override var dateCreated: Long = -1, + override var isValid: Boolean = true, + override var referenceId: Long? = null, + @Embedded + override var interfaceIDs_backing: InterfaceIDs? = null, + var apsResultId: Long, + var smbId: Long? = null, + var tbrId: Long? = null +) : TraceableDBEntry { + override val foreignKeysValid: Boolean + get() = super.foreignKeysValid && apsResultId != 0L && smbId != 0L && tbrId != 0L +} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Bolus.kt b/database/entities/src/main/java/info/nightscout/database/entities/Bolus.kt similarity index 83% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/Bolus.kt rename to database/entities/src/main/java/info/nightscout/database/entities/Bolus.kt index 1feec1c287..93a0cf0d5e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Bolus.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/Bolus.kt @@ -1,16 +1,15 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_BOLUSES -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InsulinConfiguration +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTime +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_BOLUSES, diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/BolusCalculatorResult.kt b/database/entities/src/main/java/info/nightscout/database/entities/BolusCalculatorResult.kt similarity index 91% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/BolusCalculatorResult.kt rename to database/entities/src/main/java/info/nightscout/database/entities/BolusCalculatorResult.kt index 681addd996..d7cf88dc6f 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/BolusCalculatorResult.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/BolusCalculatorResult.kt @@ -1,15 +1,14 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_BOLUS_CALCULATOR_RESULTS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTime +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_BOLUS_CALCULATOR_RESULTS, diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Carbs.kt b/database/entities/src/main/java/info/nightscout/database/entities/Carbs.kt similarity index 79% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/Carbs.kt rename to database/entities/src/main/java/info/nightscout/database/entities/Carbs.kt index 9d55e4ad6c..704869b38e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Carbs.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/Carbs.kt @@ -1,22 +1,21 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_CARBS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity(tableName = TABLE_CARBS, - foreignKeys = [ForeignKey( + foreignKeys = [ForeignKey( entity = Carbs::class, parentColumns = ["id"], childColumns = ["referenceId"])], - indices = [ + indices = [ Index("id"), Index("isValid"), Index("nightscoutId"), diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/DeviceStatus.kt b/database/entities/src/main/java/info/nightscout/database/entities/DeviceStatus.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/DeviceStatus.kt rename to database/entities/src/main/java/info/nightscout/database/entities/DeviceStatus.kt index 516be6f9ce..8555052e95 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/DeviceStatus.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/DeviceStatus.kt @@ -1,17 +1,16 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_DEVICE_STATUS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTime +import java.util.TimeZone @Entity(tableName = TABLE_DEVICE_STATUS, - foreignKeys = [], - indices = [ + foreignKeys = [], + indices = [ Index("id"), Index("nightscoutId"), Index("timestamp") diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/EffectiveProfileSwitch.kt b/database/entities/src/main/java/info/nightscout/database/entities/EffectiveProfileSwitch.kt similarity index 82% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/EffectiveProfileSwitch.kt rename to database/entities/src/main/java/info/nightscout/database/entities/EffectiveProfileSwitch.kt index 969a67c4f0..6d0bd8b5d1 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/EffectiveProfileSwitch.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/EffectiveProfileSwitch.kt @@ -1,18 +1,17 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_EFFECTIVE_PROFILE_SWITCHES -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock +import info.nightscout.database.entities.embedments.InsulinConfiguration +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTime +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_EFFECTIVE_PROFILE_SWITCHES, diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ExtendedBolus.kt b/database/entities/src/main/java/info/nightscout/database/entities/ExtendedBolus.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/ExtendedBolus.kt rename to database/entities/src/main/java/info/nightscout/database/entities/ExtendedBolus.kt index f8ec3f52b4..b8989ac08e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ExtendedBolus.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/ExtendedBolus.kt @@ -1,15 +1,14 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_EXTENDED_BOLUSES -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_EXTENDED_BOLUSES, diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Food.kt b/database/entities/src/main/java/info/nightscout/database/entities/Food.kt similarity index 91% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/Food.kt rename to database/entities/src/main/java/info/nightscout/database/entities/Food.kt index 50a9601899..693fa07f61 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/Food.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/Food.kt @@ -1,13 +1,12 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_FOODS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.TraceableDBEntry @Entity( tableName = TABLE_FOODS, diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/GlucoseValue.kt b/database/entities/src/main/java/info/nightscout/database/entities/GlucoseValue.kt similarity index 92% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/GlucoseValue.kt rename to database/entities/src/main/java/info/nightscout/database/entities/GlucoseValue.kt index 7a0e008e49..24d5efaf8d 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/GlucoseValue.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/GlucoseValue.kt @@ -1,15 +1,14 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_GLUCOSE_VALUES -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTime +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_GLUCOSE_VALUES, diff --git a/database/entities/src/main/java/info/nightscout/database/entities/MultiwaveBolusLink.kt b/database/entities/src/main/java/info/nightscout/database/entities/MultiwaveBolusLink.kt new file mode 100644 index 0000000000..8057d40588 --- /dev/null +++ b/database/entities/src/main/java/info/nightscout/database/entities/MultiwaveBolusLink.kt @@ -0,0 +1,40 @@ +package info.nightscout.database.entities + +import androidx.room.Embedded +import androidx.room.Entity +import androidx.room.ForeignKey +import androidx.room.Index +import androidx.room.PrimaryKey +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.TraceableDBEntry + +@Entity(tableName = TABLE_MULTIWAVE_BOLUS_LINKS, + foreignKeys = [ForeignKey( + entity = Bolus::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("bolusId")), ForeignKey( + + entity = ExtendedBolus::class, + parentColumns = arrayOf("id"), + childColumns = arrayOf("extendedBolusId")), ForeignKey( + + entity = MultiwaveBolusLink::class, + parentColumns = ["id"], + childColumns = ["referenceId"])], + indices = [Index("referenceId"), Index("bolusId"), + Index("extendedBolusId")]) +data class MultiwaveBolusLink( + @PrimaryKey(autoGenerate = true) + override var id: Long = 0, + override var version: Int = 0, + override var dateCreated: Long = -1, + override var isValid: Boolean = true, + override var referenceId: Long? = null, + @Embedded + override var interfaceIDs_backing: InterfaceIDs? = null, + var bolusId: Long, + var extendedBolusId: Long +) : TraceableDBEntry { + override val foreignKeysValid: Boolean + get() = super.foreignKeysValid && bolusId != 0L && bolusId != 0L && extendedBolusId != 0L +} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/OfflineEvent.kt b/database/entities/src/main/java/info/nightscout/database/entities/OfflineEvent.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/OfflineEvent.kt rename to database/entities/src/main/java/info/nightscout/database/entities/OfflineEvent.kt index d4f83b4737..3ba6a14b14 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/OfflineEvent.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/OfflineEvent.kt @@ -1,15 +1,14 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_OFFLINE_EVENTS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_OFFLINE_EVENTS, diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/PreferenceChange.kt b/database/entities/src/main/java/info/nightscout/database/entities/PreferenceChange.kt similarity index 62% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/PreferenceChange.kt rename to database/entities/src/main/java/info/nightscout/database/entities/PreferenceChange.kt index 8ff67ccb71..e4d56964c6 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/PreferenceChange.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/PreferenceChange.kt @@ -1,10 +1,9 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Entity import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_PREFERENCE_CHANGES -import info.nightscout.androidaps.database.interfaces.DBEntry -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime +import info.nightscout.database.entities.interfaces.DBEntry +import info.nightscout.database.entities.interfaces.DBEntryWithTime import java.util.TimeZone @Entity(tableName = TABLE_PREFERENCE_CHANGES) diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ProfileSwitch.kt b/database/entities/src/main/java/info/nightscout/database/entities/ProfileSwitch.kt similarity index 81% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/ProfileSwitch.kt rename to database/entities/src/main/java/info/nightscout/database/entities/ProfileSwitch.kt index dfda513382..ed541a3c7a 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ProfileSwitch.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/ProfileSwitch.kt @@ -1,18 +1,17 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_PROFILE_SWITCHES -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock +import info.nightscout.database.entities.embedments.InsulinConfiguration +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_PROFILE_SWITCHES, diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/TableNames.kt b/database/entities/src/main/java/info/nightscout/database/entities/TableNames.kt similarity index 95% rename from database/impl/src/main/java/info/nightscout/androidaps/database/TableNames.kt rename to database/entities/src/main/java/info/nightscout/database/entities/TableNames.kt index 6cfc7e1de0..f174622d05 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/TableNames.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/TableNames.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database +package info.nightscout.database.entities const val TABLE_APS_RESULTS = "apsResults" const val TABLE_APS_RESULT_LINKS = "apsResultLinks" diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryBasal.kt b/database/entities/src/main/java/info/nightscout/database/entities/TemporaryBasal.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryBasal.kt rename to database/entities/src/main/java/info/nightscout/database/entities/TemporaryBasal.kt index 8133f33635..dd6c2a9c1b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryBasal.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/TemporaryBasal.kt @@ -1,22 +1,21 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_TEMPORARY_BASALS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity(tableName = TABLE_TEMPORARY_BASALS, - foreignKeys = [ForeignKey( + foreignKeys = [ForeignKey( entity = TemporaryBasal::class, parentColumns = ["id"], childColumns = ["referenceId"])], - indices = [ + indices = [ Index("id"), Index("isValid"), Index("nightscoutId"), diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryTarget.kt b/database/entities/src/main/java/info/nightscout/database/entities/TemporaryTarget.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryTarget.kt rename to database/entities/src/main/java/info/nightscout/database/entities/TemporaryTarget.kt index a818a78904..9289561503 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TemporaryTarget.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/TemporaryTarget.kt @@ -1,16 +1,14 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import com.google.gson.annotations.SerializedName -import info.nightscout.androidaps.database.TABLE_TEMPORARY_TARGETS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity( tableName = TABLE_TEMPORARY_TARGETS, @@ -63,17 +61,11 @@ data class TemporaryTarget( interfaceIDs.nightscoutId != null enum class Reason(val text: String) { - @SerializedName("Custom") CUSTOM("Custom"), - @SerializedName("Hypo") HYPOGLYCEMIA("Hypo"), - @SerializedName("Activity") ACTIVITY("Activity"), - @SerializedName("Eating Soon") EATING_SOON("Eating Soon"), - @SerializedName("Automation") AUTOMATION("Automation"), - @SerializedName("Wear") WEAR("Wear") ; diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt b/database/entities/src/main/java/info/nightscout/database/entities/TherapyEvent.kt similarity index 93% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt rename to database/entities/src/main/java/info/nightscout/database/entities/TherapyEvent.kt index 57361f0e33..b2bf0aac9c 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TherapyEvent.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/TherapyEvent.kt @@ -1,14 +1,13 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_THERAPY_EVENTS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTimeAndDuration -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTimeAndDuration +import info.nightscout.database.entities.interfaces.TraceableDBEntry import java.util.TimeZone @Entity( diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TotalDailyDose.kt b/database/entities/src/main/java/info/nightscout/database/entities/TotalDailyDose.kt similarity index 75% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/TotalDailyDose.kt rename to database/entities/src/main/java/info/nightscout/database/entities/TotalDailyDose.kt index 2426147b54..dda1a5b8a5 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/TotalDailyDose.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/TotalDailyDose.kt @@ -1,22 +1,21 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Embedded import androidx.room.Entity import androidx.room.ForeignKey import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_TOTAL_DAILY_DOSES -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry -import java.util.* +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntryWithTime +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import java.util.TimeZone @Entity(tableName = TABLE_TOTAL_DAILY_DOSES, - foreignKeys = [ForeignKey( + foreignKeys = [ForeignKey( entity = TotalDailyDose::class, parentColumns = ["id"], childColumns = ["referenceId"])], - indices = [ + indices = [ Index("id"), Index("pumpId"), Index("pumpType"), diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt b/database/entities/src/main/java/info/nightscout/database/entities/UserEntry.kt similarity index 96% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt rename to database/entities/src/main/java/info/nightscout/database/entities/UserEntry.kt index 4dd0942fac..c91244ead4 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/UserEntry.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/UserEntry.kt @@ -1,15 +1,14 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Entity import androidx.room.Index import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_USER_ENTRY -import info.nightscout.androidaps.database.interfaces.DBEntry -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime -import java.util.* +import info.nightscout.database.entities.interfaces.DBEntry +import info.nightscout.database.entities.interfaces.DBEntryWithTime +import java.util.TimeZone @Entity(tableName = TABLE_USER_ENTRY, - indices = [ + indices = [ Index("source"), Index("timestamp") ]) diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ValueWithUnit.kt b/database/entities/src/main/java/info/nightscout/database/entities/ValueWithUnit.kt similarity index 62% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/ValueWithUnit.kt rename to database/entities/src/main/java/info/nightscout/database/entities/ValueWithUnit.kt index 55709888f7..b0f17f0b9e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/ValueWithUnit.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/ValueWithUnit.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities sealed class ValueWithUnit { @@ -36,22 +36,22 @@ sealed class ValueWithUnit { fun value(): Any? { return when(this) { - is Gram -> this.value - is Hour -> this.value - is Insulin -> this.value - is Mgdl -> this.value - is Minute -> this.value - is Mmoll -> this.value - is Percent -> this.value - is SimpleInt -> this.value - is SimpleString -> this.value + is Gram -> this.value + is Hour -> this.value + is Insulin -> this.value + is Mgdl -> this.value + is Minute -> this.value + is Mmoll -> this.value + is Percent -> this.value + is SimpleInt -> this.value + is SimpleString -> this.value is TherapyEventMeterType -> this.value - is TherapyEventTTReason -> this.value - is OfflineEventReason -> this.value - is TherapyEventType -> this.value - is Timestamp -> this.value - is UnitPerHour -> this.value - UNKNOWN -> null + is TherapyEventTTReason -> this.value + is OfflineEventReason -> this.value + is TherapyEventType -> this.value + is Timestamp -> this.value + is UnitPerHour -> this.value + UNKNOWN -> null } } companion object { @@ -60,9 +60,9 @@ sealed class ValueWithUnit { const val MMOL = "mmol" fun fromGlucoseUnit(value: Double, string: String): ValueWithUnit? = when (string) { - MGDL, "mgdl" -> Mgdl(value) - MMOL, "mmol/l" -> Mmoll(value) - else -> null + MGDL, "mgdl" -> Mgdl(value) + MMOL, "mmol/l" -> Mmoll(value) + else -> null } } } diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/VersionChange.kt b/database/entities/src/main/java/info/nightscout/database/entities/VersionChange.kt similarity index 66% rename from database/impl/src/main/java/info/nightscout/androidaps/database/entities/VersionChange.kt rename to database/entities/src/main/java/info/nightscout/database/entities/VersionChange.kt index 83ca1ccc40..7fc3470246 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/VersionChange.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/VersionChange.kt @@ -1,10 +1,9 @@ -package info.nightscout.androidaps.database.entities +package info.nightscout.database.entities import androidx.room.Entity import androidx.room.PrimaryKey -import info.nightscout.androidaps.database.TABLE_VERSION_CHANGES -import info.nightscout.androidaps.database.interfaces.DBEntry -import info.nightscout.androidaps.database.interfaces.DBEntryWithTime +import info.nightscout.database.entities.interfaces.DBEntry +import info.nightscout.database.entities.interfaces.DBEntryWithTime import java.util.TimeZone @Entity(tableName = TABLE_VERSION_CHANGES) diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/data/Block.kt b/database/entities/src/main/java/info/nightscout/database/entities/data/Block.kt similarity index 82% rename from database/impl/src/main/java/info/nightscout/androidaps/database/data/Block.kt rename to database/entities/src/main/java/info/nightscout/database/entities/data/Block.kt index 0b4a98b5c1..473f524d39 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/data/Block.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/data/Block.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.data +package info.nightscout.database.entities.data import java.util.concurrent.TimeUnit diff --git a/database/entities/src/main/java/info/nightscout/database/entities/data/NewEntries.kt b/database/entities/src/main/java/info/nightscout/database/entities/data/NewEntries.kt new file mode 100644 index 0000000000..b714a18d14 --- /dev/null +++ b/database/entities/src/main/java/info/nightscout/database/entities/data/NewEntries.kt @@ -0,0 +1,39 @@ +package info.nightscout.database.entities.data + +import info.nightscout.database.entities.APSResult +import info.nightscout.database.entities.APSResultLink +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.MultiwaveBolusLink +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.PreferenceChange +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.VersionChange + +data class NewEntries( + val apsResults: List, + val apsResultLinks: List, + val bolusCalculatorResults: List, + val boluses: List, + val carbs: List, + val effectiveProfileSwitches: List, + val extendedBoluses: List, + val glucoseValues: List, + val multiwaveBolusLinks: List, + val offlineEvents: List, + val preferencesChanges: List, + val profileSwitches: List, + val temporaryBasals: List, + val temporaryTarget: List, + val therapyEvents: List, + val totalDailyDoses: List, + val versionChanges: List +) \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/data/TargetBlock.kt b/database/entities/src/main/java/info/nightscout/database/entities/data/TargetBlock.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/data/TargetBlock.kt rename to database/entities/src/main/java/info/nightscout/database/entities/data/TargetBlock.kt index 4c95fba75f..22572eca16 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/data/TargetBlock.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/data/TargetBlock.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.data +package info.nightscout.database.entities.data import java.util.concurrent.TimeUnit diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InsulinConfiguration.kt b/database/entities/src/main/java/info/nightscout/database/entities/embedments/InsulinConfiguration.kt similarity index 75% rename from database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InsulinConfiguration.kt rename to database/entities/src/main/java/info/nightscout/database/entities/embedments/InsulinConfiguration.kt index e6c8a1a437..98d74cc10e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InsulinConfiguration.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/embedments/InsulinConfiguration.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.embedments +package info.nightscout.database.entities.embedments data class InsulinConfiguration( var insulinLabel: String, diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InterfaceIDs.kt b/database/entities/src/main/java/info/nightscout/database/entities/embedments/InterfaceIDs.kt similarity index 96% rename from database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InterfaceIDs.kt rename to database/entities/src/main/java/info/nightscout/database/entities/embedments/InterfaceIDs.kt index 44452c9a44..5f78da4e8c 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/embedments/InterfaceIDs.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/embedments/InterfaceIDs.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.embedments +package info.nightscout.database.entities.embedments data class InterfaceIDs( var nightscoutSystemId: String? = null, diff --git a/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntry.kt b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntry.kt new file mode 100644 index 0000000000..ac327c6b40 --- /dev/null +++ b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntry.kt @@ -0,0 +1,5 @@ +package info.nightscout.database.entities.interfaces + +interface DBEntry { + var id: Long +} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithDuration.kt b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithDuration.kt similarity index 68% rename from database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithDuration.kt rename to database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithDuration.kt index 469ec17d6d..34c4f053ff 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithDuration.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithDuration.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.interfaces +package info.nightscout.database.entities.interfaces interface DBEntryWithDuration { var duration: Long diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTime.kt b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTime.kt similarity index 58% rename from database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTime.kt rename to database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTime.kt index 103942fcf0..bae0a704e8 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTime.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTime.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.interfaces +package info.nightscout.database.entities.interfaces interface DBEntryWithTime { var timestamp: Long diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTimeAndDuration.kt b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTimeAndDuration.kt similarity index 87% rename from database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTimeAndDuration.kt rename to database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTimeAndDuration.kt index 475cd01f5d..ef7408c0e6 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntryWithTimeAndDuration.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/DBEntryWithTimeAndDuration.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.interfaces +package info.nightscout.database.entities.interfaces import kotlin.math.min diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/TraceableDBEntry.kt b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/TraceableDBEntry.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/TraceableDBEntry.kt rename to database/entities/src/main/java/info/nightscout/database/entities/interfaces/TraceableDBEntry.kt index ad4679cea3..63e83bd822 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/TraceableDBEntry.kt +++ b/database/entities/src/main/java/info/nightscout/database/entities/interfaces/TraceableDBEntry.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.interfaces +package info.nightscout.database.entities.interfaces -import info.nightscout.androidaps.database.embedments.InterfaceIDs +import info.nightscout.database.entities.embedments.InterfaceIDs interface TraceableDBEntry: DBEntry { var version: Int diff --git a/database/impl/build.gradle b/database/impl/build.gradle index 3b45869b87..39b78acc17 100644 --- a/database/impl/build.gradle +++ b/database/impl/build.gradle @@ -11,7 +11,7 @@ apply from: "${project.rootDir}/core/core-main/android_module_dependencies.gradl android { - namespace 'info.nightscout.androidaps.database' + namespace 'info.nightscout.database.impl' defaultConfig { kapt { arguments { @@ -23,6 +23,8 @@ android { } dependencies { + implementation project(':database:entities') + api "androidx.core:core-ktx:$core_version" api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" diff --git a/database/impl/src/debug/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt b/database/impl/src/debug/java/info/nightscout/database/annotations/DbOpenForTesting.kt similarity index 80% rename from database/impl/src/debug/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt rename to database/impl/src/debug/java/info/nightscout/database/annotations/DbOpenForTesting.kt index deca64872c..df0ea6bc13 100644 --- a/database/impl/src/debug/java/info/nightscout/androidaps/annotations/DbOpenForTesting.kt +++ b/database/impl/src/debug/java/info/nightscout/database/annotations/DbOpenForTesting.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.annotations +package info.nightscout.database.annotations /** * This is the actual annotation that makes the class open. Don't use it directly, only through [DbOpenForTesting] @@ -10,6 +10,6 @@ annotation class DbOpenClass /** * Annotate a class with [DbOpenForTesting] if it should be extendable for testing. */ -@DbOpenClass +@info.nightscout.database.annotations.DbOpenClass @Target(AnnotationTarget.CLASS) annotation class DbOpenForTesting \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt deleted file mode 100644 index 58fc350cec..0000000000 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/AppDatabase.kt +++ /dev/null @@ -1,61 +0,0 @@ -package info.nightscout.androidaps.database - -import androidx.room.Database -import androidx.room.RoomDatabase -import androidx.room.TypeConverters -import info.nightscout.androidaps.database.daos.* -import info.nightscout.androidaps.database.entities.* - -const val DATABASE_VERSION = 22 - -@Database(version = DATABASE_VERSION, - entities = [APSResult::class, Bolus::class, BolusCalculatorResult::class, Carbs::class, - EffectiveProfileSwitch::class, ExtendedBolus::class, GlucoseValue::class, ProfileSwitch::class, - TemporaryBasal::class, TemporaryTarget::class, TherapyEvent::class, TotalDailyDose::class, APSResultLink::class, - MultiwaveBolusLink::class, PreferenceChange::class, VersionChange::class, UserEntry::class, - Food::class, DeviceStatus::class, OfflineEvent::class], - exportSchema = true) -@TypeConverters(Converters::class) -internal abstract class AppDatabase : RoomDatabase() { - - abstract val glucoseValueDao: GlucoseValueDao - - abstract val therapyEventDao: TherapyEventDao - - abstract val temporaryBasalDao: TemporaryBasalDao - - abstract val bolusDao: BolusDao - - abstract val extendedBolusDao: ExtendedBolusDao - - abstract val multiwaveBolusLinkDao: MultiwaveBolusLinkDao - - abstract val totalDailyDoseDao: TotalDailyDoseDao - - abstract val carbsDao: CarbsDao - - abstract val temporaryTargetDao: TemporaryTargetDao - - abstract val apsResultLinkDao: APSResultLinkDao - - abstract val bolusCalculatorResultDao: BolusCalculatorResultDao - - abstract val effectiveProfileSwitchDao: EffectiveProfileSwitchDao - - abstract val profileSwitchDao: ProfileSwitchDao - - abstract val apsResultDao: APSResultDao - - abstract val versionChangeDao: VersionChangeDao - - abstract val userEntryDao: UserEntryDao - - abstract val preferenceChangeDao: PreferenceChangeDao - - abstract val foodDao: FoodDao - - abstract val deviceStatusDao: DeviceStatusDao - - abstract val offlineEventDao: OfflineEventDao - -} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt deleted file mode 100644 index f436dc99e7..0000000000 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/DelegatedAppDatabase.kt +++ /dev/null @@ -1,31 +0,0 @@ -package info.nightscout.androidaps.database - -import info.nightscout.androidaps.database.daos.* -import info.nightscout.androidaps.database.daos.delegated.* -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.interfaces.DBEntry - -internal class DelegatedAppDatabase(val changes: MutableList, val database: AppDatabase) { - - val glucoseValueDao: GlucoseValueDao = DelegatedGlucoseValueDao(changes, database.glucoseValueDao) - val therapyEventDao: TherapyEventDao = DelegatedTherapyEventDao(changes, database.therapyEventDao) - val temporaryBasalDao: TemporaryBasalDao = DelegatedTemporaryBasalDao(changes, database.temporaryBasalDao) - val bolusDao: BolusDao = DelegatedBolusDao(changes, database.bolusDao) - val extendedBolusDao: ExtendedBolusDao = DelegatedExtendedExtendedBolusDao(changes, database.extendedBolusDao) - val multiwaveBolusLinkDao: MultiwaveBolusLinkDao = DelegatedMultiwaveBolusLinkDao(changes, database.multiwaveBolusLinkDao) - val totalDailyDoseDao: TotalDailyDoseDao = DelegatedTotalDailyDoseDao(changes, database.totalDailyDoseDao) - val carbsDao: CarbsDao = DelegatedCarbsDao(changes, database.carbsDao) - val temporaryTargetDao: TemporaryTargetDao = DelegatedTemporaryTargetDao(changes, database.temporaryTargetDao) - val apsResultLinkDao: APSResultLinkDao = DelegatedAPSResultLinkLinkDao(changes, database.apsResultLinkDao) - val bolusCalculatorResultDao: BolusCalculatorResultDao = DelegatedBolusCalculatorResultDao(changes, database.bolusCalculatorResultDao) - val effectiveProfileSwitchDao: EffectiveProfileSwitchDao = DelegatedEffectiveProfileSwitchDao(changes, database.effectiveProfileSwitchDao) - val profileSwitchDao: ProfileSwitchDao = DelegatedProfileSwitchDao(changes, database.profileSwitchDao) - val apsResultDao: APSResultDao = DelegatedAPSResultDao(changes, database.apsResultDao) - val versionChangeDao: VersionChangeDao = DelegatedVersionChangeDao(changes, database.versionChangeDao) - val userEntryDao: UserEntryDao = DelegatedUserEntryDao(changes, database.userEntryDao) - val preferenceChangeDao: PreferenceChangeDao = DelegatedPreferenceChangeDao(changes, database.preferenceChangeDao) - val foodDao: FoodDao = DelegatedFoodDao(changes, database.foodDao) - val deviceStatusDao: DeviceStatusDao = DelegatedDeviceStatusDao(changes, database.deviceStatusDao) - val offlineEventDao: OfflineEventDao = DelegatedOfflineEventDao(changes, database.offlineEventDao) - fun clearAllTables() = database.clearAllTables() -} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt deleted file mode 100644 index 1d798ef546..0000000000 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDeviceStatusDao.kt +++ /dev/null @@ -1,6 +0,0 @@ -package info.nightscout.androidaps.database.daos.delegated - -import info.nightscout.androidaps.database.daos.DeviceStatusDao -import info.nightscout.androidaps.database.interfaces.DBEntry - -internal class DelegatedDeviceStatusDao(changes: MutableList, private val dao: DeviceStatusDao) : DelegatedDao(changes), DeviceStatusDao by dao \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt deleted file mode 100644 index e951f37de2..0000000000 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/data/NewEntries.kt +++ /dev/null @@ -1,23 +0,0 @@ -package info.nightscout.androidaps.database.data - -import info.nightscout.androidaps.database.entities.* - -data class NewEntries( - val apsResults: List, - val apsResultLinks: List, - val bolusCalculatorResults: List, - val boluses: List, - val carbs: List, - val effectiveProfileSwitches: List, - val extendedBoluses: List, - val glucoseValues: List, - val multiwaveBolusLinks: List, - val offlineEvents: List, - val preferencesChanges: List, - val profileSwitches: List, - val temporaryBasals: List, - val temporaryTarget: List, - val therapyEvents: List, - val totalDailyDoses: List, - val versionChanges: List -) \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt deleted file mode 100644 index 8fed1f9578..0000000000 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/APSResultLink.kt +++ /dev/null @@ -1,42 +0,0 @@ -package info.nightscout.androidaps.database.entities - -import androidx.room.* -import info.nightscout.androidaps.database.TABLE_APS_RESULT_LINKS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry - -@Entity(tableName = TABLE_APS_RESULT_LINKS, - foreignKeys = [ForeignKey( - entity = APSResult::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("apsResultId")), ForeignKey( - - entity = Bolus::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("smbId")), ForeignKey( - - entity = TemporaryBasal::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("tbrId")), ForeignKey( - - entity = APSResultLink::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("referenceId"))], - indices = [Index("referenceId"), Index("apsResultId"), - Index("smbId"), Index("tbrId")]) -data class APSResultLink( - @PrimaryKey(autoGenerate = true) - override var id: Long = 0, - override var version: Int = 0, - override var dateCreated: Long = -1, - override var isValid: Boolean = true, - override var referenceId: Long? = null, - @Embedded - override var interfaceIDs_backing: InterfaceIDs? = null, - var apsResultId: Long, - var smbId: Long? = null, - var tbrId: Long? = null -) : TraceableDBEntry { - override val foreignKeysValid: Boolean - get() = super.foreignKeysValid && apsResultId != 0L && smbId != 0L && tbrId != 0L -} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt deleted file mode 100644 index e8fbf135e0..0000000000 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/entities/MultiwaveBolusLink.kt +++ /dev/null @@ -1,37 +0,0 @@ -package info.nightscout.androidaps.database.entities - -import androidx.room.* -import info.nightscout.androidaps.database.TABLE_MULTIWAVE_BOLUS_LINKS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry - -@Entity(tableName = TABLE_MULTIWAVE_BOLUS_LINKS, - foreignKeys = [ForeignKey( - entity = Bolus::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("bolusId")), ForeignKey( - - entity = ExtendedBolus::class, - parentColumns = arrayOf("id"), - childColumns = arrayOf("extendedBolusId")), ForeignKey( - - entity = MultiwaveBolusLink::class, - parentColumns = ["id"], - childColumns = ["referenceId"])], - indices = [Index("referenceId"), Index("bolusId"), - Index("extendedBolusId")]) -data class MultiwaveBolusLink( - @PrimaryKey(autoGenerate = true) - override var id: Long = 0, - override var version: Int = 0, - override var dateCreated: Long = -1, - override var isValid: Boolean = true, - override var referenceId: Long? = null, - @Embedded - override var interfaceIDs_backing: InterfaceIDs? = null, - var bolusId: Long, - var extendedBolusId: Long -) : TraceableDBEntry { - override val foreignKeysValid: Boolean - get() = super.foreignKeysValid && bolusId != 0L && bolusId != 0L && extendedBolusId != 0L -} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt deleted file mode 100644 index f6c01287a6..0000000000 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/interfaces/DBEntry.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.androidaps.database.interfaces - -interface DBEntry { - var id: Long -} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt b/database/impl/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt deleted file mode 100644 index 704819908e..0000000000 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/serialisation/SealedClassHelper.kt +++ /dev/null @@ -1,52 +0,0 @@ -package info.nightscout.androidaps.database.serialisation - -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import com.google.gson.TypeAdapter -import com.google.gson.TypeAdapterFactory -import com.google.gson.reflect.TypeToken -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import kotlin.jvm.internal.Reflection -import kotlin.reflect.KClass - -object SealedClassHelper { - - val gson: Gson = GsonBuilder().registerTypeAdapterFactory( - object : TypeAdapterFactory { - override fun create(gson: Gson, type: TypeToken): TypeAdapter { - val kClass = Reflection.getOrCreateKotlinClass(type.rawType) - return if (kClass.sealedSubclasses.any()) { - SealedClassTypeAdapter(kClass, gson) - } else - gson.getDelegateAdapter(this, type) - } - }).create() - - private class SealedClassTypeAdapter(private val kClass: KClass, val gson: Gson) : TypeAdapter() { - - override fun read(jsonReader: JsonReader): T? { - jsonReader.beginObject() - val nextName = jsonReader.nextName() - val innerClass = kClass.sealedSubclasses.firstOrNull { it.simpleName == nextName } - ?: throw Exception("$nextName is not a child of the sealed class ${kClass.qualifiedName}") - val x = gson.fromJson(jsonReader, innerClass.javaObjectType) - jsonReader.endObject() - // if there a static object, actually return that - @Suppress("UNCHECKED_CAST") - return innerClass.objectInstance as T? ?: x - } - - override fun write(out: JsonWriter, value: T) { - val jsonString = gson.toJson(value) - val name = value.javaClass.canonicalName - if (name != null) { - out.beginObject() - out.name(name.splitToSequence(".").last()).jsonValue(jsonString) - out.endObject() - } - } - } -} - -inline fun Gson.fromJson(json: String): T = fromJson(json, object : TypeToken() {}.type) diff --git a/database/impl/src/main/java/info/nightscout/database/impl/AppDatabase.kt b/database/impl/src/main/java/info/nightscout/database/impl/AppDatabase.kt new file mode 100644 index 0000000000..228c3cfa10 --- /dev/null +++ b/database/impl/src/main/java/info/nightscout/database/impl/AppDatabase.kt @@ -0,0 +1,99 @@ +package info.nightscout.database.impl + +import androidx.room.Database +import androidx.room.RoomDatabase +import androidx.room.TypeConverters +import info.nightscout.database.impl.daos.APSResultDao +import info.nightscout.database.impl.daos.APSResultLinkDao +import info.nightscout.database.impl.daos.BolusCalculatorResultDao +import info.nightscout.database.impl.daos.BolusDao +import info.nightscout.database.impl.daos.CarbsDao +import info.nightscout.database.impl.daos.DeviceStatusDao +import info.nightscout.database.impl.daos.EffectiveProfileSwitchDao +import info.nightscout.database.impl.daos.ExtendedBolusDao +import info.nightscout.database.impl.daos.FoodDao +import info.nightscout.database.impl.daos.GlucoseValueDao +import info.nightscout.database.impl.daos.MultiwaveBolusLinkDao +import info.nightscout.database.impl.daos.OfflineEventDao +import info.nightscout.database.impl.daos.PreferenceChangeDao +import info.nightscout.database.impl.daos.ProfileSwitchDao +import info.nightscout.database.impl.daos.TemporaryBasalDao +import info.nightscout.database.impl.daos.TemporaryTargetDao +import info.nightscout.database.impl.daos.TherapyEventDao +import info.nightscout.database.impl.daos.TotalDailyDoseDao +import info.nightscout.database.impl.daos.UserEntryDao +import info.nightscout.database.impl.daos.VersionChangeDao +import info.nightscout.database.entities.APSResult +import info.nightscout.database.entities.APSResultLink +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.DeviceStatus +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.Food +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.MultiwaveBolusLink +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.PreferenceChange +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.VersionChange + +const val DATABASE_VERSION = 22 + +@Database(version = DATABASE_VERSION, + entities = [APSResult::class, Bolus::class, BolusCalculatorResult::class, Carbs::class, + EffectiveProfileSwitch::class, ExtendedBolus::class, GlucoseValue::class, ProfileSwitch::class, + TemporaryBasal::class, TemporaryTarget::class, TherapyEvent::class, TotalDailyDose::class, APSResultLink::class, + MultiwaveBolusLink::class, PreferenceChange::class, VersionChange::class, UserEntry::class, + Food::class, DeviceStatus::class, OfflineEvent::class], + exportSchema = true) +@TypeConverters(Converters::class) +internal abstract class AppDatabase : RoomDatabase() { + + abstract val glucoseValueDao: GlucoseValueDao + + abstract val therapyEventDao: TherapyEventDao + + abstract val temporaryBasalDao: TemporaryBasalDao + + abstract val bolusDao: BolusDao + + abstract val extendedBolusDao: ExtendedBolusDao + + abstract val multiwaveBolusLinkDao: MultiwaveBolusLinkDao + + abstract val totalDailyDoseDao: TotalDailyDoseDao + + abstract val carbsDao: CarbsDao + + abstract val temporaryTargetDao: TemporaryTargetDao + + abstract val apsResultLinkDao: APSResultLinkDao + + abstract val bolusCalculatorResultDao: BolusCalculatorResultDao + + abstract val effectiveProfileSwitchDao: EffectiveProfileSwitchDao + + abstract val profileSwitchDao: ProfileSwitchDao + + abstract val apsResultDao: APSResultDao + + abstract val versionChangeDao: VersionChangeDao + + abstract val userEntryDao: UserEntryDao + + abstract val preferenceChangeDao: PreferenceChangeDao + + abstract val foodDao: FoodDao + + abstract val deviceStatusDao: DeviceStatusDao + + abstract val offlineEventDao: OfflineEventDao + +} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/AppRepository.kt b/database/impl/src/main/java/info/nightscout/database/impl/AppRepository.kt similarity index 97% rename from database/impl/src/main/java/info/nightscout/androidaps/database/AppRepository.kt rename to database/impl/src/main/java/info/nightscout/database/impl/AppRepository.kt index 1019581b80..1ad180b93b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/AppRepository.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/AppRepository.kt @@ -1,25 +1,37 @@ -package info.nightscout.androidaps.database +package info.nightscout.database.impl -import info.nightscout.androidaps.annotations.DbOpenForTesting -import info.nightscout.androidaps.database.data.NewEntries -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.* -import info.nightscout.androidaps.database.interfaces.DBEntry -import info.nightscout.androidaps.database.transactions.Transaction +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.DeviceStatus +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.Food +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.data.NewEntries +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.DBEntry +import info.nightscout.database.impl.transactions.Transaction import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.subjects.PublishSubject -import java.lang.StringBuilder import java.util.concurrent.Callable import java.util.concurrent.TimeUnit import javax.inject.Inject import javax.inject.Singleton import kotlin.math.roundToInt -@DbOpenForTesting +@info.nightscout.database.annotations.DbOpenForTesting @Singleton class AppRepository @Inject internal constructor( internal val database: AppDatabase ) { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/Converters.kt b/database/impl/src/main/java/info/nightscout/database/impl/Converters.kt similarity index 83% rename from database/impl/src/main/java/info/nightscout/androidaps/database/Converters.kt rename to database/impl/src/main/java/info/nightscout/database/impl/Converters.kt index 371976cc5c..39d80b5d14 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/Converters.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/Converters.kt @@ -1,14 +1,23 @@ -package info.nightscout.androidaps.database +package info.nightscout.database.impl import androidx.room.TypeConverter -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.* -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.serialisation.SealedClassHelper -import info.nightscout.androidaps.database.serialisation.fromJson +import info.nightscout.database.entities.APSResult +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.impl.serialisation.SealedClassHelper +import info.nightscout.database.impl.serialisation.fromJson import org.json.JSONArray import org.json.JSONObject @@ -176,9 +185,11 @@ class Converters { val list = mutableListOf() for (i in 0 until jsonArray.length()) { val jsonObject = jsonArray.getJSONObject(i) - list.add(TargetBlock(jsonObject.getLong("duration"), - jsonObject.getDouble("lowTarget"), - jsonObject.getDouble("highTarget"))) + list.add( + TargetBlock(jsonObject.getLong("duration"), + jsonObject.getDouble("lowTarget"), + jsonObject.getDouble("highTarget")) + ) } return list } diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/DatabaseModule.kt b/database/impl/src/main/java/info/nightscout/database/impl/DatabaseModule.kt similarity index 99% rename from database/impl/src/main/java/info/nightscout/androidaps/database/DatabaseModule.kt rename to database/impl/src/main/java/info/nightscout/database/impl/DatabaseModule.kt index a7093c55bb..b04411bafc 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/DatabaseModule.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/DatabaseModule.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database +package info.nightscout.database.impl import android.content.Context import androidx.room.Room diff --git a/database/impl/src/main/java/info/nightscout/database/impl/DelegatedAppDatabase.kt b/database/impl/src/main/java/info/nightscout/database/impl/DelegatedAppDatabase.kt new file mode 100644 index 0000000000..ad6ecf8430 --- /dev/null +++ b/database/impl/src/main/java/info/nightscout/database/impl/DelegatedAppDatabase.kt @@ -0,0 +1,68 @@ +package info.nightscout.database.impl + +import info.nightscout.database.impl.daos.APSResultDao +import info.nightscout.database.impl.daos.APSResultLinkDao +import info.nightscout.database.impl.daos.BolusCalculatorResultDao +import info.nightscout.database.impl.daos.BolusDao +import info.nightscout.database.impl.daos.CarbsDao +import info.nightscout.database.impl.daos.DeviceStatusDao +import info.nightscout.database.impl.daos.EffectiveProfileSwitchDao +import info.nightscout.database.impl.daos.ExtendedBolusDao +import info.nightscout.database.impl.daos.FoodDao +import info.nightscout.database.impl.daos.GlucoseValueDao +import info.nightscout.database.impl.daos.MultiwaveBolusLinkDao +import info.nightscout.database.impl.daos.OfflineEventDao +import info.nightscout.database.impl.daos.PreferenceChangeDao +import info.nightscout.database.impl.daos.ProfileSwitchDao +import info.nightscout.database.impl.daos.TemporaryBasalDao +import info.nightscout.database.impl.daos.TemporaryTargetDao +import info.nightscout.database.impl.daos.TherapyEventDao +import info.nightscout.database.impl.daos.TotalDailyDoseDao +import info.nightscout.database.impl.daos.UserEntryDao +import info.nightscout.database.impl.daos.VersionChangeDao +import info.nightscout.database.impl.daos.delegated.DelegatedAPSResultDao +import info.nightscout.database.impl.daos.delegated.DelegatedAPSResultLinkLinkDao +import info.nightscout.database.impl.daos.delegated.DelegatedBolusCalculatorResultDao +import info.nightscout.database.impl.daos.delegated.DelegatedBolusDao +import info.nightscout.database.impl.daos.delegated.DelegatedCarbsDao +import info.nightscout.database.impl.daos.delegated.DelegatedDeviceStatusDao +import info.nightscout.database.impl.daos.delegated.DelegatedEffectiveProfileSwitchDao +import info.nightscout.database.impl.daos.delegated.DelegatedExtendedExtendedBolusDao +import info.nightscout.database.impl.daos.delegated.DelegatedFoodDao +import info.nightscout.database.impl.daos.delegated.DelegatedGlucoseValueDao +import info.nightscout.database.impl.daos.delegated.DelegatedMultiwaveBolusLinkDao +import info.nightscout.database.impl.daos.delegated.DelegatedOfflineEventDao +import info.nightscout.database.impl.daos.delegated.DelegatedPreferenceChangeDao +import info.nightscout.database.impl.daos.delegated.DelegatedProfileSwitchDao +import info.nightscout.database.impl.daos.delegated.DelegatedTemporaryBasalDao +import info.nightscout.database.impl.daos.delegated.DelegatedTemporaryTargetDao +import info.nightscout.database.impl.daos.delegated.DelegatedTherapyEventDao +import info.nightscout.database.impl.daos.delegated.DelegatedTotalDailyDoseDao +import info.nightscout.database.impl.daos.delegated.DelegatedUserEntryDao +import info.nightscout.database.impl.daos.delegated.DelegatedVersionChangeDao +import info.nightscout.database.entities.interfaces.DBEntry + +internal class DelegatedAppDatabase(val changes: MutableList, val database: AppDatabase) { + + val glucoseValueDao: GlucoseValueDao = DelegatedGlucoseValueDao(changes, database.glucoseValueDao) + val therapyEventDao: TherapyEventDao = DelegatedTherapyEventDao(changes, database.therapyEventDao) + val temporaryBasalDao: TemporaryBasalDao = DelegatedTemporaryBasalDao(changes, database.temporaryBasalDao) + val bolusDao: BolusDao = DelegatedBolusDao(changes, database.bolusDao) + val extendedBolusDao: ExtendedBolusDao = DelegatedExtendedExtendedBolusDao(changes, database.extendedBolusDao) + val multiwaveBolusLinkDao: MultiwaveBolusLinkDao = DelegatedMultiwaveBolusLinkDao(changes, database.multiwaveBolusLinkDao) + val totalDailyDoseDao: TotalDailyDoseDao = DelegatedTotalDailyDoseDao(changes, database.totalDailyDoseDao) + val carbsDao: CarbsDao = DelegatedCarbsDao(changes, database.carbsDao) + val temporaryTargetDao: TemporaryTargetDao = DelegatedTemporaryTargetDao(changes, database.temporaryTargetDao) + val apsResultLinkDao: APSResultLinkDao = DelegatedAPSResultLinkLinkDao(changes, database.apsResultLinkDao) + val bolusCalculatorResultDao: BolusCalculatorResultDao = DelegatedBolusCalculatorResultDao(changes, database.bolusCalculatorResultDao) + val effectiveProfileSwitchDao: EffectiveProfileSwitchDao = DelegatedEffectiveProfileSwitchDao(changes, database.effectiveProfileSwitchDao) + val profileSwitchDao: ProfileSwitchDao = DelegatedProfileSwitchDao(changes, database.profileSwitchDao) + val apsResultDao: APSResultDao = DelegatedAPSResultDao(changes, database.apsResultDao) + val versionChangeDao: VersionChangeDao = DelegatedVersionChangeDao(changes, database.versionChangeDao) + val userEntryDao: UserEntryDao = DelegatedUserEntryDao(changes, database.userEntryDao) + val preferenceChangeDao: PreferenceChangeDao = DelegatedPreferenceChangeDao(changes, database.preferenceChangeDao) + val foodDao: FoodDao = DelegatedFoodDao(changes, database.foodDao) + val deviceStatusDao: DeviceStatusDao = DelegatedDeviceStatusDao(changes, database.deviceStatusDao) + val offlineEventDao: OfflineEventDao = DelegatedOfflineEventDao(changes, database.offlineEventDao) + fun clearAllTables() = database.clearAllTables() +} \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultDao.kt similarity index 82% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultDao.kt index 2958ba90db..c16a81486f 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_APS_RESULTS -import info.nightscout.androidaps.database.entities.APSResult +import info.nightscout.database.entities.APSResult +import info.nightscout.database.entities.TABLE_APS_RESULTS @Suppress("FunctionName") @Dao diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultLinkDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultLinkDao.kt similarity index 77% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultLinkDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultLinkDao.kt index 1b0568c917..31c99be5ad 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/APSResultLinkDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/APSResultLinkDao.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_APS_RESULTS -import info.nightscout.androidaps.database.TABLE_APS_RESULT_LINKS -import info.nightscout.androidaps.database.entities.APSResultLink +import info.nightscout.database.entities.APSResultLink +import info.nightscout.database.entities.TABLE_APS_RESULTS +import info.nightscout.database.entities.TABLE_APS_RESULT_LINKS @Dao internal interface APSResultLinkDao : TraceableDao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusCalculatorResultDao.kt similarity index 93% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/BolusCalculatorResultDao.kt index 05554208c8..b2432d2ada 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusCalculatorResultDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_BOLUS_CALCULATOR_RESULTS -import info.nightscout.androidaps.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.TABLE_BOLUS_CALCULATOR_RESULTS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusDao.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/BolusDao.kt index c1a35fac28..df1a9c7d2f 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/BolusDao.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_BOLUSES -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.TABLE_BOLUSES +import info.nightscout.database.entities.embedments.InterfaceIDs import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/CarbsDao.kt similarity index 96% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/CarbsDao.kt index 53bd6c789b..7cf52a10d8 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/CarbsDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_CARBS -import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.TABLE_CARBS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/DeviceStatusDao.kt similarity index 89% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/DeviceStatusDao.kt index addf3e2f21..35627f67c6 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/DeviceStatusDao.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Insert import androidx.room.Query import androidx.room.Update -import info.nightscout.androidaps.database.TABLE_DEVICE_STATUS -import info.nightscout.androidaps.database.entities.DeviceStatus +import info.nightscout.database.entities.DeviceStatus +import info.nightscout.database.entities.TABLE_DEVICE_STATUS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/EffectiveProfileSwitchDao.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/EffectiveProfileSwitchDao.kt index aeeb9d1066..5fa4b6b233 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/EffectiveProfileSwitchDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_EFFECTIVE_PROFILE_SWITCHES -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.TABLE_EFFECTIVE_PROFILE_SWITCHES import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/ExtendedBolusDao.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/ExtendedBolusDao.kt index 84a9aa4557..65ea850580 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/ExtendedBolusDao.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_EXTENDED_BOLUSES -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.ExtendedBolus +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.TABLE_EXTENDED_BOLUSES +import info.nightscout.database.entities.embedments.InterfaceIDs import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/FoodDao.kt similarity index 90% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/FoodDao.kt index 492f02329e..fc3d85989b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/FoodDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_FOODS -import info.nightscout.androidaps.database.entities.Food +import info.nightscout.database.entities.Food +import info.nightscout.database.entities.TABLE_FOODS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/GlucoseValueDao.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/GlucoseValueDao.kt index 02687b0a7d..f30847c410 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/GlucoseValueDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_GLUCOSE_VALUES -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.TABLE_GLUCOSE_VALUES import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/MultiwaveBolusLinkDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/MultiwaveBolusLinkDao.kt similarity index 82% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/MultiwaveBolusLinkDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/MultiwaveBolusLinkDao.kt index 0bdb02b863..26a8cfad20 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/MultiwaveBolusLinkDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/MultiwaveBolusLinkDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_MULTIWAVE_BOLUS_LINKS -import info.nightscout.androidaps.database.entities.MultiwaveBolusLink +import info.nightscout.database.entities.MultiwaveBolusLink +import info.nightscout.database.entities.TABLE_MULTIWAVE_BOLUS_LINKS @Dao internal interface MultiwaveBolusLinkDao : TraceableDao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/OfflineEventDao.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/OfflineEventDao.kt index d8ce6c88a3..06bcf84542 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/OfflineEventDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_OFFLINE_EVENTS -import info.nightscout.androidaps.database.entities.OfflineEvent +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.TABLE_OFFLINE_EVENTS import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/PreferenceChangeDao.kt similarity index 74% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/PreferenceChangeDao.kt index a617e254e3..60896ddcbd 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/PreferenceChangeDao.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Insert import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_PREFERENCE_CHANGES -import info.nightscout.androidaps.database.entities.PreferenceChange +import info.nightscout.database.entities.PreferenceChange +import info.nightscout.database.entities.TABLE_PREFERENCE_CHANGES @Dao interface PreferenceChangeDao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/ProfileSwitchDao.kt similarity index 91% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/ProfileSwitchDao.kt index ca994c6ccf..a15d7e1315 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/ProfileSwitchDao.kt @@ -1,16 +1,15 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_PROFILE_SWITCHES -import info.nightscout.androidaps.database.daos.workaround.ProfileSwitchDaoWorkaround -import info.nightscout.androidaps.database.data.checkSanity -import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TABLE_PROFILE_SWITCHES +import info.nightscout.database.entities.data.checkSanity import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single @Dao -internal interface ProfileSwitchDao : ProfileSwitchDaoWorkaround { +internal interface ProfileSwitchDao : info.nightscout.database.impl.daos.workaround.ProfileSwitchDaoWorkaround { @Query("SELECT * FROM $TABLE_PROFILE_SWITCHES WHERE id = :id") override fun findById(id: Long): ProfileSwitch? diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryBasalDao.kt similarity index 95% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryBasalDao.kt index 40a84e90c5..88865ce2e8 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryBasalDao.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_TEMPORARY_BASALS -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TABLE_TEMPORARY_BASALS +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.embedments.InterfaceIDs import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryTargetDao.kt similarity index 93% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryTargetDao.kt index c002085377..f123ecd975 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TemporaryTargetDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_TEMPORARY_TARGETS -import info.nightscout.androidaps.database.entities.TemporaryTarget +import info.nightscout.database.entities.TABLE_TEMPORARY_TARGETS +import info.nightscout.database.entities.TemporaryTarget import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TherapyEventDao.kt similarity index 95% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/TherapyEventDao.kt index 4a170f7fae..8150021416 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TherapyEventDao.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_THERAPY_EVENTS -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TABLE_THERAPY_EVENTS +import info.nightscout.database.entities.TherapyEvent import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TotalDailyDoseDao.kt similarity index 89% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/TotalDailyDoseDao.kt index f630a6ef20..35eaac29e5 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TotalDailyDoseDao.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_TOTAL_DAILY_DOSES -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TotalDailyDose +import info.nightscout.database.entities.TABLE_TOTAL_DAILY_DOSES +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.embedments.InterfaceIDs import io.reactivex.rxjava3.core.Maybe import io.reactivex.rxjava3.core.Single diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TraceableDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/TraceableDao.kt similarity index 87% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/TraceableDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/TraceableDao.kt index 080987c185..f0e753c035 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/TraceableDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/TraceableDao.kt @@ -1,11 +1,10 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Insert import androidx.room.Update -import info.nightscout.androidaps.database.daos.workaround.TraceableDaoWorkaround -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry +import info.nightscout.database.entities.interfaces.TraceableDBEntry -internal interface TraceableDao : TraceableDaoWorkaround { +internal interface TraceableDao : info.nightscout.database.impl.daos.workaround.TraceableDaoWorkaround { fun findById(id: Long): T? diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/UserEntryDao.kt similarity index 77% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/UserEntryDao.kt index a5f1979c35..9af90ad9aa 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/UserEntryDao.kt @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Insert import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_USER_ENTRY -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Sources +import info.nightscout.database.entities.TABLE_USER_ENTRY +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Sources import io.reactivex.rxjava3.core.Single @Dao diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/VersionChangeDao.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/VersionChangeDao.kt index c691981c50..a93e00b812 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/VersionChangeDao.kt @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.database.daos +package info.nightscout.database.impl.daos import androidx.room.Dao import androidx.room.Insert import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_VERSION_CHANGES -import info.nightscout.androidaps.database.entities.VersionChange +import info.nightscout.database.entities.TABLE_VERSION_CHANGES +import info.nightscout.database.entities.VersionChange @Dao interface VersionChangeDao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultDao.kt index ffe6180770..e99f80efd7 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.APSResultDao -import info.nightscout.androidaps.database.entities.APSResult -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.entities.APSResult +import info.nightscout.database.entities.interfaces.DBEntry +import info.nightscout.database.impl.daos.APSResultDao internal class DelegatedAPSResultDao(changes: MutableList, private val dao: APSResultDao) : DelegatedDao(changes), APSResultDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultLinkDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultLinkDao.kt similarity index 64% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultLinkDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultLinkDao.kt index 2152d3f9f0..a165536fcd 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedAPSResultLinkDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedAPSResultLinkDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.APSResultLinkDao -import info.nightscout.androidaps.database.entities.APSResultLink -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.APSResultLinkDao +import info.nightscout.database.entities.APSResultLink +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedAPSResultLinkLinkDao(changes: MutableList, private val dao: APSResultLinkDao) : DelegatedDao(changes), APSResultLinkDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusCalculatorResultDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusCalculatorResultDao.kt similarity index 64% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusCalculatorResultDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusCalculatorResultDao.kt index 40e92dcb04..0a6817a3c3 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusCalculatorResultDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusCalculatorResultDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.BolusCalculatorResultDao -import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.BolusCalculatorResultDao +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedBolusCalculatorResultDao(changes: MutableList, private val dao: BolusCalculatorResultDao) : DelegatedDao(changes), BolusCalculatorResultDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusDao.kt index 67afec9e18..d35b0f38ce 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedBolusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedBolusDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.BolusDao -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.BolusDao +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedBolusDao(changes: MutableList, private val dao: BolusDao) : DelegatedDao(changes), BolusDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedCarbsDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedCarbsDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedCarbsDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedCarbsDao.kt index 0a2da34a05..58bb4f809e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedCarbsDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedCarbsDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.CarbsDao -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.CarbsDao +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedCarbsDao(changes: MutableList, private val dao: CarbsDao) : DelegatedDao(changes), CarbsDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDao.kt similarity index 55% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDao.kt index ff5fe9ba64..2c22734e97 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDao.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.entities.interfaces.DBEntry /** * A DAO that adds updated or inserted entries to a list diff --git a/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDeviceStatusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDeviceStatusDao.kt new file mode 100644 index 0000000000..cc11ece89c --- /dev/null +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedDeviceStatusDao.kt @@ -0,0 +1,6 @@ +package info.nightscout.database.impl.daos.delegated + +import info.nightscout.database.impl.daos.DeviceStatusDao +import info.nightscout.database.entities.interfaces.DBEntry + +internal class DelegatedDeviceStatusDao(changes: MutableList, private val dao: DeviceStatusDao) : DelegatedDao(changes), DeviceStatusDao by dao \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt similarity index 64% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt index 6516ffbc6c..4180653fdc 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedEffectiveProfileSwitchDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.EffectiveProfileSwitchDao -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.EffectiveProfileSwitchDao +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedEffectiveProfileSwitchDao(changes: MutableList, private val dao: EffectiveProfileSwitchDao) : DelegatedDao(changes), EffectiveProfileSwitchDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedExtendedBolusDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedExtendedBolusDao.kt similarity index 64% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedExtendedBolusDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedExtendedBolusDao.kt index fa3a6369fd..76e89815dd 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedExtendedBolusDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedExtendedBolusDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.ExtendedBolusDao -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.ExtendedBolusDao +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedExtendedExtendedBolusDao(changes: MutableList, private val dao: ExtendedBolusDao) : DelegatedDao(changes), ExtendedBolusDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedFoodDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedFoodDao.kt similarity index 62% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedFoodDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedFoodDao.kt index 2d37a3e5be..d78aac0fa8 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedFoodDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedFoodDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.FoodDao -import info.nightscout.androidaps.database.entities.Food -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.FoodDao +import info.nightscout.database.entities.Food +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedFoodDao(changes: MutableList, private val dao: FoodDao) : DelegatedDao(changes), FoodDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedGlucoseValueDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedGlucoseValueDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedGlucoseValueDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedGlucoseValueDao.kt index d16e84ebc5..e2eec39c07 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedGlucoseValueDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedGlucoseValueDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.GlucoseValueDao -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.GlucoseValueDao +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedGlucoseValueDao(changes: MutableList, private val dao: GlucoseValueDao) : DelegatedDao(changes), GlucoseValueDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt similarity index 64% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt index fd6079a146..c4263e79d9 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedMultiwaveBolusLinkDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.MultiwaveBolusLinkDao -import info.nightscout.androidaps.database.entities.MultiwaveBolusLink -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.MultiwaveBolusLinkDao +import info.nightscout.database.entities.MultiwaveBolusLink +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedMultiwaveBolusLinkDao(changes: MutableList, private val dao: MultiwaveBolusLinkDao) : DelegatedDao(changes), MultiwaveBolusLinkDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedOfflineEventDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedOfflineEventDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedOfflineEventDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedOfflineEventDao.kt index fc2bc94c30..bd25c6afdc 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedOfflineEventDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedOfflineEventDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.OfflineEventDao -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.OfflineEventDao +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedOfflineEventDao(changes: MutableList, private val dao: OfflineEventDao) : DelegatedDao(changes), OfflineEventDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedPreferenceChangeDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedPreferenceChangeDao.kt similarity index 55% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedPreferenceChangeDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedPreferenceChangeDao.kt index 97ba761423..37210a727f 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedPreferenceChangeDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedPreferenceChangeDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.PreferenceChangeDao -import info.nightscout.androidaps.database.entities.PreferenceChange -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.PreferenceChangeDao +import info.nightscout.database.entities.PreferenceChange +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedPreferenceChangeDao(changes: MutableList, private val dao: PreferenceChangeDao) : DelegatedDao(changes), PreferenceChangeDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedProfileSwitchDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedProfileSwitchDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedProfileSwitchDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedProfileSwitchDao.kt index 11ded9ccdc..4d22152451 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedProfileSwitchDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedProfileSwitchDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.ProfileSwitchDao -import info.nightscout.androidaps.database.entities.ProfileSwitch -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.ProfileSwitchDao +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedProfileSwitchDao(changes: MutableList, private val dao: ProfileSwitchDao) : DelegatedDao(changes), ProfileSwitchDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryBasalDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryBasalDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryBasalDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryBasalDao.kt index c48ca004cb..13ef3fe130 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryBasalDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryBasalDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.TemporaryBasalDao -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.TemporaryBasalDao +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedTemporaryBasalDao(changes: MutableList, private val dao: TemporaryBasalDao) : DelegatedDao(changes), TemporaryBasalDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryTargetDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryTargetDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryTargetDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryTargetDao.kt index a3cba800f5..9b0b0307c3 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTemporaryTargetDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTemporaryTargetDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.TemporaryTargetDao -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.TemporaryTargetDao +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedTemporaryTargetDao(changes: MutableList, private val dao: TemporaryTargetDao) : DelegatedDao(changes), TemporaryTargetDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTherapyEventDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTherapyEventDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTherapyEventDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTherapyEventDao.kt index 767edd50a9..099d043f4f 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTherapyEventDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTherapyEventDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.TherapyEventDao -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.TherapyEventDao +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedTherapyEventDao(changes: MutableList, private val dao: TherapyEventDao) : DelegatedDao(changes), TherapyEventDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTotalDailyDoseDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTotalDailyDoseDao.kt similarity index 63% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTotalDailyDoseDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTotalDailyDoseDao.kt index 95bc5ab108..f69e83e6f9 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedTotalDailyDoseDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedTotalDailyDoseDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.TotalDailyDoseDao -import info.nightscout.androidaps.database.entities.TotalDailyDose -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.TotalDailyDoseDao +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedTotalDailyDoseDao(changes: MutableList, private val dao: TotalDailyDoseDao) : DelegatedDao(changes), TotalDailyDoseDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedUserEntryDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedUserEntryDao.kt similarity index 52% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedUserEntryDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedUserEntryDao.kt index b0b8eb4c19..9faed2f2c0 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedUserEntryDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedUserEntryDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.UserEntryDao -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.UserEntryDao +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedUserEntryDao(changes: MutableList, private val dao: UserEntryDao) : DelegatedDao(changes), UserEntryDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedVersionChangeDao.kt b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedVersionChangeDao.kt similarity index 54% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedVersionChangeDao.kt rename to database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedVersionChangeDao.kt index 81a5ecb799..4f2564efa9 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/delegated/DelegatedVersionChangeDao.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/delegated/DelegatedVersionChangeDao.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.daos.delegated +package info.nightscout.database.impl.daos.delegated -import info.nightscout.androidaps.database.daos.VersionChangeDao -import info.nightscout.androidaps.database.entities.VersionChange -import info.nightscout.androidaps.database.interfaces.DBEntry +import info.nightscout.database.impl.daos.VersionChangeDao +import info.nightscout.database.entities.VersionChange +import info.nightscout.database.entities.interfaces.DBEntry internal class DelegatedVersionChangeDao(changes: MutableList, private val dao: VersionChangeDao) : DelegatedDao(changes), VersionChangeDao by dao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/ProfileSwitchDaoWorkaround.java b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/ProfileSwitchDaoWorkaround.java similarity index 60% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/ProfileSwitchDaoWorkaround.java rename to database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/ProfileSwitchDaoWorkaround.java index 9a817ff215..04fc586e06 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/ProfileSwitchDaoWorkaround.java +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/ProfileSwitchDaoWorkaround.java @@ -1,11 +1,11 @@ -package info.nightscout.androidaps.database.daos.workaround; +package info.nightscout.database.impl.daos.workaround; import androidx.room.Transaction; -import info.nightscout.androidaps.database.daos.ProfileSwitchDao; -import info.nightscout.androidaps.database.daos.ProfileSwitchDaoKt; -import info.nightscout.androidaps.database.daos.TraceableDao; -import info.nightscout.androidaps.database.entities.ProfileSwitch; +import info.nightscout.database.impl.daos.ProfileSwitchDaoKt; +import info.nightscout.database.entities.ProfileSwitch; +import info.nightscout.database.impl.daos.ProfileSwitchDao; +import info.nightscout.database.impl.daos.TraceableDao; public interface ProfileSwitchDaoWorkaround extends TraceableDao { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/TraceableDaoWorkaround.java b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/TraceableDaoWorkaround.java similarity index 71% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/TraceableDaoWorkaround.java rename to database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/TraceableDaoWorkaround.java index 0e2540d088..355d750a9d 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/TraceableDaoWorkaround.java +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/TraceableDaoWorkaround.java @@ -1,10 +1,10 @@ -package info.nightscout.androidaps.database.daos.workaround; +package info.nightscout.database.impl.daos.workaround; import androidx.room.Transaction; -import info.nightscout.androidaps.database.daos.TraceableDao; -import info.nightscout.androidaps.database.daos.TraceableDaoKt; -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry; +import info.nightscout.database.impl.daos.TraceableDaoKt; +import info.nightscout.database.entities.interfaces.TraceableDBEntry; +import info.nightscout.database.impl.daos.TraceableDao; // keep in java, it's easier public interface TraceableDaoWorkaround { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/package-info.java b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/package-info.java similarity index 74% rename from database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/package-info.java rename to database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/package-info.java index 089581be3b..5269c8bd8c 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/daos/workaround/package-info.java +++ b/database/impl/src/main/java/info/nightscout/database/impl/daos/workaround/package-info.java @@ -2,4 +2,4 @@ * Workarounds until Kotlin is able to properly translate interface default methods while annotation processing. * See https://youtrack.jetbrains.com/issue/KT-25960 */ -package info.nightscout.androidaps.database.daos.workaround; \ No newline at end of file +package info.nightscout.database.impl.daos.workaround; \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/SealedClassHelper.kt b/database/impl/src/main/java/info/nightscout/database/impl/serialisation/SealedClassHelper.kt similarity index 97% rename from core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/SealedClassHelper.kt rename to database/impl/src/main/java/info/nightscout/database/impl/serialisation/SealedClassHelper.kt index a3fd471bd2..3ef63cbaa4 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/serialisation/SealedClassHelper.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/serialisation/SealedClassHelper.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.utils.serialisation +package info.nightscout.database.impl.serialisation import com.google.gson.Gson import com.google.gson.GsonBuilder diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt index 6d5e1c1794..a7e1144d48 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentOfflineEventIfAnyTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.interfaces.end class CancelCurrentOfflineEventIfAnyTransaction( val timestamp: Long diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt index f2d65145c2..79ee6841b3 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CancelCurrentTemporaryTargetIfAnyTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.interfaces.end class CancelCurrentTemporaryTargetIfAnyTransaction( val timestamp: Long diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CgmSourceTransaction.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/CgmSourceTransaction.kt index 939ebbe817..1f3070a319 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CgmSourceTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CgmSourceTransaction.kt @@ -1,8 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.entities.ProfileSwitch -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.TherapyEvent /** * Inserts data from a CGM source into the database diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CutCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CutCarbsTransaction.kt similarity index 85% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CutCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/CutCarbsTransaction.kt index 90637de496..8b789e3434 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/CutCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/CutCarbsTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.interfaces.end import kotlin.math.roundToInt class CutCarbsTransaction(val id: Long, val end: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt index f4dd63fe81..2b49d95e37 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentOfflineEventTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.interfaces.end class InsertAndCancelCurrentOfflineEventTransaction( val offlineEvent: OfflineEvent diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt similarity index 86% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt index 87867309b6..687c27442b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertAndCancelCurrentTemporaryTargetTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.interfaces.end class InsertAndCancelCurrentTemporaryTargetTransaction( val temporaryTarget: TemporaryTarget diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertBolusWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertBolusWithTempIdTransaction.kt similarity index 88% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertBolusWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertBolusWithTempIdTransaction.kt index 2b7ad086ac..3096e8c943 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertBolusWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertBolusWithTempIdTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus /** * Creates or updates the Bolus from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertGlucoseValueTransaction.kt similarity index 64% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertGlucoseValueTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertGlucoseValueTransaction.kt index b75c4a3928..3c0c8215c2 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertGlucoseValueTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertGlucoseValueTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue /** * Creates the GlucoseValue diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampCarbsTransaction.kt similarity index 82% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampCarbsTransaction.kt index 9fed606fde..5d2cdfe2a1 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampCarbsTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.embedments.InterfaceIDs /** * Creates Carbs if record doesn't exist @@ -15,12 +15,14 @@ class InsertIfNewByTimestampCarbsTransaction( amount: Double, duration: Long, interfaceIDs_backing: InterfaceIDs? = null - ) : this(Carbs( + ) : this( + Carbs( timestamp = timestamp, amount = amount, duration = duration, interfaceIDs_backing = interfaceIDs_backing - )) + ) + ) override fun run(): TransactionResult { val result = TransactionResult() diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt similarity index 90% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt index d283f0c6ca..1214595809 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertIfNewByTimestampTherapyEventTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TherapyEvent class InsertIfNewByTimestampTherapyEventTransaction( val therapyEvent: TherapyEvent diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt similarity index 82% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt index dfef194370..0f4fee61d5 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusCalculatorResultTransaction.kt @@ -1,7 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.BolusCalculatorResult /** * Creates or updates the BolusCalculatorResult diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusTransaction.kt similarity index 81% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusTransaction.kt index 25fe10c062..9d3d2ff894 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateBolusTransaction.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.embedments.InsulinConfiguration +import info.nightscout.database.entities.embedments.InterfaceIDs /** * Creates or updates the Bolus @@ -19,7 +19,8 @@ class InsertOrUpdateBolusTransaction( isBasalInsulin: Boolean = false, insulinConfiguration: InsulinConfiguration? = null, interfaceIDs_backing: InterfaceIDs? = null - ) : this(Bolus( + ) : this( + Bolus( timestamp = timestamp, amount = amount, type = type, @@ -27,7 +28,8 @@ class InsertOrUpdateBolusTransaction( isBasalInsulin = isBasalInsulin, insulinConfiguration = insulinConfiguration, interfaceIDs_backing = interfaceIDs_backing - )) + ) + ) override fun run(): TransactionResult { val result = TransactionResult() diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateCarbsTransaction.kt similarity index 83% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateCarbsTransaction.kt index 8f84cfb0ec..57d58dfb67 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateCarbsTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.embedments.InterfaceIDs /** * Creates or updates the Carbs @@ -16,13 +16,15 @@ class InsertOrUpdateCarbsTransaction( duration: Long, notes: String, interfaceIDs_backing: InterfaceIDs? = null - ) : this(Carbs( + ) : this( + Carbs( timestamp = timestamp, amount = amount, duration = duration, notes = notes, interfaceIDs_backing = interfaceIDs_backing - )) + ) + ) override fun run(): TransactionResult { val result = TransactionResult() diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateFoodTransaction.kt similarity index 86% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateFoodTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateFoodTransaction.kt index 7de6457542..e72bcb51db 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateFoodTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateFoodTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Food +import info.nightscout.database.entities.Food /** * Inserts or updates the Food diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateProfileSwitch.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateProfileSwitch.kt similarity index 86% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateProfileSwitch.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateProfileSwitch.kt index 3a12a58e21..c420df5d69 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertOrUpdateProfileSwitch.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertOrUpdateProfileSwitch.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.database.entities.ProfileSwitch class InsertOrUpdateProfileSwitch(val profileSwitch: ProfileSwitch) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTemporaryBasalWithTempIdTransaction.kt similarity index 88% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTemporaryBasalWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTemporaryBasalWithTempIdTransaction.kt index 27f931bcd9..9c94e62042 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTemporaryBasalWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTemporaryBasalWithTempIdTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal /** * Creates or updates the TemporaryBasal from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTherapyEventAnnouncementTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTherapyEventAnnouncementTransaction.kt similarity index 86% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTherapyEventAnnouncementTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTherapyEventAnnouncementTransaction.kt index fe9f4196f7..dca1c8afb2 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InsertTherapyEventAnnouncementTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InsertTherapyEventAnnouncementTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.embedments.InterfaceIDs class InsertTherapyEventAnnouncementTransaction( val therapyEvent: TherapyEvent diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt similarity index 85% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt index 2a152c408c..1c7ddc8c0e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateAAPSStartedTherapyEventTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TherapyEvent class InvalidateAAPSStartedTherapyEventTransaction(private val note: String) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusCalculatorResultTransaction.kt similarity index 85% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusCalculatorResultTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusCalculatorResultTransaction.kt index 968efee665..e44afd114e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusCalculatorResultTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusCalculatorResultTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.BolusCalculatorResult class InvalidateBolusCalculatorResultTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusTransaction.kt similarity index 83% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusTransaction.kt index ac2dcad063..5f70905c5f 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateBolusTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus class InvalidateBolusTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateCarbsTransaction.kt similarity index 83% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateCarbsTransaction.kt index 9e9b373a33..ef9eabbe91 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateCarbsTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.database.entities.Carbs class InvalidateCarbsTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateExtendedBolusTransaction.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateExtendedBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateExtendedBolusTransaction.kt index 7f28f09acf..b262c53627 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateExtendedBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateExtendedBolusTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.ExtendedBolus +import info.nightscout.database.entities.ExtendedBolus class InvalidateExtendedBolusTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateFoodTransaction.kt similarity index 85% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateFoodTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateFoodTransaction.kt index a1f7b545e9..3074b16f11 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateFoodTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateFoodTransaction.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions class InvalidateFoodTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateGlucoseValueTransaction.kt similarity index 85% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateGlucoseValueTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateGlucoseValueTransaction.kt index 91669d5e70..77a6fd97ae 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateGlucoseValueTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateGlucoseValueTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue /** * Invalidates the GlucoseValue with the specified id diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateNsIdProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateNsIdProfileSwitchTransaction.kt similarity index 77% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateNsIdProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateNsIdProfileSwitchTransaction.kt index 67cb703cc6..b70912bca3 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateNsIdProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateNsIdProfileSwitchTransaction.kt @@ -1,7 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Food -import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.database.entities.ProfileSwitch class InvalidateNsIdProfileSwitchTransaction(val nsId: String) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateOfflineEventTransaction.kt similarity index 87% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateOfflineEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateOfflineEventTransaction.kt index 9db9b8e84a..51cf8fc424 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateOfflineEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateOfflineEventTransaction.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions class InvalidateOfflineEventTransaction(val id: Long) : Transaction() { override fun run() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateProfileSwitchTransaction.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateProfileSwitchTransaction.kt index f51f46d106..f5089694fd 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.database.entities.ProfileSwitch class InvalidateProfileSwitchTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransaction.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransaction.kt index 5fcc6d90be..143fa2a92a 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal class InvalidateTemporaryBasalTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt similarity index 80% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt index 558731b28c..d4ed06050e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalTransactionWithPumpId.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.embedments.InterfaceIDs class InvalidateTemporaryBasalTransactionWithPumpId(val pumpId: Long, val pumpType: InterfaceIDs.PumpType, val pumpSerial: diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt similarity index 85% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt index 1e1afaf4d8..9056ea96db 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryBasalWithTempIdTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal class InvalidateTemporaryBasalWithTempIdTransaction(val tempId: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryTargetTransaction.kt similarity index 87% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryTargetTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryTargetTransaction.kt index 7109fbf672..043889f543 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTemporaryTargetTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTemporaryTargetTransaction.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions class InvalidateTemporaryTargetTransaction(val id: Long) : Transaction() { override fun run() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTherapyEventTransaction.kt similarity index 84% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTherapyEventTransaction.kt index 3368d05996..2cf2319a3a 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/InvalidateTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/InvalidateTherapyEventTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TherapyEvent class InvalidateTherapyEventTransaction(val id: Long) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncBolusWithTempIdTransaction.kt similarity index 90% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncBolusWithTempIdTransaction.kt index 99449f5ce7..46624928d1 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncBolusWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncBolusWithTempIdTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus /** * Creates or updates the Bolus from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusCalculatorResultTransaction.kt similarity index 93% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusCalculatorResultTransaction.kt index bc9d4b0c07..c81cdaaadc 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusCalculatorResultTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusCalculatorResultTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.BolusCalculatorResult /** * Sync the BolusCalculatorResult from NS diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusTransaction.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusTransaction.kt index a7f1c8b7f4..4098dc194a 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsBolusTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus /** * Sync the Bolus from NS diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsCarbsTransaction.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsCarbsTransaction.kt index 5e3bb60d94..f633bd1108 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsCarbsTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.database.entities.Carbs /** * Sync the carbs from NS diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsEffectiveProfileSwitchTransaction.kt similarity index 93% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsEffectiveProfileSwitchTransaction.kt index 81d264e79a..18f0c87203 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsEffectiveProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsEffectiveProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.EffectiveProfileSwitch /** * Sync the EffectiveProfileSwitch from NS diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsExtendedBolusTransaction.kt similarity index 95% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsExtendedBolusTransaction.kt index cd8f3accd1..7e13f94415 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsExtendedBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsExtendedBolusTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.interfaces.end import kotlin.math.abs /** diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsFoodTransaction.kt similarity index 91% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsFoodTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsFoodTransaction.kt index 0ed3d70d93..33c1f68eb1 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsFoodTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsFoodTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Food +import info.nightscout.database.entities.Food /** * Sync the TherapyEvents from NS diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsOfflineEventTransaction.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsOfflineEventTransaction.kt index e787c591f3..44c142177e 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsOfflineEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsOfflineEventTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.interfaces.end import kotlin.math.abs /** diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsProfileSwitchTransaction.kt similarity index 93% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsProfileSwitchTransaction.kt index e11f5ebad0..33e90ecb9b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.database.entities.ProfileSwitch /** * Sync the ProfileSwitch from NS diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryBasalTransaction.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryBasalTransaction.kt index 1789102029..7f78c1a968 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryBasalTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryBasalTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.interfaces.end import kotlin.math.abs /** diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryTargetTransaction.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryTargetTransaction.kt index d3fcb29cf1..f01d90e425 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTemporaryTargetTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTemporaryTargetTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.interfaces.end import kotlin.math.abs /** diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTherapyEventTransaction.kt similarity index 94% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTherapyEventTransaction.kt index f0fa5104c1..cd0c1e37e4 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncNsTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncNsTherapyEventTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TherapyEvent /** * Sync the TherapyEvents from NS diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpBolusTransaction.kt similarity index 92% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpBolusTransaction.kt index c7ff85ba21..7063fb0db3 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpBolusTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus /** * Creates or updates the Bolus from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt similarity index 82% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt index 5553a7b1b1..e22e819d7a 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelExtendedBolusIfAnyTransaction.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.end class SyncPumpCancelExtendedBolusIfAnyTransaction( private val timestamp: Long, private val endPumpId: Long, private val pumpType: InterfaceIDs.PumpType, private val pumpSerial: String diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt index c66ab184e5..2523adbe18 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpCancelTemporaryBasalIfAnyTransaction.kt @@ -1,8 +1,8 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.entities.interfaces.end class SyncPumpCancelTemporaryBasalIfAnyTransaction( private val timestamp: Long, private val endPumpId: Long, private val pumpType: InterfaceIDs.PumpType, private val pumpSerial: String @@ -27,6 +27,6 @@ class SyncPumpCancelTemporaryBasalIfAnyTransaction( class TransactionResult { - val updated = mutableListOf>() + val updated = mutableListOf>() } } \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpExtendedBolusTransaction.kt similarity index 92% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpExtendedBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpExtendedBolusTransaction.kt index ac73ba74ef..2f93d98b13 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpExtendedBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpExtendedBolusTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.interfaces.end /** * Creates or updates the extended bolus from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTemporaryBasalTransaction.kt similarity index 90% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTemporaryBasalTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTemporaryBasalTransaction.kt index cee4092633..fc8abfe8e0 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTemporaryBasalTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTemporaryBasalTransaction.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.interfaces.end /** * Creates or updates the Temporary basal from pump synchronization @@ -50,6 +50,6 @@ class SyncPumpTemporaryBasalTransaction( class TransactionResult { val inserted = mutableListOf() - val updated = mutableListOf>() + val updated = mutableListOf>() } } \ No newline at end of file diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTotalDailyDoseTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTotalDailyDoseTransaction.kt similarity index 92% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTotalDailyDoseTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTotalDailyDoseTransaction.kt index 805d1cabb2..0321099227 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncPumpTotalDailyDoseTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncPumpTotalDailyDoseTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TotalDailyDose +import info.nightscout.database.entities.TotalDailyDose /** * Creates or updates the TotalDailyDose from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryBasalWithTempIdTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncTemporaryBasalWithTempIdTransaction.kt similarity index 91% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryBasalWithTempIdTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncTemporaryBasalWithTempIdTransaction.kt index 93a2e86ef8..b08f64f961 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryBasalWithTempIdTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/SyncTemporaryBasalWithTempIdTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal /** * Creates or updates the TemporaryBasal from pump synchronization diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/Transaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/Transaction.kt similarity index 69% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/Transaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/Transaction.kt index 36d07a9926..3ba635334f 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/Transaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/Transaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.DelegatedAppDatabase +import info.nightscout.database.impl.DelegatedAppDatabase /** * Base class for database transactions diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateGlucoseValueTransaction.kt similarity index 65% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateGlucoseValueTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateGlucoseValueTransaction.kt index 8d6ce188be..3ffa9fad5a 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateGlucoseValueTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateGlucoseValueTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue /** * Updates the GlucoseValue diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt similarity index 80% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt index b824e1b4f4..99c9329a9c 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusCalculatorResultTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.BolusCalculatorResult class UpdateNsIdBolusCalculatorResultTransaction(val bolusCalculatorResult: BolusCalculatorResult) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusTransaction.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusTransaction.kt index 2504545419..1075094e0b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdBolusTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus class UpdateNsIdBolusTransaction(val bolus: Bolus) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdCarbsTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdCarbsTransaction.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdCarbsTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdCarbsTransaction.kt index 9595fd3a17..2c6ae614e3 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdCarbsTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdCarbsTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.database.entities.Carbs class UpdateNsIdCarbsTransaction(val carbs: Carbs) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdDeviceStatusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdDeviceStatusTransaction.kt similarity index 79% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdDeviceStatusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdDeviceStatusTransaction.kt index 159992ba5f..fc582722a3 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdDeviceStatusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdDeviceStatusTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.DeviceStatus +import info.nightscout.database.entities.DeviceStatus class UpdateNsIdDeviceStatusTransaction(val deviceStatus: DeviceStatus) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt similarity index 80% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt index 027bf61b3a..d76205f75b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdEffectiveProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.EffectiveProfileSwitch class UpdateNsIdEffectiveProfileSwitchTransaction(val effectiveProfileSwitch: EffectiveProfileSwitch) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdExtendedBolusTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdExtendedBolusTransaction.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdExtendedBolusTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdExtendedBolusTransaction.kt index cc174ad734..6d070a6516 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdExtendedBolusTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdExtendedBolusTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.ExtendedBolus +import info.nightscout.database.entities.ExtendedBolus class UpdateNsIdExtendedBolusTransaction(val bolus: ExtendedBolus) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdFoodTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdFoodTransaction.kt similarity index 78% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdFoodTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdFoodTransaction.kt index 78179c8cb8..f35b5a3efe 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdFoodTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdFoodTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.Food +import info.nightscout.database.entities.Food class UpdateNsIdFoodTransaction(val food: Food) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdGlucoseValueTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdGlucoseValueTransaction.kt similarity index 79% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdGlucoseValueTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdGlucoseValueTransaction.kt index 3b43b92943..eb047a377b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdGlucoseValueTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdGlucoseValueTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue class UpdateNsIdGlucoseValueTransaction(val glucoseValue: GlucoseValue) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdOfflineEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdOfflineEventTransaction.kt similarity index 79% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdOfflineEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdOfflineEventTransaction.kt index 3da1b26ce7..48f8676d44 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdOfflineEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdOfflineEventTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.OfflineEvent +import info.nightscout.database.entities.OfflineEvent class UpdateNsIdOfflineEventTransaction(val offlineEvent: OfflineEvent) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdProfileSwitchTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdProfileSwitchTransaction.kt similarity index 79% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdProfileSwitchTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdProfileSwitchTransaction.kt index 368a66dc3f..b8886ed610 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdProfileSwitchTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdProfileSwitchTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.ProfileSwitch +import info.nightscout.database.entities.ProfileSwitch class UpdateNsIdProfileSwitchTransaction(val profileSwitch: ProfileSwitch) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryBasalTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryBasalTransaction.kt similarity index 79% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryBasalTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryBasalTransaction.kt index 571f3da027..1daa83442f 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryBasalTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryBasalTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal class UpdateNsIdTemporaryBasalTransaction(val temporaryBasal: TemporaryBasal) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryTargetTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryTargetTransaction.kt similarity index 80% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryTargetTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryTargetTransaction.kt index 28bd4211d6..0b4a369708 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTemporaryTargetTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTemporaryTargetTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TemporaryTarget +import info.nightscout.database.entities.TemporaryTarget class UpdateNsIdTemporaryTargetTransaction(val temporaryTarget: TemporaryTarget) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTherapyEventTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTherapyEventTransaction.kt similarity index 79% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTherapyEventTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTherapyEventTransaction.kt index 0f04c6f81d..e310f1c1d3 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UpdateNsIdTherapyEventTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UpdateNsIdTherapyEventTransaction.kt @@ -1,6 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TherapyEvent class UpdateNsIdTherapyEventTransaction(val therapyEvent: TherapyEvent) : Transaction() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt similarity index 69% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt index 6443041f2c..72e52ab313 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/UserEntryTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/UserEntryTransaction.kt @@ -1,9 +1,9 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.UserEntry -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.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit class UserEntryTransaction(private val entries: List) : Transaction>() { diff --git a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/VersionChangeTransaction.kt b/database/impl/src/main/java/info/nightscout/database/impl/transactions/VersionChangeTransaction.kt similarity index 77% rename from database/impl/src/main/java/info/nightscout/androidaps/database/transactions/VersionChangeTransaction.kt rename to database/impl/src/main/java/info/nightscout/database/impl/transactions/VersionChangeTransaction.kt index ade887647f..b1a7dcab4b 100644 --- a/database/impl/src/main/java/info/nightscout/androidaps/database/transactions/VersionChangeTransaction.kt +++ b/database/impl/src/main/java/info/nightscout/database/impl/transactions/VersionChangeTransaction.kt @@ -1,7 +1,6 @@ -package info.nightscout.androidaps.database.transactions +package info.nightscout.database.impl.transactions -import info.nightscout.androidaps.database.entities.VersionChange -import java.util.* +import info.nightscout.database.entities.VersionChange class VersionChangeTransaction( private val versionName: String, @@ -16,13 +15,15 @@ class VersionChangeTransaction( || current.versionCode != versionCode || current.gitRemote != gitRemote || current.commitHash != commitHash) { - database.versionChangeDao.insert(VersionChange( + database.versionChangeDao.insert( + VersionChange( timestamp = System.currentTimeMillis(), versionCode = versionCode, versionName = versionName, gitRemote = gitRemote, commitHash = commitHash - )) + ) + ) } } diff --git a/implementation/build.gradle b/implementation/build.gradle index 21b9282f74..12b853240a 100644 --- a/implementation/build.gradle +++ b/implementation/build.gradle @@ -18,6 +18,7 @@ android { dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') + implementation project(':database:entities') implementation project(':database:impl') implementation project(':automation') implementation project(':interfaces') diff --git a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt index e638859e77..587270034b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt @@ -1,29 +1,29 @@ package info.nightscout.implementation -import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.TherapyEvent -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.InsertTherapyEventAnnouncementTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.SmsCommunicator 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.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.LocalAlertUtils +import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.notifications.Notification -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject diff --git a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt index 05799ef818..e446a7059c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/TrendCalculatorImpl.kt @@ -1,10 +1,10 @@ package info.nightscout.implementation -import info.nightscout.core.main.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.TrendCalculator +import info.nightscout.core.main.R +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt b/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt index 6bfb75ed6c..993f5185b9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/XDripBroadcastImpl.kt @@ -4,17 +4,16 @@ import android.content.Context import android.content.Intent import android.os.Bundle import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.shared.extensions.safeQueryBroadcastReceivers -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.Intents import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.GlucoseUnit 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.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 59e55dcaca..8ab7ace961 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -1,34 +1,24 @@ package info.nightscout.implementation.pump -import info.nightscout.core.main.R import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.androidaps.database.entities.TotalDailyDose -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.ValueWithUnit -import info.nightscout.androidaps.database.transactions.InsertBolusWithTempIdTransaction -import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampCarbsTransaction -import info.nightscout.androidaps.database.transactions.InsertIfNewByTimestampTherapyEventTransaction -import info.nightscout.androidaps.database.transactions.InsertTemporaryBasalWithTempIdTransaction -import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.androidaps.database.transactions.InvalidateTemporaryBasalTransaction -import info.nightscout.androidaps.database.transactions.InvalidateTemporaryBasalTransactionWithPumpId -import info.nightscout.androidaps.database.transactions.InvalidateTemporaryBasalWithTempIdTransaction -import info.nightscout.androidaps.database.transactions.SyncBolusWithTempIdTransaction -import info.nightscout.androidaps.database.transactions.SyncPumpBolusTransaction -import info.nightscout.androidaps.database.transactions.SyncPumpCancelExtendedBolusIfAnyTransaction -import info.nightscout.androidaps.database.transactions.SyncPumpCancelTemporaryBasalIfAnyTransaction -import info.nightscout.androidaps.database.transactions.SyncPumpExtendedBolusTransaction -import info.nightscout.androidaps.database.transactions.SyncPumpTemporaryBasalTransaction -import info.nightscout.androidaps.database.transactions.SyncPumpTotalDailyDoseTransaction -import info.nightscout.androidaps.database.transactions.SyncTemporaryBasalWithTempIdTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InsertBolusWithTempIdTransaction +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampCarbsTransaction +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.database.impl.transactions.InsertTemporaryBasalWithTempIdTransaction +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction +import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalTransaction +import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalTransactionWithPumpId +import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalWithTempIdTransaction +import info.nightscout.database.impl.transactions.SyncBolusWithTempIdTransaction +import info.nightscout.database.impl.transactions.SyncPumpBolusTransaction +import info.nightscout.database.impl.transactions.SyncPumpCancelExtendedBolusIfAnyTransaction +import info.nightscout.database.impl.transactions.SyncPumpCancelTemporaryBasalIfAnyTransaction +import info.nightscout.database.impl.transactions.SyncPumpExtendedBolusTransaction +import info.nightscout.database.impl.transactions.SyncPumpTemporaryBasalTransaction +import info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransaction +import info.nightscout.database.impl.transactions.SyncTemporaryBasalWithTempIdTransaction import info.nightscout.androidaps.extensions.fromDbPumpType import info.nightscout.androidaps.extensions.toDbPumpType import info.nightscout.androidaps.extensions.toDbSource @@ -37,9 +27,19 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.core.main.R +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.VirtualPump import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpType import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index c4b984e8a4..014996b3ee 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -10,11 +10,8 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.database.entities.ProfileSwitch -import info.nightscout.androidaps.database.interfaces.end +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue @@ -29,6 +26,9 @@ import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.queue.commands.Command.CommandType import info.nightscout.androidaps.utils.extensions.getCustomizedName import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.interfaces.end import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus import info.nightscout.implementation.queue.commands.CommandCancelExtendedBolus diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt index d0169bb2db..bc37d95512 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt @@ -2,7 +2,7 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.ValueWrapper +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.interfaces.Config diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt index 27496e697e..8f62064ced 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirCalculatorImpl.kt @@ -4,7 +4,7 @@ import android.annotation.SuppressLint import android.content.Context import android.view.ViewGroup import android.widget.TableLayout -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.DexcomTIR diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt index 33b7d2c55c..5731f6aab9 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TddCalculatorImpl.kt @@ -8,25 +8,24 @@ import android.view.ViewGroup import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.TotalDailyDose +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.toTableRow import info.nightscout.androidaps.extensions.toTableRowHeader 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.interfaces.stats.TddCalculator -import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.utils.T +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.implementation.R +import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt index 11bd1dd255..9c62357b90 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt @@ -9,7 +9,7 @@ import android.view.ViewGroup import android.widget.TableLayout import android.widget.TextView import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.shared.interfaces.ResourceHelper diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 693e5b0a30..6e2012ecd1 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,14 +4,14 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index 5fde100e47..6767efaba0 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -8,15 +8,15 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.queue.commands.Command import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.Bolus import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus import info.nightscout.implementation.queue.commands.CommandCustomCommand diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt index 4a57c089d5..415f774342 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt @@ -6,7 +6,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.AndroidPermission diff --git a/openhumans/build.gradle b/openhumans/build.gradle index e6736d3ad3..a2b03cecaa 100644 --- a/openhumans/build.gradle +++ b/openhumans/build.gradle @@ -18,6 +18,7 @@ android { dependencies { implementation project(':core:core-main') + implementation project(':database:entities') implementation project(':database:impl') implementation project(':interfaces') implementation project(':app-wear-shared:rx') diff --git a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt index dc5788bee6..59ac4b7fa4 100644 --- a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt +++ b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt @@ -9,21 +9,29 @@ import android.util.DisplayMetrics import android.view.WindowManager import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat -import androidx.work.* +import androidx.work.BackoffPolicy +import androidx.work.Constraints +import androidx.work.ExistingPeriodicWorkPolicy +import androidx.work.ExistingWorkPolicy +import androidx.work.ForegroundInfo +import androidx.work.NetworkType +import androidx.work.OneTimeWorkRequestBuilder +import androidx.work.PeriodicWorkRequestBuilder +import androidx.work.WorkManager import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.interfaces.TraceableDBEntry +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.rx.logging.AAPSLogger import info.nightscout.androidaps.plugin.general.openhumans.delegates.OHAppIDDelegate import info.nightscout.androidaps.plugin.general.openhumans.delegates.OHCounterDelegate import info.nightscout.androidaps.plugin.general.openhumans.delegates.OHStateDelegate import info.nightscout.androidaps.plugin.general.openhumans.ui.OHFragment import info.nightscout.androidaps.plugin.general.openhumans.ui.OHLoginActivity +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.interfaces.TraceableDBEntry +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.PluginDescription 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 @@ -36,7 +44,9 @@ import org.json.JSONObject import java.io.ByteArrayOutputStream import java.security.MessageDigest import java.text.SimpleDateFormat -import java.util.* +import java.util.Locale +import java.util.TimeZone +import java.util.UUID import java.util.concurrent.TimeUnit import java.util.zip.ZipEntry import java.util.zip.ZipOutputStream diff --git a/plugins/build.gradle b/plugins/build.gradle index 2578589722..b2a00d7926 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -18,6 +18,7 @@ android { dependencies { implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') + implementation project(':database:entities') implementation project(':database:impl') implementation project(':graphview') implementation project(':core:core-main') diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 7020d10943..4f8fd1a4ab 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -21,8 +21,6 @@ import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile @@ -31,6 +29,8 @@ import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.utils.MidnightTime diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt index b19aeb96c8..70f3611d92 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt @@ -2,30 +2,30 @@ package info.nightscout.plugins.general.autotune import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.data.LocalInsulin -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.extensions.durationInMinutes import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toJson import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.plugins.sync.nsclient.extensions.toJson -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.Constants import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile +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 info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index ffd4f5545f..9043b0605e 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -4,25 +4,22 @@ import android.view.View import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Autotune -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.interfaces.PluginBase -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.ProfileStore -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.shared.utils.DateUtil +import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.Autotune +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.PluginDescription +import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.utils.T -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose @@ -32,7 +29,10 @@ import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventLocalProfileChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONException import org.json.JSONObject import java.util.TimeZone diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt index 0e6e88aada..37792897b3 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt @@ -1,13 +1,11 @@ package info.nightscout.plugins.general.autotune import info.nightscout.androidaps.data.LocalInsulin -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.interfaces.utils.Round -import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.BGDatum @@ -16,6 +14,8 @@ import info.nightscout.plugins.general.autotune.data.DiaDeviation import info.nightscout.plugins.general.autotune.data.PeakDeviation import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index 326a9bcb8d..3148854abf 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -1,27 +1,27 @@ package info.nightscout.plugins.general.autotune.data import dagger.android.HasAndroidInjector -import info.nightscout.core.main.R import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.database.data.Block import info.nightscout.androidaps.extensions.blockValueBySeconds import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Insulin 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.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.main.R +import info.nightscout.database.entities.data.Block import info.nightscout.interfaces.Config +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt index 6be309eb58..a9337d87ff 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/BGDatum.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.general.autotune.data -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.entities.GlucoseValue.TrendArrow +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue.TrendArrow import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import org.json.JSONException 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 7a57274a65..9327ed76d0 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 @@ -12,16 +12,16 @@ import android.widget.ArrayAdapter import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.Food -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources -import info.nightscout.androidaps.database.transactions.InvalidateFoodTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InvalidateFoodTransaction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.Food +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.ActivityNames import info.nightscout.plugins.R import info.nightscout.plugins.databinding.FoodFragmentBinding diff --git a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt index 1a154ef176..cafe8e9c0e 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt @@ -5,19 +5,19 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.Food -import info.nightscout.androidaps.database.transactions.SyncNsFoodTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.SyncNsFoodTransaction import info.nightscout.androidaps.extensions.foodFromJson +import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.database.entities.Food import info.nightscout.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.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import javax.inject.Inject 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 48d0084c44..3ae44eb019 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 @@ -13,16 +13,11 @@ import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.entities.TemporaryTarget -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.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentOfflineEventTransaction -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction +import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin @@ -41,6 +36,11 @@ import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.Constraint diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index 33a53bf472..41cd2a3ace 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -13,12 +13,12 @@ import android.view.WindowManager import com.google.common.primitives.Ints.min import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.SmsCommunicator import info.nightscout.plugins.R import info.nightscout.plugins.databinding.SmscommunicatorActivityOtpBinding diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt index 58679ba98a..7a1c3321db 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt @@ -6,10 +6,9 @@ import android.util.AttributeSet import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.interfaces.Insulin +import info.nightscout.database.entities.Bolus import info.nightscout.shared.utils.T -import java.util.* import kotlin.math.floor class ActivityGraph : GraphView { diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt index 8999ce4d78..3fac0105ab 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt @@ -1,23 +1,23 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.data.Iob -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin +import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification +import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.embedments.InsulinConfiguration +import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification +import info.nightscout.interfaces.data.Iob import info.nightscout.interfaces.notifications.Notification -import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.T import kotlin.math.exp import kotlin.math.pow diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index 141c97d3de..c9c41de409 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -11,8 +11,6 @@ import android.widget.ArrayAdapter import com.google.android.material.tabs.TabLayout import dagger.android.support.DaggerFragment import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction @@ -22,6 +20,8 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit diff --git a/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt index bbd9fa5650..dcb28c108c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt @@ -14,12 +14,8 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -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.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString @@ -29,6 +25,10 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.PluginBase import info.nightscout.plugins.R import info.nightscout.plugins.databinding.SourceFragmentBinding diff --git a/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt index 46658494b0..a82ce7769b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt @@ -5,16 +5,16 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.transactions.CgmSourceTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.Config +import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index 9f15c82c92..f1b792a522 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -13,12 +13,12 @@ import android.widget.ScrollView import androidx.core.view.MenuProvider import androidx.lifecycle.Lifecycle import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.PluginBase diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt index a0161b55ff..99c60525e3 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt @@ -5,39 +5,39 @@ import android.os.SystemClock import androidx.work.Worker import androidx.work.WorkerParameters import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.entities.ProfileSwitch -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TemporaryTarget -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.androidaps.database.transactions.SyncNsBolusCalculatorResultTransaction -import info.nightscout.androidaps.database.transactions.SyncNsBolusTransaction -import info.nightscout.androidaps.database.transactions.SyncNsCarbsTransaction -import info.nightscout.androidaps.database.transactions.SyncNsEffectiveProfileSwitchTransaction -import info.nightscout.androidaps.database.transactions.SyncNsExtendedBolusTransaction -import info.nightscout.androidaps.database.transactions.SyncNsOfflineEventTransaction -import info.nightscout.androidaps.database.transactions.SyncNsProfileSwitchTransaction -import info.nightscout.androidaps.database.transactions.SyncNsTemporaryBasalTransaction -import info.nightscout.androidaps.database.transactions.SyncNsTemporaryTargetTransaction -import info.nightscout.androidaps.database.transactions.SyncNsTherapyEventTransaction -import info.nightscout.androidaps.database.transactions.UserEntryTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.database.impl.transactions.SyncNsBolusCalculatorResultTransaction +import info.nightscout.database.impl.transactions.SyncNsBolusTransaction +import info.nightscout.database.impl.transactions.SyncNsCarbsTransaction +import info.nightscout.database.impl.transactions.SyncNsEffectiveProfileSwitchTransaction +import info.nightscout.database.impl.transactions.SyncNsExtendedBolusTransaction +import info.nightscout.database.impl.transactions.SyncNsOfflineEventTransaction +import info.nightscout.database.impl.transactions.SyncNsProfileSwitchTransaction +import info.nightscout.database.impl.transactions.SyncNsTemporaryBasalTransaction +import info.nightscout.database.impl.transactions.SyncNsTemporaryTargetTransaction +import info.nightscout.database.impl.transactions.SyncNsTherapyEventTransaction +import info.nightscout.database.impl.transactions.UserEntryTransaction import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.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.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.notifications.Notification import info.nightscout.plugins.R import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin @@ -521,9 +521,10 @@ class StoreDataForDb @Inject constructor( UserEntryTransaction.Entry( dateUtil.now(), action, UserEntry.Sources.NSClient, therapyEvent.note ?: "", - listOf(ValueWithUnit.Timestamp(therapyEvent.timestamp), - ValueWithUnit.TherapyEventType(therapyEvent.type), - ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }) + listOf( + ValueWithUnit.Timestamp(therapyEvent.timestamp), + ValueWithUnit.TherapyEventType(therapyEvent.type), + ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }) ) ) aapsLogger.debug(LTag.DATABASE, "Inserted TherapyEvent $therapyEvent") @@ -534,9 +535,10 @@ class StoreDataForDb @Inject constructor( UserEntryTransaction.Entry( dateUtil.now(), UserEntry.Action.CAREPORTAL_REMOVED, UserEntry.Sources.NSClient, therapyEvent.note ?: "", - listOf(ValueWithUnit.Timestamp(therapyEvent.timestamp), - ValueWithUnit.TherapyEventType(therapyEvent.type), - ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }) + listOf( + ValueWithUnit.Timestamp(therapyEvent.timestamp), + ValueWithUnit.TherapyEventType(therapyEvent.type), + ValueWithUnit.fromGlucoseUnit(therapyEvent.glucose ?: 0.0, therapyEvent.glucoseUnit.toString).takeIf { therapyEvent.glucose != null }) ) ) aapsLogger.debug(LTag.DATABASE, "Invalidated TherapyEvent $therapyEvent") diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorImplementation.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorImplementation.kt index 2b85ca8620..1871cdff35 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorImplementation.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/DataSyncSelectorImplementation.kt @@ -1,25 +1,25 @@ package info.nightscout.plugins.sync.nsclient -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.DeviceStatus -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.Food -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.entities.ProfileSwitch -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper 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.androidaps.utils.extensions.toJson +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.DeviceStatus +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.Food +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.TherapyEvent import info.nightscout.plugins.R import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.plugins.sync.nsclient.extensions.toJson diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt index 83acdf14c2..cd727653e3 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSSettingsStatus.kt @@ -2,13 +2,13 @@ package info.nightscout.plugins.sync.nsclient.data import android.content.Context import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Action 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.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Action import info.nightscout.interfaces.Config import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.utils.JsonHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt index 3dd977809e..54bd29fa90 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/BolusExtension.kt @@ -1,15 +1,14 @@ package info.nightscout.plugins.sync.nsclient.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun Bolus.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() - .put("eventType", if (type == Bolus.Type.SMB) TherapyEvent.Type.CORRECTION_BOLUS.text else TherapyEvent.Type.MEAL_BOLUS.text) + .put("eventType", if (type == Bolus.Type.SMB) info.nightscout.database.entities.TherapyEvent.Type.CORRECTION_BOLUS.text else info.nightscout.database.entities.TherapyEvent.Type.MEAL_BOLUS.text) .put("insulin", amount) .put("created_at", dateUtil.toISOString(timestamp)) .put("date", timestamp) diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt index 3e588b8723..4ca0a041d4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/CarbsExtension.kt @@ -1,15 +1,14 @@ package info.nightscout.plugins.sync.nsclient.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun Carbs.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() - .put("eventType", if (amount < 12) TherapyEvent.Type.CARBS_CORRECTION.text else TherapyEvent.Type.MEAL_BOLUS.text) + .put("eventType", if (amount < 12) info.nightscout.database.entities.TherapyEvent.Type.CARBS_CORRECTION.text else info.nightscout.database.entities.TherapyEvent.Type.MEAL_BOLUS.text) .put("carbs", amount) .put("notes", notes) .put("created_at", dateUtil.toISOString(timestamp)) diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index f973198253..93acb73248 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.utils.extensions import android.os.Build -import info.nightscout.androidaps.database.entities.DeviceStatus 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.receivers.ReceiverStatusStore +import info.nightscout.database.entities.DeviceStatus 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/EffectiveProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index 5c0c6929eb..d4f0702c3b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -1,13 +1,12 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject fun EffectiveProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = @@ -15,7 +14,7 @@ fun EffectiveProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObjec .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") .put("isValid", isValid) - .put("eventType", TherapyEvent.Type.NOTE.text) // move to separate collection when available in NS + .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.NOTE.text) // move to separate collection when available in NS .put("profileJson", ProfileSealed.EPS(this).toPureNsJson(dateUtil).toString()) .put("originalProfileName", originalProfileName) .put("originalCustomizedName", originalCustomizedName) diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt index 03e45f2c1a..72803e5e17 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt @@ -1,14 +1,12 @@ package info.nightscout.plugins.sync.nsclient.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.plugins.sync.nsclient.extensions.toJson +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T -import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject fun ExtendedBolus.toJson(isAdd: Boolean, profile: Profile, dateUtil: DateUtil): JSONObject = @@ -22,7 +20,7 @@ fun ExtendedBolus.toRealJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", TherapyEvent.Type.COMBO_BOLUS.text) + .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.COMBO_BOLUS.text) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) .put("splitNow", 0) diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt index 704a47da3f..dcfca67c87 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/OfflineEventExtension.kt @@ -1,18 +1,17 @@ package info.nightscout.plugins.sync.nsclient.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.OfflineEvent -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T -import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject fun OfflineEvent.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = JSONObject() .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", TherapyEvent.Type.APS_OFFLINE.text) + .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.APS_OFFLINE.text) .put("isValid", isValid) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt index ac2b9378b3..03efb14c17 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt @@ -1,16 +1,15 @@ package info.nightscout.plugins.sync.nsclient.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.database.entities.TherapyEvent 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.getCustomizedName import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONObject fun ProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = @@ -24,7 +23,7 @@ fun ProfileSwitch.toJson(isAdd: Boolean, dateUtil: DateUtil): JSONObject = .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") .put("isValid", isValid) - .put("eventType", TherapyEvent.Type.PROFILE_SWITCH.text) + .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.PROFILE_SWITCH.text) .also { // remove customization to store original profileJson in toPureNsJson call timeshift = 0 percentage = 100 diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt index eb2cc38596..25e6c352d3 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt @@ -1,21 +1,20 @@ package info.nightscout.plugins.sync.nsclient.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TemporaryBasal -import info.nightscout.androidaps.database.entities.TemporaryBasal.Type.Companion.fromString -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal.Type.Companion.fromString +import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T -import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject fun TemporaryBasal.toJson(isAdd: Boolean, profile: Profile, dateUtil: DateUtil): JSONObject = JSONObject() .put("created_at", dateUtil.toISOString(timestamp)) .put("enteredBy", "openaps://" + "AndroidAPS") - .put("eventType", TherapyEvent.Type.TEMPORARY_BASAL.text) + .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.TEMPORARY_BASAL.text) .put("isValid", isValid) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) // rounded duration leads to different basal IOB diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt index 601edffeab..6034f4d930 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -1,13 +1,12 @@ package info.nightscout.plugins.sync.nsclient.extensions -import info.nightscout.androidaps.database.entities.TemporaryTarget -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.utils.JsonHelper 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 fun temporaryTargetFromJson(jsonObject: JSONObject): TemporaryTarget? { @@ -50,7 +49,7 @@ fun temporaryTargetFromJson(jsonObject: JSONObject): TemporaryTarget? { fun TemporaryTarget.toJson(isAdd: Boolean, units: GlucoseUnit, dateUtil: DateUtil): JSONObject = JSONObject() - .put("eventType", TherapyEvent.Type.TEMPORARY_TARGET.text) + .put("eventType", info.nightscout.database.entities.TherapyEvent.Type.TEMPORARY_TARGET.text) .put("duration", T.msecs(duration).mins()) .put("durationInMilliseconds", duration) .put("isValid", isValid) 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 ce2bf354e8..a3bab73543 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 @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.core.main.R -import info.nightscout.androidaps.database.entities.TherapyEvent -import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.sync.nsclient.data.NSMbg import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt index 5f604a7199..0c5ff7bd2f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt @@ -16,7 +16,7 @@ import com.google.gson.GsonBuilder import com.google.gson.JsonDeserializer import dagger.android.DaggerService import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt index aa9fcd4bed..6fa6f7ed50 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt @@ -6,21 +6,20 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.DeviceStatus -import info.nightscout.androidaps.database.transactions.UpdateNsIdBolusCalculatorResultTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdBolusTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdCarbsTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdDeviceStatusTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdEffectiveProfileSwitchTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdExtendedBolusTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdFoodTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdGlucoseValueTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdOfflineEventTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdProfileSwitchTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdTemporaryBasalTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdTemporaryTargetTransaction -import info.nightscout.androidaps.database.transactions.UpdateNsIdTherapyEventTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.UpdateNsIdBolusCalculatorResultTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdBolusTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdCarbsTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdDeviceStatusTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdEffectiveProfileSwitchTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdExtendedBolusTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdFoodTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdGlucoseValueTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdOfflineEventTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdProfileSwitchTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryBasalTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryTargetTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdTherapyEventTransaction import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.DataSyncSelector.PairBolus import info.nightscout.androidaps.interfaces.DataSyncSelector.PairBolusCalculatorResult @@ -35,8 +34,9 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairProfileSwitch import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryBasal import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryTarget import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTherapyEvent -import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.database.entities.DeviceStatus +import info.nightscout.interfaces.NsClient import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.plugins.sync.nsclient.acks.NSAddAck @@ -278,7 +278,7 @@ class NSClientAddAckWorker( dataSyncSelector.processChangedEffectiveProfileSwitchesCompat() } - is DeviceStatus -> { + is DeviceStatus -> { val deviceStatus = ack.originalObject deviceStatus.interfaceIDs.nightscoutId = ack.id repository.runTransactionForResult(UpdateNsIdDeviceStatusTransaction(deviceStatus)) diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt index 18453033ef..1ccae0ac76 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt @@ -5,13 +5,13 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository 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.receivers.DataWorkerStorage +import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.VirtualPump diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt index 056b0870c3..5b73bcbec9 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt @@ -5,7 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.DataSyncSelector.PairBolus import info.nightscout.androidaps.interfaces.DataSyncSelector.PairBolusCalculatorResult diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt index a79c4988ec..8104579e72 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusCalculatorResultExtension.kt @@ -2,7 +2,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import com.google.gson.Gson import com.google.gson.JsonSyntaxException -import info.nightscout.androidaps.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.sdk.localmodel.treatment.NSBolusWizard fun NSBolusWizard.toBolusCalculatorResult(): BolusCalculatorResult? = diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt index bcd88ed1d5..23746cd94c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/BolusExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.NSBolus fun NSBolus.toBolus(): Bolus = diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt index 4dc2bdac3a..25fed82df8 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/CarbsExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.Carbs +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.NSCarbs fun NSCarbs.toCarbs(): Carbs = diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt index dcc9102f07..28c5db62d5 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -1,9 +1,9 @@ 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.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.plugins.sync.nsclient.extensions.fromConstant import info.nightscout.sdk.localmodel.treatment.NSEffectiveProfileSwitch import info.nightscout.shared.utils.DateUtil diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt index 5a5c3e2303..c2dfeaa81b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ExtendedBolusExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.ExtendedBolus +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.NSExtendedBolus fun NSExtendedBolus.toExtendedBolus(): ExtendedBolus = diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt index 3bfa4ce2ba..0c1bd0151c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/OfflineEventExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.OfflineEvent +import info.nightscout.database.entities.OfflineEvent +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.NSOfflineEvent fun NSOfflineEvent.toOfflineEvent(): OfflineEvent = diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt index 8ed408fa57..2be54849db 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -1,11 +1,11 @@ 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.androidaps.utils.extensions.fromConstant import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt index 71dc0651d7..78463fd7a2 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryBasalExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.NSTemporaryBasal fun NSTemporaryBasal.toTemporaryBasal(): TemporaryBasal = diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt index 17445fe2bf..066ea18e19 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TemporaryTargetExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TemporaryTarget +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.NSTemporaryTarget fun NSTemporaryTarget.toTemporaryTarget(): TemporaryTarget = diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt index ea94e4a770..b6e7644ade 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/TherapyEventExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions -import info.nightscout.androidaps.database.embedments.InterfaceIDs -import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.entry.NsUnits import info.nightscout.sdk.localmodel.treatment.EventType import info.nightscout.sdk.localmodel.treatment.NSTherapyEvent diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt index 981497f58a..b8dbc5c553 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/ProcessTreatmentsWorker.kt @@ -5,7 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.database.AppRepository +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt index 4f8056b8bd..bf07c91769 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/comm/UploadChunk.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.tidepool.comm -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import info.nightscout.androidaps.database.entities.TemporaryBasal +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.TemporaryBasal import info.nightscout.plugins.R import info.nightscout.plugins.sync.tidepool.elements.BasalElement import info.nightscout.plugins.sync.tidepool.elements.BaseElement diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt index cc92b0ebe0..b8788db10f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose -import info.nightscout.androidaps.database.entities.TemporaryBasal import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.database.entities.TemporaryBasal import info.nightscout.shared.utils.DateUtil import java.util.UUID diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index c4c919ccc3..8ff50b4757 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -1,8 +1,8 @@ package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose -import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.database.entities.TherapyEvent import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit import info.nightscout.shared.utils.DateUtil import java.util.LinkedList diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt index 4918d735e8..f25ff9868d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BolusElement.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose -import info.nightscout.androidaps.database.entities.Bolus +import info.nightscout.database.entities.Bolus import info.nightscout.shared.utils.DateUtil import java.util.UUID diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt index f247ecbbf5..5bb9a5b151 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt @@ -2,8 +2,8 @@ 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.database.entities.EffectiveProfileSwitch import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import info.nightscout.shared.utils.DateUtil import java.util.UUID diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt index f7fb4ef6dd..c7cea855d7 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/SensorGlucoseElement.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.entities.GlucoseValue import info.nightscout.shared.utils.DateUtil import java.util.LinkedList import java.util.UUID diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt index b53252edc0..603e443add 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/WizardElement.kt @@ -1,8 +1,8 @@ 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.database.entities.Bolus +import info.nightscout.database.entities.Carbs import info.nightscout.shared.utils.DateUtil import java.util.UUID diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 693e5b0a30..6e2012ecd1 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,14 +4,14 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt index ed30a2a16e..96a9d91b02 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt @@ -3,10 +3,10 @@ package info.nightscout.plugins.constraints.bgQualityCheck import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.Constraint import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt index a6ab41e52b..fb9a4946c9 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt @@ -5,16 +5,16 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import org.junit.Assert diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt index 8e2efcd58e..26785eebbe 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt @@ -6,23 +6,23 @@ import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.data.Block -import info.nightscout.androidaps.database.data.TargetBlock -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.Carbs -import info.nightscout.androidaps.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.extensions.shiftBlock -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.entities.data.Block +import info.nightscout.database.entities.data.TargetBlock +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.shared.utils.T import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.json.JSONArray import org.json.JSONObject import org.junit.Assert 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 9b6ec2df22..cf18f7b6e9 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 @@ -3,40 +3,40 @@ package info.nightscout.plugins.general.smsCommunicator import android.telephony.SmsManager import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.GlucoseValue -import info.nightscout.androidaps.database.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentOfflineEventTransaction -import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.androidaps.database.transactions.Transaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.transactions.Transaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileSource -import info.nightscout.interfaces.pump.PumpDescription import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.interfaces.pump.PumpType -import info.nightscout.interfaces.queue.Callback -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.database.entities.GlucoseValue +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.data.smsCommunicator.Sms +import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.queue.Callback import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt index 3d9e6a06c4..3df05ad905 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt @@ -2,15 +2,15 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.database.entities.Bolus +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import org.junit.Assert import org.junit.Before diff --git a/pump/eopatch/build.gradle b/pump/eopatch/build.gradle index e78198d09d..9018ca694a 100644 --- a/pump/eopatch/build.gradle +++ b/pump/eopatch/build.gradle @@ -24,6 +24,7 @@ dependencies { implementation project(':libraries') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') + implementation project(':database:entities') implementation project(':database:impl') implementation project(':core:core-main') implementation project(':core:fabric') diff --git a/pump/omnipod-dash/build.gradle b/pump/omnipod-dash/build.gradle index 141bc8d846..de98f59aff 100644 --- a/pump/omnipod-dash/build.gradle +++ b/pump/omnipod-dash/build.gradle @@ -33,6 +33,7 @@ android { } dependencies { + implementation project(':database:entities') implementation project(':database:impl') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/pump/omnipod-eros/build.gradle b/pump/omnipod-eros/build.gradle index cbf0d8cb7e..f786ed4281 100644 --- a/pump/omnipod-eros/build.gradle +++ b/pump/omnipod-eros/build.gradle @@ -26,6 +26,7 @@ android { } dependencies { + implementation project(':database:entities') implementation project(':database:impl') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') diff --git a/settings.gradle b/settings.gradle index 32c50837b6..ed3443202c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,6 @@ include ':app' include ':wear' +include ':database:entities' include ':database:impl' include ':core:core-main' include ':core:fabric' diff --git a/ui/build.gradle b/ui/build.gradle index 1d4809a88c..354d748ae2 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -20,6 +20,7 @@ dependencies { implementation project(':graphview') implementation project(':app-wear-shared:rx') implementation project(':app-wear-shared:shared') + implementation project(':database:entities') implementation project(':database:impl') implementation project(':core:core-main') implementation project(':core:fabric') diff --git a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt index e45d57feea..968b2c13fe 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/ErrorHelperActivity.kt @@ -6,8 +6,8 @@ import android.os.Bundle import androidx.annotation.RawRes import info.nightscout.androidaps.activities.DialogAppCompatActivity import info.nightscout.core.main.R -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.dialogs.ErrorDialog import info.nightscout.androidaps.services.AlarmSoundService import info.nightscout.shared.sharedPreferences.SP diff --git a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt index 4e1933517f..14fe7b7a77 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/StatsActivity.kt @@ -4,14 +4,14 @@ import android.annotation.SuppressLint import android.os.Bundle import android.widget.TextView import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator import info.nightscout.androidaps.interfaces.stats.TddCalculator import info.nightscout.androidaps.interfaces.stats.TirCalculator import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.rx.AapsSchedulers import info.nightscout.ui.R import info.nightscout.ui.databinding.ActivityStatsBinding diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index c716e7dab4..f2d6d404fe 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -15,8 +15,7 @@ import android.widget.TableLayout import android.widget.TableRow import android.widget.TextView import info.nightscout.androidaps.activities.NoSplashAppCompatActivity -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TotalDailyDose +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.total import info.nightscout.androidaps.interfaces.ActivePlugin @@ -24,6 +23,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.main.R +import info.nightscout.database.entities.TotalDailyDose import info.nightscout.interfaces.pump.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt index 91d375a83e..5dcbcb9f68 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -16,17 +16,11 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.Bolus -import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import info.nightscout.androidaps.database.entities.Carbs -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.CutCarbsTransaction -import info.nightscout.androidaps.database.transactions.InvalidateBolusCalculatorResultTransaction -import info.nightscout.androidaps.database.transactions.InvalidateBolusTransaction -import info.nightscout.androidaps.database.transactions.InvalidateCarbsTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CutCarbsTransaction +import info.nightscout.database.impl.transactions.InvalidateBolusCalculatorResultTransaction +import info.nightscout.database.impl.transactions.InvalidateBolusTransaction +import info.nightscout.database.impl.transactions.InvalidateCarbsTransaction import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.interfaces.ActivePlugin @@ -36,6 +30,12 @@ import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt index 20c633edc4..9ae4c2e714 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsCareportalFragment.kt @@ -14,19 +14,19 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TherapyEvent -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.InvalidateAAPSStartedTherapyEventTransaction -import info.nightscout.androidaps.database.transactions.InvalidateTherapyEventTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InvalidateAAPSStartedTherapyEventTransaction +import info.nightscout.database.impl.transactions.InvalidateTherapyEventTransaction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt index bdc86cc466..4ccfcc74d0 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -15,13 +15,8 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.ExtendedBolus -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.interfaces.end -import info.nightscout.androidaps.database.transactions.InvalidateExtendedBolusTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.isInProgress import info.nightscout.androidaps.interfaces.ActivePlugin @@ -31,6 +26,11 @@ import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.entities.interfaces.end import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 4761dfbb33..878f8187f3 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -17,11 +17,8 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.AppRepository -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.InvalidateProfileSwitchTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InvalidateProfileSwitchTransaction import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewHistoryData @@ -32,6 +29,9 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.getCustomizedName import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt index e56ab42886..020ed558c6 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTempTargetFragment.kt @@ -15,14 +15,9 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.TemporaryTarget -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.interfaces.end -import info.nightscout.androidaps.database.transactions.InvalidateTemporaryTargetTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InvalidateTemporaryTargetTransaction import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewHistoryData import info.nightscout.androidaps.extensions.friendlyDescription @@ -35,6 +30,11 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.entities.interfaces.end import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 2a5298df25..84c10618b8 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -16,16 +16,10 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.data.IobTotal -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.ValueWrapper -import info.nightscout.androidaps.database.entities.ExtendedBolus -import info.nightscout.androidaps.database.entities.TemporaryBasal -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.interfaces.end -import info.nightscout.androidaps.database.transactions.InvalidateExtendedBolusTransaction -import info.nightscout.androidaps.database.transactions.InvalidateTemporaryBasalTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction +import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalTransaction import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.extensions.toTemporaryBasal @@ -36,6 +30,12 @@ import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.entities.interfaces.end import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventTempBasalChange diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index 60e7a27fd5..b719e71300 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -12,10 +12,7 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.UserEntry -import info.nightscout.androidaps.database.entities.UserEntry.Action -import info.nightscout.androidaps.database.entities.UserEntry.Sources +import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger @@ -23,6 +20,9 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt index 072760124b..dc9e12f41f 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt @@ -6,23 +6,23 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.ui.R -import info.nightscout.ui.databinding.DialogCalibrationBinding -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.dialogs.DialogFragmentWithDate -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.utils.HtmlHelper +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.ui.R +import info.nightscout.ui.databinding.DialogCalibrationBinding import java.text.DecimalFormat -import java.util.* +import java.util.LinkedList import javax.inject.Inject class CalibrationDialog : DialogFragmentWithDate() { diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index 6e468daacc..9ee87d9378 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -9,38 +9,37 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.TemporaryTarget -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.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.formatColor -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.BolusTimer -import info.nightscout.interfaces.CarbTimer import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.entities.UserEntry.Action +import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.BolusTimer +import info.nightscout.interfaces.CarbTimer +import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogCarbsBinding import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt index 862d85184d..a64eccf599 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt @@ -10,26 +10,25 @@ import android.view.ViewGroup import androidx.annotation.StringRes import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.database.AppRepository -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.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.fromConstant -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.interfaces.utils.HtmlHelper -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.T import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogCareBinding import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt index 758a156c4c..93734121ab 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt @@ -7,14 +7,14 @@ import android.view.ViewGroup import android.view.Window import android.view.WindowManager import dagger.android.support.DaggerDialogFragment -import info.nightscout.androidaps.database.entities.BolusCalculatorResult import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson import info.nightscout.androidaps.extensions.toJson import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.interfaces.Constants import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.Constants import info.nightscout.ui.R import info.nightscout.ui.databinding.DialogWizardinfoBinding import org.json.JSONObject diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt index 6694f86066..2ca80b0d34 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt @@ -13,31 +13,30 @@ import android.os.HandlerThread import android.view.View import android.widget.RemoteViews import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.interfaces.end 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.interfaces.ActivityNames -import info.nightscout.interfaces.Config import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop 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.interfaces.VariableSensitivityResult import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.entities.interfaces.end +import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.VariableSensitivityResult import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import info.nightscout.ui.R import java.util.Locale import javax.inject.Inject diff --git a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 693e5b0a30..6e2012ecd1 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,14 +4,14 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.database.embedments.InsulinConfiguration -import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper From e49feeb736eabb6b64484ccf025d559432f02dcc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 22:30:12 +0000 Subject: [PATCH 24/42] chore(deps): bump kotlin_version from 1.7.20 to 1.7.21 Bumps `kotlin_version` from 1.7.20 to 1.7.21. Updates `kotlin-gradle-plugin` from 1.7.20 to 1.7.21 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.7.21/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.20...v1.7.21) Updates `kotlin-allopen` from 1.7.20 to 1.7.21 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.7.21/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.20...v1.7.21) Updates `kotlin-serialization` from 1.7.20 to 1.7.21 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.7.21/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.20...v1.7.21) Updates `kotlin-stdlib-jdk8` from 1.7.20 to 1.7.21 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.7.21/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.20...v1.7.21) Updates `kotlin-reflect` from 1.7.20 to 1.7.21 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.7.21/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.20...v1.7.21) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-gradle-plugin dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-allopen dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-serialization dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-stdlib-jdk8 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-reflect dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c4af65575f..bff6402cc5 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ buildscript { ext { - kotlin_version = '1.7.20' + kotlin_version = '1.7.21' core_version = '1.9.0' rxjava_version = '3.1.5' rxandroid_version = '3.0.0' From 6d2c0ed5aaa115495a74734d0a69baee49ec1a69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 08:01:39 +0000 Subject: [PATCH 25/42] chore(deps): bump firebase-bom from 30.5.0 to 31.0.2 Bumps firebase-bom from 30.5.0 to 31.0.2. --- updated-dependencies: - dependency-name: com.google.firebase:firebase-bom dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- core/fabric/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/fabric/build.gradle b/core/fabric/build.gradle index df0915c06c..e7229db4cb 100644 --- a/core/fabric/build.gradle +++ b/core/fabric/build.gradle @@ -24,7 +24,7 @@ dependencies { implementation project(':app-wear-shared:shared') //Firebase - api platform('com.google.firebase:firebase-bom:30.5.0') + api platform('com.google.firebase:firebase-bom:31.0.2') api "com.google.firebase:firebase-analytics-ktx" api "com.google.firebase:firebase-crashlytics-ktx" // StatsActivity not in use now From 5f0701d7ba85d33794faf9d21744e1f59f6d3c27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 08:01:51 +0000 Subject: [PATCH 26/42] chore(deps): bump rxandroid from 3.0.1 to 3.0.2 Bumps [rxandroid](https://github.com/ReactiveX/RxAndroid) from 3.0.1 to 3.0.2. - [Release notes](https://github.com/ReactiveX/RxAndroid/releases) - [Changelog](https://github.com/ReactiveX/RxAndroid/blob/3.x/CHANGES.md) - [Commits](https://github.com/ReactiveX/RxAndroid/compare/3.0.1...3.0.2) --- updated-dependencies: - dependency-name: io.reactivex.rxjava3:rxandroid dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7b491b8202..4133317d57 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { kotlin_version = '1.7.21' core_version = '1.9.0' rxjava_version = '3.1.5' - rxandroid_version = '3.0.1' + rxandroid_version = '3.0.2' rxkotlin_version = '3.0.1' room_version = '2.4.3' lifecycle_version = '2.5.1' From 886dc6d0a4551ae9e5cbffd1542963f173902e0e Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 09:40:49 +0100 Subject: [PATCH 27/42] DetailedBolusInfo -> interfaces --- .../androidaps/dialogs/FillDialog.kt | 2 +- .../androidaps/dialogs/InsulinDialog.kt | 7 ++--- .../androidaps/dialogs/LoopDialog.kt | 2 +- .../androidaps/dialogs/TempBasalDialog.kt | 2 +- .../androidaps/dialogs/TreatmentDialog.kt | 6 +++-- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 4 +-- .../constraints/safety/SafetyPlugin.kt | 2 +- .../general/overview/OverviewFragment.kt | 2 +- .../general/overview/StatusLightHandler.kt | 2 +- .../wear/wearintegration/DataHandlerMobile.kt | 2 +- .../androidaps/utils/wizard/BolusWizard.kt | 4 +-- .../nightscout/androidaps/TestPumpPlugin.kt | 8 +++--- .../interfaces/ConstraintsCheckerTest.kt | 2 +- .../plugins/aps/loop/LoopPluginTest.kt | 2 +- .../constraints/safety/SafetyPluginTest.kt | 2 +- .../utils/wizard/BolusWizardTest.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 8 +++--- build.gradle | 2 +- .../androidaps/interfaces/CommandQueue.kt | 2 +- .../nightscout/androidaps/interfaces/Pump.kt | 8 +++--- .../androidaps/interfaces/PumpSync.kt | 4 +-- .../androidaps/plugins/aps/loop/APSResult.kt | 2 +- .../bolusInfo/DetailedBolusInfoStorage.kt | 5 ++-- .../DetailedBolusInfoExtension.kt | 26 +++++++++++++++++++ .../pumpExtensions}/PumpStateExtension.kt | 5 ++-- .../pumpExtensions}/PumpTypeExtension.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 8 +++--- .../androidaps/data/DetailedBolusInfoTest.kt | 3 +++ .../interfaces/PumpDescriptionTest.kt | 8 +++--- .../plugins/aps/loop/APSResultTest.kt | 2 +- .../bolusInfo/DetailedBolusInfoStorageTest.kt | 2 +- .../pump/PumpSyncImplementation.kt | 4 +-- .../queue/CommandQueueImplementation.kt | 3 ++- .../queue/commands/CommandBolus.kt | 2 +- .../queue/commands/CommandSMBBolus.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 8 +++--- .../queue/CommandQueueImplementationTest.kt | 2 +- .../implementation/queue/QueueThreadTest.kt | 2 +- .../pump/insight/LocalInsightPlugin.java | 8 +++--- interfaces/build.gradle | 1 + .../interfaces/pump}/DetailedBolusInfo.kt | 25 ++---------------- .../pump/{ => defs}/DoseSettings.kt | 2 +- .../pump/{ => defs}/DoseStepSize.kt | 17 +++++++----- .../pump/{ => defs}/ManufacturerType.kt | 2 +- .../pump/{ => defs}/PumpCapability.kt | 2 +- .../pump/{ => defs}/PumpDescription.kt | 2 +- .../pump/{ => defs}/PumpTempBasalType.kt | 2 +- .../interfaces/pump/{ => defs}/PumpType.kt | 2 +- .../{FileStrorage.kt => FileStorage.kt} | 0 .../configBuilder/RunningConfiguration.kt | 2 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 2 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 8 +++--- .../nightscout/androidaps/TestPumpPlugin.kt | 8 +++--- .../SmsCommunicatorPluginTest.kt | 4 +-- .../pump/virtual/VirtualPumpPluginUTest.kt | 2 +- .../plugins/pump/combo/ComboPlugin.java | 8 +++--- .../androidaps/dana/DanaFragment.kt | 2 +- .../nightscout/androidaps/dana/DanaPump.kt | 2 +- .../dana/activities/DanaHistoryActivity.kt | 2 +- .../activities/DanaUserOptionsActivity.kt | 2 +- .../danaRKorean/DanaRKoreanPlugin.kt | 4 +-- .../services/DanaRKoreanExecutionService.java | 2 +- .../androidaps/danaRv2/DanaRv2Plugin.java | 4 +-- .../danaRv2/comm/MsgHistoryEventsV2.kt | 2 +- .../services/DanaRv2ExecutionService.java | 2 +- .../androidaps/danar/AbstractDanaRPlugin.java | 4 +-- .../androidaps/danar/DanaRPlugin.java | 4 +-- .../danar/services/DanaRExecutionService.java | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 8 +++--- .../pump/danaR/comm/MsgSettingBasalTest.kt | 2 +- .../androidaps/danars/DanaRSPlugin.kt | 8 +++--- .../comm/DanaRSPacketAPSHistoryEvents.kt | 2 +- .../androidaps/diaconn/DiaconnG8Plugin.kt | 8 +++--- .../packet/BigLogInquireResponsePacket.kt | 6 ++--- .../BigMainInfoInquireResponsePacket.kt | 4 +-- .../diaconn/service/DiaconnG8Service.kt | 2 +- .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 8 +++--- .../pump/eopatch/alarm/AlarmManager.kt | 2 +- .../pump/eopatch/ble/IPatchManager.java | 2 +- .../pump/eopatch/ble/PatchManager.java | 4 +-- .../pump/eopatch/ble/PatchManagerImpl.java | 4 +-- .../eopatch/ble/task/StartCalcBolusTask.java | 2 +- .../ui/viewmodel/EopatchOverviewViewModel.kt | 2 +- .../pump/medtronic/MedtronicPumpPlugin.kt | 6 ++--- .../comm/MedtronicCommunicationManager.kt | 2 +- .../pump/medtronic/comm/MedtronicConverter.kt | 2 +- .../medtronic/data/MedtronicHistoryData.kt | 4 +-- .../pump/medtronic/data/dto/BasalProfile.kt | 2 +- .../medtronic/driver/MedtronicPumpStatus.kt | 2 +- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 8 +++--- .../pod/state/OmnipodDashPodStateManager.kt | 2 +- .../state/OmnipodDashPodStateManagerImpl.kt | 2 +- .../pump/omnipod/dash/history/data/Record.kt | 4 +-- .../omnipod/dash/ui/DashPodHistoryActivity.kt | 2 +- .../action/DashInsertCannulaViewModel.kt | 4 +-- .../pump/omnipod/dash/util/Functions.kt | 2 +- .../omnipod/eros/OmnipodErosPumpPlugin.java | 11 ++++---- .../eros/manager/AapsOmnipodErosManager.java | 7 ++--- .../eros/ui/ErosPodHistoryActivity.java | 2 +- .../omnipod/eros/OmnipodErosPumpPluginTest.kt | 2 +- .../plugins/pump/common/PumpPluginAbstract.kt | 8 +++--- .../plugins/pump/common/data/PumpStatus.kt | 2 +- .../plugins/pump/common/sync/PumpDbEntry.kt | 13 +++++----- .../common/sync/PumpSyncEntriesCreator.java | 2 +- .../pump/common/sync/PumpSyncStorage.kt | 2 +- .../plugins/pump/common/utils/ProfileUtil.kt | 2 +- .../tasks/InitializePumpManagerTask.kt | 2 +- .../ui/activities/TDDStatsActivity.kt | 2 +- .../info/nightscout/ui/dialogs/CarbsDialog.kt | 2 +- .../ui/elements}/EmptyRecyclerView.kt | 2 +- .../treatments_bolus_carbs_fragment.xml | 2 +- .../layout/treatments_careportal_fragment.xml | 2 +- .../treatments_extendedbolus_fragment.xml | 2 +- .../treatments_profileswitch_fragment.xml | 2 +- .../layout/treatments_tempbasals_fragment.xml | 2 +- .../layout/treatments_temptarget_fragment.xml | 2 +- .../layout/treatments_user_entry_fragment.xml | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 8 +++--- 118 files changed, 249 insertions(+), 228 deletions(-) create mode 100644 core/core-main/src/main/java/info/nightscout/core/pumpExtensions/DetailedBolusInfoExtension.kt rename core/core-main/src/main/java/info/nightscout/{androidaps/extensions => core/pumpExtensions}/PumpStateExtension.kt (95%) rename core/core-main/src/main/java/info/nightscout/{androidaps/extensions => core/pumpExtensions}/PumpTypeExtension.kt (99%) rename {core/core-main/src/main/java/info/nightscout/androidaps/data => interfaces/src/main/java/info/nightscout/interfaces/pump}/DetailedBolusInfo.kt (82%) rename interfaces/src/main/java/info/nightscout/interfaces/pump/{ => defs}/DoseSettings.kt (77%) rename interfaces/src/main/java/info/nightscout/interfaces/pump/{ => defs}/DoseStepSize.kt (84%) rename interfaces/src/main/java/info/nightscout/interfaces/pump/{ => defs}/ManufacturerType.kt (86%) rename interfaces/src/main/java/info/nightscout/interfaces/pump/{ => defs}/PumpCapability.kt (98%) rename interfaces/src/main/java/info/nightscout/interfaces/pump/{ => defs}/PumpDescription.kt (99%) rename interfaces/src/main/java/info/nightscout/interfaces/pump/{ => defs}/PumpTempBasalType.kt (57%) rename interfaces/src/main/java/info/nightscout/interfaces/pump/{ => defs}/PumpType.kt (99%) rename interfaces/src/main/java/info/nightscout/interfaces/storage/{FileStrorage.kt => FileStorage.kt} (100%) rename {core/core-main/src/main/java/info/nightscout/androidaps/extensions => ui/src/main/java/info/nightscout/ui/elements}/EmptyRecyclerView.kt (98%) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index 08bec3cf63..13d6b4970a 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -7,7 +7,7 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.databinding.DialogFillBinding diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index 85ce90fa01..4da736be18 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -9,9 +9,6 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogInsulinBinding import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin @@ -27,15 +24,19 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.toSignedString import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.core.pumpExtensions.insertBolusTransaction import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt index 5ce44dc903..73d6a1c4e1 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -38,7 +38,7 @@ import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index 4cc9372866..ed6322fbc8 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -24,7 +24,7 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index 5d899aaa02..397a10bbe0 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -9,8 +9,6 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.databinding.DialogTreatmentBinding import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin @@ -22,12 +20,16 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.core.pumpExtensions.insertBolusTransaction +import info.nightscout.core.pumpExtensions.insertCarbsTransaction import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag 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 f5d71a1f49..d19e234bc2 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 @@ -16,7 +16,7 @@ import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper @@ -56,7 +56,7 @@ import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt index f1f0da7ed2..a1c5025ef8 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt @@ -18,7 +18,7 @@ import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.interfaces.Safety import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin 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 9edba3b27b..2bf9222da3 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 @@ -84,7 +84,7 @@ import info.nightscout.interfaces.Constants import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin import info.nightscout.plugins.general.overview.notifications.NotificationStore diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt index 7d41714441..f503b2090a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.WarnColors import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.Config -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.plugins.sync.nsclient.extensions.age import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP 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 965ddc4426..4e89584e82 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 @@ -4,7 +4,7 @@ import android.app.NotificationManager import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index f0c350bc21..d60de392db 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -5,7 +5,7 @@ import android.text.Spanned import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorResultTransaction import info.nightscout.androidaps.extensions.formatColor @@ -35,7 +35,7 @@ import info.nightscout.interfaces.CarbTimer import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.Round diff --git a/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 6d317c2037..257a6c9c02 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject 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 0aa5358c57..d580768504 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -35,7 +35,7 @@ import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert 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 6e43a490ca..4f23e8ab06 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 @@ -18,7 +18,7 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.bus.RxBus 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 a4d6fd6682..bcc97f28eb 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 @@ -8,7 +8,7 @@ import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.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 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 0e83d9f605..7efdc68d4c 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 @@ -14,7 +14,7 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin diff --git a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index deebd4bb08..b367dbc15c 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,18 +1,18 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.logging.AAPSLogger import org.json.JSONObject diff --git a/build.gradle b/build.gradle index 7b491b8202..870fdd0d11 100644 --- a/build.gradle +++ b/build.gradle @@ -70,7 +70,7 @@ plugins { id "io.gitlab.arturbosch.detekt" version "1.21.0" id "org.jlleitschuh.gradle.ktlint" version "11.0.0" id 'org.barfuin.gradle.jacocolog' version '2.0.0' - id 'org.jetbrains.kotlin.android' version '1.7.21' apply false + id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false } allprojects { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt index 672a825cdb..20cf7988e3 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.interfaces import android.text.Spanned -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.interfaces.queue.CustomCommand diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt index c1f06346e8..ed84388ac4 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.data.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.data.PumpEnactResult -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.queue.CustomCommand diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt index 3dde921289..4d5d7907a3 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType /** * This interface allows pump drivers to push data changes (creation and update of treatments, temporary basals and extended boluses) back to AAPS-core. diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt index f1c9096f8b..598bfe2953 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt @@ -13,7 +13,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.main.R import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.utils.HtmlHelper.fromHtml import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt index 4c97446250..e9579764c2 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/DetailedBolusInfoStorage.kt @@ -1,7 +1,8 @@ package info.nightscout.androidaps.plugins.pump.common.bolusInfo import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.core.pumpExtensions.toJsonString +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.shared.utils.T import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -19,7 +20,7 @@ class DetailedBolusInfoStorage @Inject constructor( @Synchronized fun add(detailedBolusInfo: DetailedBolusInfo) { - aapsLogger.debug("Stored bolus info: $detailedBolusInfo") + aapsLogger.debug("Stored bolus info: ${detailedBolusInfo.toJsonString()}") store.add(detailedBolusInfo) } diff --git a/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/DetailedBolusInfoExtension.kt b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/DetailedBolusInfoExtension.kt new file mode 100644 index 0000000000..2bf38f8193 --- /dev/null +++ b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/DetailedBolusInfoExtension.kt @@ -0,0 +1,26 @@ +package info.nightscout.core.pumpExtensions + +import com.google.gson.Gson +import info.nightscout.database.impl.transactions.InsertOrUpdateBolusTransaction +import info.nightscout.database.impl.transactions.InsertOrUpdateCarbsTransaction +import info.nightscout.interfaces.pump.DetailedBolusInfo + +fun DetailedBolusInfo.insertCarbsTransaction(): InsertOrUpdateCarbsTransaction { + if (carbs == 0.0) throw IllegalStateException("carbs == 0.0") + return InsertOrUpdateCarbsTransaction(createCarbs()!!) +} + +fun DetailedBolusInfo.insertBolusTransaction(): InsertOrUpdateBolusTransaction { + if (insulin == 0.0) throw IllegalStateException("insulin == 0.0") + return InsertOrUpdateBolusTransaction(createBolus()!!) +} + +fun DetailedBolusInfo.toJsonString(): String = Gson().toJson(this) + +// Cannot access Companion extension from java so create common +fun DetailedBolusInfo.fromJsonString(json: String): DetailedBolusInfo = + Gson().fromJson(json, DetailedBolusInfo::class.java) + + + + diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpStateExtension.kt similarity index 95% rename from core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt rename to core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpStateExtension.kt index 755243fca2..b4d6bce4bc 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpStateExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpStateExtension.kt @@ -2,9 +2,8 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal +import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import kotlin.math.ceil import kotlin.math.max @@ -56,7 +55,7 @@ fun PumpSync.PumpState.ExtendedBolus.getPassedDurationToTimeInMinutes(time: Long ((min(time, end) - timestamp) / 60.0 / 1000).roundToInt() fun PumpSync.PumpState.ExtendedBolus.toStringFull(dateUtil: DateUtil): String = - "E " + to2Decimal(rate) + "U/h @" + + "E " + DecimalFormatter.to2Decimal(rate) + "U/h @" + dateUtil.timeString(timestamp) + " " + getPassedDurationToTimeInMinutes(dateUtil.now()) + "/" + T.msecs(duration).mins() + "min" diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpTypeExtension.kt similarity index 99% rename from core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt rename to core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpTypeExtension.kt index 0514020c57..f423372b92 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/PumpTypeExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpTypeExtension.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.extensions import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType fun PumpType.Companion.fromDbSource(s: UserEntry.Sources): PumpType.Source = when (s) { diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 6d317c2037..257a6c9c02 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt index 8a47986297..1ad9c94645 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt @@ -2,9 +2,12 @@ package info.nightscout.androidaps.data import android.content.Context import info.nightscout.androidaps.TestBase +import info.nightscout.core.pumpExtensions.fromJsonString +import info.nightscout.core.pumpExtensions.toJsonString import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.TherapyEvent +import info.nightscout.interfaces.pump.DetailedBolusInfo import org.apache.commons.lang3.builder.EqualsBuilder import org.junit.Assert import org.junit.Test diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt index f46f2e0daa..e845e45d73 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PumpDescriptionTest.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.interfaces.pump.PumpCapability -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.interfaces.pump.PumpTempBasalType -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpCapability +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpTempBasalType +import info.nightscout.interfaces.pump.defs.PumpType import org.junit.Assert import org.junit.Test diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt index 5e9f4108ec..a3b08207e6 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.database.entities.TemporaryBasal import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble import org.junit.Assert import org.junit.Before diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt index e6d0c7ac4e..1bec2f8fcc 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/DetailedBolusInfoStorageTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.pump.bolusInfo import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import org.junit.Assert.assertEquals import org.junit.Assert.assertNull diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 8ab7ace961..462e3c3115 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -1,6 +1,6 @@ package info.nightscout.implementation.pump -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.database.impl.transactions.InsertBolusWithTempIdTransaction @@ -39,7 +39,7 @@ import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.VirtualPump import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index 014996b3ee..6c4186909f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -7,12 +7,13 @@ import android.text.Spanned import androidx.appcompat.app.AppCompatActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.dialogs.BolusProgressDialog +import info.nightscout.core.pumpExtensions.insertCarbsTransaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt index f2835e0849..b29702ebea 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandBolus.kt @@ -1,7 +1,7 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt index fb53e43d46..1504be8a80 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt @@ -1,7 +1,7 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 6d317c2037..257a6c9c02 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index 6767efaba0..33ea916bbf 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -6,7 +6,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt index 415f774342..30ce88d798 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt @@ -12,7 +12,7 @@ import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.queue.commands.Command diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 01d07e6819..f4e20c86ac 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -30,7 +30,7 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.insight.R; @@ -47,17 +47,17 @@ import info.nightscout.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.Pump; -import info.nightscout.interfaces.pump.PumpDescription; +import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.interfaces.PumpSync.PumpState.TemporaryBasal; import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.interfaces.pump.ManufacturerType; +import info.nightscout.interfaces.pump.defs.ManufacturerType; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.plugins.pump.insight.app_layer.Service; import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.HistoryReadingDirection; import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.ReadHistoryEventsMessage; diff --git a/interfaces/build.gradle b/interfaces/build.gradle index 3e5bcf62be..99cb129e22 100644 --- a/interfaces/build.gradle +++ b/interfaces/build.gradle @@ -23,6 +23,7 @@ dependencies { // (ResourceHelper, AAPSLogger interface) implementation project(':app-wear-shared:shared') implementation project(':app-wear-shared:rx') + implementation project(':database:entities') api "androidx.appcompat:appcompat:$appcompat_version" api "androidx.preference:preference-ktx:$preferencektx_version" diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt similarity index 82% rename from core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt index 74c62f0fb3..7e3f67e63b 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/DetailedBolusInfo.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt @@ -1,14 +1,11 @@ -package info.nightscout.androidaps.data +package info.nightscout.interfaces.pump import android.content.Context -import com.google.gson.Gson -import info.nightscout.database.impl.transactions.InsertOrUpdateBolusTransaction -import info.nightscout.database.impl.transactions.InsertOrUpdateCarbsTransaction import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.TherapyEvent -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType class DetailedBolusInfo { @@ -120,19 +117,6 @@ class DetailedBolusInfo { ) else null - fun insertCarbsTransaction(): InsertOrUpdateCarbsTransaction { - if (carbs == 0.0) throw IllegalStateException("carbs == 0.0") - return InsertOrUpdateCarbsTransaction(createCarbs()!!) - } - - fun insertBolusTransaction(): InsertOrUpdateBolusTransaction { - if (insulin == 0.0) throw IllegalStateException("insulin == 0.0") - return InsertOrUpdateBolusTransaction(createBolus()!!) - } - - fun toJsonString(): String = - Gson().toJson(this) - fun copy(): DetailedBolusInfo { val n = DetailedBolusInfo() n.insulin = insulin @@ -159,11 +143,6 @@ class DetailedBolusInfo { return n } - override fun toString(): String = toJsonString() - companion object { - - fun fromJsonString(json: String): DetailedBolusInfo = - Gson().fromJson(json, DetailedBolusInfo::class.java) } } \ No newline at end of file diff --git a/interfaces/src/main/java/info/nightscout/interfaces/pump/DoseSettings.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseSettings.kt similarity index 77% rename from interfaces/src/main/java/info/nightscout/interfaces/pump/DoseSettings.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseSettings.kt index 5a6193a7fd..2447c3d99f 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/pump/DoseSettings.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseSettings.kt @@ -1,3 +1,3 @@ -package info.nightscout.interfaces.pump +package info.nightscout.interfaces.pump.defs class DoseSettings constructor(val step: Double, val durationStep: Int, val maxDuration: Int, val minDose: Double, val maxDose: Double = Double.MAX_VALUE) \ No newline at end of file diff --git a/interfaces/src/main/java/info/nightscout/interfaces/pump/DoseStepSize.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseStepSize.kt similarity index 84% rename from interfaces/src/main/java/info/nightscout/interfaces/pump/DoseStepSize.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseStepSize.kt index d414146cca..ba48c0b716 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/pump/DoseStepSize.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/DoseStepSize.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package info.nightscout.interfaces.pump.defs import java.util.Locale @@ -7,24 +7,29 @@ enum class DoseStepSize(private val entries: Array) { ComboBasal(arrayOf( DoseStepSizeEntry(0.0, 1.0, 0.01), DoseStepSizeEntry(1.0, 10.0, 0.05), - DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.1))), + DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.1) + )), InsightBolus(arrayOf( DoseStepSizeEntry(0.0, 2.0, 0.05), DoseStepSizeEntry(2.0, 5.0, 0.1), DoseStepSizeEntry(5.0, 10.0, 0.2), - DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.5))), + DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.5) + )), InsightBasal(arrayOf( DoseStepSizeEntry(0.0, 5.0, 0.01), - DoseStepSizeEntry(5.0, Double.MAX_VALUE, 0.1))), + DoseStepSizeEntry(5.0, Double.MAX_VALUE, 0.1) + )), MedtronicVeoBasal(arrayOf( DoseStepSizeEntry(0.0, 1.0, 0.025), DoseStepSizeEntry(1.0, 10.0, 0.05), - DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.1))), + DoseStepSizeEntry(10.0, Double.MAX_VALUE, 0.1) + )), YpsopumpBasal(arrayOf( DoseStepSizeEntry(0.0, 1.0, 0.01), DoseStepSizeEntry(1.0, 2.0, 0.02), DoseStepSizeEntry(2.0, 15.0, 0.1), - DoseStepSizeEntry(15.0, 40.0, 0.5)) + DoseStepSizeEntry(15.0, 40.0, 0.5) + ) ); fun getStepSizeForAmount(amount: Double): Double { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/pump/ManufacturerType.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/ManufacturerType.kt similarity index 86% rename from interfaces/src/main/java/info/nightscout/interfaces/pump/ManufacturerType.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/defs/ManufacturerType.kt index fd197fee3d..ddecad988c 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/pump/ManufacturerType.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/ManufacturerType.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package info.nightscout.interfaces.pump.defs enum class ManufacturerType(val description: String) { AAPS("AAPS"), diff --git a/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpCapability.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpCapability.kt similarity index 98% rename from interfaces/src/main/java/info/nightscout/interfaces/pump/PumpCapability.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpCapability.kt index e8b58042c9..ed9620a818 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpCapability.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpCapability.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package info.nightscout.interfaces.pump.defs enum class PumpCapability { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpDescription.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpDescription.kt similarity index 99% rename from interfaces/src/main/java/info/nightscout/interfaces/pump/PumpDescription.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpDescription.kt index 093cfa6756..f3a8e68ce7 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpDescription.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpDescription.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package info.nightscout.interfaces.pump.defs class PumpDescription() { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpTempBasalType.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpTempBasalType.kt similarity index 57% rename from interfaces/src/main/java/info/nightscout/interfaces/pump/PumpTempBasalType.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpTempBasalType.kt index 101b685432..49eacfda89 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpTempBasalType.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpTempBasalType.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package info.nightscout.interfaces.pump.defs enum class PumpTempBasalType { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpType.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpType.kt similarity index 99% rename from interfaces/src/main/java/info/nightscout/interfaces/pump/PumpType.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpType.kt index 047bbbdcd0..30163c9ddf 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpType.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/defs/PumpType.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.pump +package info.nightscout.interfaces.pump.defs import info.nightscout.interfaces.R import info.nightscout.interfaces.utils.Round diff --git a/interfaces/src/main/java/info/nightscout/interfaces/storage/FileStrorage.kt b/interfaces/src/main/java/info/nightscout/interfaces/storage/FileStorage.kt similarity index 100% rename from interfaces/src/main/java/info/nightscout/interfaces/storage/FileStrorage.kt rename to interfaces/src/main/java/info/nightscout/interfaces/storage/FileStorage.kt diff --git a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt index 54652d33fd..f6e997f5bb 100644 --- a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt +++ b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt @@ -8,7 +8,7 @@ import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.Config import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification 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 3ae44eb019..b1a9c2f03f 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 @@ -12,7 +12,7 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction diff --git a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt index 9ab739ee3f..f4c9728d2c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -4,7 +4,7 @@ import android.os.SystemClock import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.events.EventPreferenceChange @@ -25,9 +25,9 @@ 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.pump.PumpDescription -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.plugins.R import info.nightscout.plugins.pump.virtual.events.EventVirtualPumpUpdateGui diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 6d317c2037..257a6c9c02 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject 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 cf18f7b6e9..eedd871589 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 @@ -28,8 +28,8 @@ import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.data.smsCommunicator.Sms -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword diff --git a/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt index 4905016c15..d2a3b94414 100644 --- a/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 5c2a8f8831..e1c785ef2e 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -21,7 +21,7 @@ import javax.inject.Singleton; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.combo.R; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.CommandQueue; @@ -52,9 +52,9 @@ import info.nightscout.interfaces.PluginDescription; import info.nightscout.interfaces.PluginType; import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.pump.ManufacturerType; -import info.nightscout.interfaces.pump.PumpDescription; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.ManufacturerType; +import info.nightscout.interfaces.pump.defs.PumpDescription; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; import info.nightscout.rx.events.EventOverviewBolusProgress; diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt index e284fa66c8..9d548b19f0 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt @@ -27,7 +27,7 @@ import info.nightscout.androidaps.utils.userEntry.UserEntryMapper.Sources import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Dana -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt index a8ab56ba04..9e359cca39 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.shared.utils.T diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt index 758db789a5..c4d9a8dc29 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt @@ -23,7 +23,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventDanaRSyncStatus diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt index d59ebb424f..31eacc0867 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventInitializationChanged diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index d4f99224f8..16659fb8e6 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danaRKorean.services.DanaRKoreanExecutionService import info.nightscout.androidaps.danar.AbstractDanaRPlugin import info.nightscout.androidaps.danar.R -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin @@ -22,7 +22,7 @@ import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.data.PumpEnactResult -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java index b976c5516e..41658f5a24 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java @@ -50,7 +50,7 @@ import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.shared.utils.DateUtil; import info.nightscout.shared.utils.T; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index ae88a17e18..3b370f91cf 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -16,7 +16,7 @@ import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.danaRv2.services.DanaRv2ExecutionService; import info.nightscout.androidaps.danar.AbstractDanaRPlugin; import info.nightscout.androidaps.danar.R; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; @@ -28,7 +28,7 @@ import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalSt import info.nightscout.core.fabric.FabricPrivacy; import info.nightscout.interfaces.Constraint; import info.nightscout.interfaces.data.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.utils.Round; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt index 692d81d004..dcc08e521e 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgHistoryEventsV2.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.danar.comm.MessageBase import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.shared.utils.T import info.nightscout.rx.logging.LTag import java.util.GregorianCalendar diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java index 8f16467156..d1bfa31449 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java @@ -64,7 +64,7 @@ import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.shared.utils.DateUtil; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index 50037a8eb5..bb17c5aa31 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -22,11 +22,11 @@ import info.nightscout.interfaces.Dana; import info.nightscout.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.Pump; -import info.nightscout.interfaces.pump.PumpDescription; +import info.nightscout.interfaces.pump.defs.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.interfaces.pump.defs.ManufacturerType; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.interfaces.notifications.Notification; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index 9e1eae94a9..f4170805d9 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -14,7 +14,7 @@ import javax.inject.Singleton; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.danar.services.DanaRExecutionService; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; @@ -25,7 +25,7 @@ import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.core.fabric.FabricPrivacy; import info.nightscout.interfaces.Constraint; import info.nightscout.interfaces.data.PumpEnactResult; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.utils.Round; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java index da21a175c8..9ca9e5720d 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java @@ -56,7 +56,7 @@ import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.rx.bus.RxBus; diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 32d027eaff..df7e553b7b 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,15 +1,15 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSettingBasalTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSettingBasalTest.kt index 00cbdcd754..226da3f35d 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSettingBasalTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSettingBasalTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgSettingBasal -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import org.junit.Assert import org.junit.Test import org.mockito.Mockito.`when` diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index 6d5ffdd808..d228207688 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -13,7 +13,7 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.dana.comm.RecordTypes import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange import info.nightscout.androidaps.danars.services.DanaRSService -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -37,9 +37,9 @@ import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt index 64a4cad34f..f844000096 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt @@ -4,7 +4,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index 6857f3036e..8c99c3021d 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -9,7 +9,7 @@ import android.text.format.DateFormat import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.diaconn.events.EventDiaconnG8DeviceChange import info.nightscout.androidaps.diaconn.service.DiaconnG8Service @@ -35,9 +35,9 @@ import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.utils.Round diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt index 1e3dbcdc15..b3ccc3a82a 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.diaconn.packet import android.content.Context import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.api.ApiResponse @@ -42,12 +42,12 @@ import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.shared.extensions.safeGetPackageInfo import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt index 0a13886f76..cf2b93eb6a 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigMainInfoInquireResponsePacket.kt @@ -4,9 +4,9 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil -import info.nightscout.interfaces.pump.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP import org.joda.time.DateTime diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index 3d2c3405ef..279e1ab710 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -61,7 +61,7 @@ import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constants import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index 9970889317..77a03b7cec 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch import android.os.SystemClock import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.CommandQueue @@ -23,9 +23,9 @@ import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.queue.CustomCommand diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt index 219cb88236..ae422e51c9 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt @@ -23,7 +23,7 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ui.AlarmHelperActivity import info.nightscout.androidaps.plugins.pump.eopatch.vo.Alarms import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/IPatchManager.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/IPatchManager.java index 1cd9b5eef2..9d5c5c8dbb 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/IPatchManager.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/IPatchManager.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.BleConnectionState; import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.PatchSelfTestResult; import info.nightscout.androidaps.plugins.pump.eopatch.core.scan.ScanList; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java index c381fa1224..c9b870d70a 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java @@ -8,14 +8,14 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.plugins.pump.eopatch.R; import info.nightscout.androidaps.plugins.pump.eopatch.RxAction; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java index 3c3b93b119..2a50545bbb 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java @@ -33,9 +33,9 @@ import javax.crypto.KeyAgreement; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.ble.task.ActivateTask; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartCalcBolusTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartCalcBolusTask.java index d27729eea5..a6a5b58a14 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartCalcBolusTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StartCalcBolusTask.java @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.eopatch.ble.task; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BolusStart; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BolusResponse; import info.nightscout.rx.logging.LTag; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt index 166b261687..26e8d27b61 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt @@ -6,7 +6,7 @@ import androidx.lifecycle.Transformations import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index 6c45c97847..1e37bd6d98 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -7,7 +7,7 @@ import android.os.IBinder import android.os.SystemClock import androidx.preference.Preference import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue @@ -59,8 +59,8 @@ import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.utils.TimeChangeType diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt index 703a2c5c16..4a2a20d407 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicCommunicationManager.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm import android.os.SystemClock -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLinkCommunicationException diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt index 27dbf08dd2..91a08ae3e5 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicConverter.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.comm -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BasalProfile import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.BatteryStatusDTO import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.PumpSettingDTO diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index eb9b886bbc..eb034fb824 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -3,11 +3,11 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data import com.google.gson.Gson import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntry import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryBolus import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryTBR diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt index b420030fde..19e557a96f 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/dto/BasalProfile.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data.dto import com.google.gson.annotations.Expose -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt index fb3dd00804..13b96f1b89 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/driver/MedtronicPumpStatus.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.medtronic.driver -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 70546aa3fe..4df111bcc9 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -5,7 +5,7 @@ import android.os.Handler import android.os.HandlerThread import android.text.format.DateFormat import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.convertedToAbsolute @@ -57,9 +57,9 @@ import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.queue.CustomCommand diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt index e09fa9cf56..05efe00d2a 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Id import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.pair.PairResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.* diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt index 179b1004f4..b28bbc8036 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state import android.os.SystemClock import com.google.gson.Gson -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.plugins.pump.omnipod.dash.EventOmnipodDashPumpValuesChanged import info.nightscout.androidaps.plugins.pump.omnipod.dash.R import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.Id diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt index f129ab292d..3e2f28ed39 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.interfaces.Profile sealed class Record @@ -25,7 +25,7 @@ enum class BolusType { fun fromBolusInfoBolusType(type: DetailedBolusInfo.BolusType): BolusType { return when (type) { DetailedBolusInfo.BolusType.SMB -> SMB - else -> DEFAULT + else -> DEFAULT } } } diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt index 893dd59b67..b6971c0c1b 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodHistoryActivity.kt @@ -13,7 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index 016313ed48..45ce5dc07a 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activatio import androidx.annotation.StringRes import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync @@ -22,7 +22,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.mapProfileToBas import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt index f4f95f7f03..59c5f28119 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.util import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram import java.util.* import kotlin.math.roundToInt diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index 80c8001410..c808ce0162 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -34,7 +34,8 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.data.DetailedBolusInfo; +import info.nightscout.core.pumpExtensions.DetailedBolusInfoExtensionKt; +import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; @@ -94,9 +95,9 @@ import info.nightscout.interfaces.PluginDescription; import info.nightscout.interfaces.PluginType; import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.pump.ManufacturerType; -import info.nightscout.interfaces.pump.PumpDescription; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.ManufacturerType; +import info.nightscout.interfaces.pump.defs.PumpDescription; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.pump.actions.CustomActionType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.interfaces.queue.CustomCommand; @@ -366,7 +367,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements Pump, Riley String activeBolusString = sp.getString(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS, ""); aapsLogger.warn(LTag.PUMP, "Found active bolus in SP: {}. Adding Treatment.", activeBolusString); try { - aapsOmnipodErosManager.addBolusToHistory(DetailedBolusInfo.Companion.fromJsonString(activeBolusString)); + aapsOmnipodErosManager.addBolusToHistory(DetailedBolusInfoExtensionKt.fromJsonString(new DetailedBolusInfo(), activeBolusString)); } catch (Exception ex) { aapsLogger.error(LTag.PUMP, "Failed to add active bolus to history", ex); } diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index ac72260156..9511e6fd61 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -14,14 +14,12 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; -import info.nightscout.interfaces.pump.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType; import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; @@ -69,9 +67,12 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.Ero import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; +import info.nightscout.core.pumpExtensions.DetailedBolusInfoExtensionKt; import info.nightscout.interfaces.ActivityNames; import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; @@ -426,7 +427,7 @@ public class AapsOmnipodErosManager { // // I discussed this with the AAPS team but nobody seems to care so we're stuck with this ugly workaround for now try { - sp.putString(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS, detailedBolusInfo.toJsonString()); + sp.putString(OmnipodErosStorageKeys.Preferences.ACTIVE_BOLUS, DetailedBolusInfoExtensionKt.toJsonString(detailedBolusInfo)); aapsLogger.debug(LTag.PUMP, "Stored active bolus to SP for recovery"); } catch (Exception ex) { aapsLogger.error(LTag.PUMP, "Failed to store active bolus to SP", ex); diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java index c50760d2e5..1d6f816f83 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java @@ -26,7 +26,7 @@ import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt index 8cf44d746e..41926f97d0 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index b07988cb07..42275f8ca3 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -6,7 +6,7 @@ import android.content.ServiceConnection import android.text.format.DateFormat import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -28,9 +28,9 @@ import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.PluginDescription import info.nightscout.interfaces.data.PumpEnactResult -import info.nightscout.interfaces.pump.ManufacturerType -import info.nightscout.interfaces.pump.PumpDescription -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.kt index d1b1f40fc9..8bcd1816ae 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/data/PumpStatus.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.data import info.nightscout.androidaps.plugins.pump.common.defs.PumpRunningState -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import java.util.* /** diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt index d2ae0a4616..5212bd1567 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.common.sync -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType // data class PumpDbEntry constructor(var temporaryId: Long, // var date: Long, @@ -62,10 +62,11 @@ data class PumpDbEntryBolus(override var temporaryId: Long, date: Long, pumpType: PumpType, serialNumber: String, - detailedBolusInfo: DetailedBolusInfo) : this(temporaryId, date, pumpType, serialNumber, null, - detailedBolusInfo.insulin, - detailedBolusInfo.carbs, - detailedBolusInfo.bolusType) + detailedBolusInfo: DetailedBolusInfo + ) : this(temporaryId, date, pumpType, serialNumber, null, + detailedBolusInfo.insulin, + detailedBolusInfo.carbs, + detailedBolusInfo.bolusType) } diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncEntriesCreator.java b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncEntriesCreator.java index 40d409938f..7682e0993d 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncEntriesCreator.java +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncEntriesCreator.java @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.pump.common.sync; -import info.nightscout.interfaces.pump.PumpType; +import info.nightscout.interfaces.pump.defs.PumpType; public interface PumpSyncEntriesCreator { diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt index a45ab5b8cf..c6adc55e4d 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.sync import com.thoughtworks.xstream.XStream import com.thoughtworks.xstream.security.AnyTypePermission -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt index bf6f2f7045..5dbb5bef04 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.utils import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Profile.ProfileValue -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import java.util.* object ProfileUtil { diff --git a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt index bc5c44b674..4b17eff0f1 100644 --- a/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt +++ b/pump/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.task import android.content.Context import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.ManufacturerType +import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkTargetFrequency diff --git a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt index f2d6d404fe..3e6cb5a87f 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/TDDStatsActivity.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.main.R import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.interfaces.pump.PumpType +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventDanaRSyncStatus diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index 9ee87d9378..b407ea9ccb 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -8,7 +8,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner -import info.nightscout.androidaps.data.DetailedBolusInfo +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.dialogs.DialogFragmentWithDate diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt b/ui/src/main/java/info/nightscout/ui/elements/EmptyRecyclerView.kt similarity index 98% rename from core/core-main/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt rename to ui/src/main/java/info/nightscout/ui/elements/EmptyRecyclerView.kt index 6bb2afac9b..a44252a0ca 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/EmptyRecyclerView.kt +++ b/ui/src/main/java/info/nightscout/ui/elements/EmptyRecyclerView.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.ui.elements import android.content.Context import android.util.AttributeSet diff --git a/ui/src/main/res/layout/treatments_bolus_carbs_fragment.xml b/ui/src/main/res/layout/treatments_bolus_carbs_fragment.xml index 3628148475..30c3c21f66 100644 --- a/ui/src/main/res/layout/treatments_bolus_carbs_fragment.xml +++ b/ui/src/main/res/layout/treatments_bolus_carbs_fragment.xml @@ -23,7 +23,7 @@ android:textAppearance="@style/TextAppearance.AppCompat.Body1" android:visibility="gone" /> - - - - - - - Date: Thu, 10 Nov 2022 11:30:33 +0100 Subject: [PATCH 28/42] fix tests --- .../interfaces/ConstraintsCheckerTest.kt | 8 +- .../automation/actions/ActionAlarmTest.kt | 3 + .../core/pumpExtensions/PumpTypeExtension.kt | 2 +- .../src/main/res/values-night/colors.xml | 13 - core/core-main/src/main/res/values/colors.xml | 8 - .../androidaps/TestBaseWithProfile.kt | 4 +- .../androidaps/data/DetailedBolusInfoTest.kt | 4 +- .../22.json | 3694 +++++++++++++++++ .../pump/PumpSyncImplementation.kt | 6 +- .../interfaces/pump/DetailedBolusInfo.kt | 17 +- .../src/main/res/values-night/colors.xml | 17 + interfaces/src/main/res/values/colors.xml | 8 + .../plugins/pump/combo/ComboPluginTest.kt | 14 +- pump/medtronic/build.gradle | 1 + .../comm/MedtronicHistoryDataUTest.kt | 4 +- 15 files changed, 3747 insertions(+), 56 deletions(-) create mode 100644 database/impl/schemas/info.nightscout.database.impl.AppDatabase/22.json create mode 100644 interfaces/src/main/res/values-night/colors.xml 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 d580768504..52a89ecaec 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -8,10 +8,8 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.insight.database.InsightDatabaseDao import info.nightscout.androidaps.insight.database.InsightDbHelper -import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin @@ -30,6 +28,7 @@ import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl +import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.constraints.ConstraintsImpl import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Constraint @@ -58,7 +57,6 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { @Mock lateinit var glimpPlugin: GlimpPlugin @Mock lateinit var sensitivityOref1Plugin: SensitivityOref1Plugin @Mock lateinit var profiler: Profiler - @Mock lateinit var uel: UserEntryLogger @Mock lateinit var fileListProvider: PrefFileListProvider @Mock lateinit var repository: AppRepository @Mock lateinit var pumpSync: PumpSync @@ -80,7 +78,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { private lateinit var openAPSSMBDynamicISFPlugin: OpenAPSSMBDynamicISFPlugin private lateinit var hardLimits: HardLimits - val injector = HasAndroidInjector { + private val injector = HasAndroidInjector { AndroidInjector { if (it is Objective) { it.sp = sp @@ -135,7 +133,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { danaPump = DanaPump(aapsLogger, sp, dateUtil, injector) hardLimits = HardLimits(aapsLogger, rxBus, sp, rh, context, repository) objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, rh, activePlugin, sp, config) - comboPlugin = ComboPlugin(injector, aapsLogger, rxBus, rh, profileFunction, sp, commandQueue, context, pumpSync, dateUtil, ruffyScripter) + comboPlugin = ComboPlugin(injector, aapsLogger, rxBus, rh, profileFunction, sp, commandQueue, pumpSync, dateUtil, ruffyScripter) danaRPlugin = DanaRPlugin(injector, aapsLogger, aapsSchedulers, rxBus, context, rh, constraintChecker, activePlugin, sp, commandQueue, danaPump, dateUtil, fabricPrivacy, pumpSync) danaRSPlugin = DanaRSPlugin( diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt index 5cee80adf0..550e8d1a80 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionAlarmTest.kt @@ -11,6 +11,7 @@ import info.nightscout.shared.utils.DateUtil import info.nightscout.interfaces.utils.TimerUtil import info.nightscout.automation.R import info.nightscout.automation.elements.InputString +import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import org.junit.Assert import org.junit.Before @@ -26,6 +27,7 @@ class ActionAlarmTest : TestBase() { @Mock lateinit var context: Context @Mock lateinit var timerUtil: TimerUtil @Mock lateinit var dateUtil: DateUtil + @Mock lateinit var config: Config private lateinit var sut: ActionAlarm var injector: HasAndroidInjector = HasAndroidInjector { @@ -36,6 +38,7 @@ class ActionAlarmTest : TestBase() { it.context = context it.timerUtil = timerUtil it.dateUtil = dateUtil + it.config = config } if (it is PumpEnactResultImpl) { it.rh = rh diff --git a/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpTypeExtension.kt b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpTypeExtension.kt index f423372b92..b1c4ae590f 100644 --- a/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpTypeExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpTypeExtension.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.extensions +package info.nightscout.core.pumpExtensions import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.embedments.InterfaceIDs diff --git a/core/core-main/src/main/res/values-night/colors.xml b/core/core-main/src/main/res/values-night/colors.xml index 3821d1e840..fe833baab0 100644 --- a/core/core-main/src/main/res/values-night/colors.xml +++ b/core/core-main/src/main/res/values-night/colors.xml @@ -107,14 +107,6 @@ #009705 - - #666666 - #000000 - #77dd77 - #ff0400 - #FF8C00 - #03A9F4 - #1A000000 #33000000 @@ -141,11 +133,6 @@ #00000000 - - #77dd77 - #FF8C00 - #FF5555 - #BBBBBB #FFFFFF diff --git a/core/core-main/src/main/res/values/colors.xml b/core/core-main/src/main/res/values/colors.xml index 888bcbc062..86f1a39470 100644 --- a/core/core-main/src/main/res/values/colors.xml +++ b/core/core-main/src/main/res/values/colors.xml @@ -109,14 +109,6 @@ #009705 - - #666666 - #000000 - #77dd77 - #ff0400 - #FF8C00 - #03A9F4 - #1A000000 #33000000 diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 201d744fbf..30c77bf184 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,7 +4,6 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction @@ -12,7 +11,7 @@ import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.pureProfileFromJson -import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper @@ -28,7 +27,6 @@ open class TestBaseWithProfile : TestBase() { @Mock lateinit var activePluginProvider: ActivePlugin @Mock lateinit var rh: ResourceHelper - @Mock lateinit var fabricPrivacy: FabricPrivacy @Mock lateinit var profileFunction: ProfileFunction @Mock lateinit var defaultValueHelper: DefaultValueHelper @Mock lateinit var dateUtil: DateUtil diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt index 1ad9c94645..fa57cb2b1a 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/DetailedBolusInfoTest.kt @@ -19,7 +19,7 @@ class DetailedBolusInfoTest : TestBase() { @Test fun toStringShouldBeOverloaded() { val detailedBolusInfo = DetailedBolusInfo() - Assert.assertEquals(true, detailedBolusInfo.toString().contains("insulin")) + Assert.assertEquals(true, detailedBolusInfo.toJsonString().contains("insulin")) } @Test fun copyShouldCopyAllProperties() { @@ -36,7 +36,7 @@ class DetailedBolusInfoTest : TestBase() { detailedBolusInfo.context = context detailedBolusInfo.eventType = DetailedBolusInfo.EventType.BOLUS_WIZARD val serialized = detailedBolusInfo.toJsonString() - val deserialized = DetailedBolusInfo.fromJsonString(serialized) + val deserialized = DetailedBolusInfo().fromJsonString(serialized) Assert.assertEquals(1L, deserialized.bolusCalculatorResult?.timestamp) Assert.assertEquals(DetailedBolusInfo.EventType.BOLUS_WIZARD, deserialized.eventType) // Context should be excluded diff --git a/database/impl/schemas/info.nightscout.database.impl.AppDatabase/22.json b/database/impl/schemas/info.nightscout.database.impl.AppDatabase/22.json new file mode 100644 index 0000000000..b35d3cc1e8 --- /dev/null +++ b/database/impl/schemas/info.nightscout.database.impl.AppDatabase/22.json @@ -0,0 +1,3694 @@ +{ + "formatVersion": 1, + "database": { + "version": 22, + "identityHash": "09121464fb795b3c37bb1c2c2c3ea481", + "entities": [ + { + "tableName": "apsResults", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `algorithm` TEXT NOT NULL, `glucoseStatusJson` TEXT NOT NULL, `currentTempJson` TEXT NOT NULL, `iobDataJson` TEXT NOT NULL, `profileJson` TEXT NOT NULL, `autosensDataJson` TEXT, `mealDataJson` TEXT NOT NULL, `isMicroBolusAllowed` INTEGER, `resultJson` TEXT NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `apsResults`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "algorithm", + "columnName": "algorithm", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "glucoseStatusJson", + "columnName": "glucoseStatusJson", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "currentTempJson", + "columnName": "currentTempJson", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "iobDataJson", + "columnName": "iobDataJson", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "profileJson", + "columnName": "profileJson", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "autosensDataJson", + "columnName": "autosensDataJson", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mealDataJson", + "columnName": "mealDataJson", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isMicroBolusAllowed", + "columnName": "isMicroBolusAllowed", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "resultJson", + "columnName": "resultJson", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_apsResults_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_apsResults_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_apsResults_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_apsResults_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "apsResults", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "boluses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `amount` REAL NOT NULL, `type` TEXT NOT NULL, `notes` TEXT, `isBasalInsulin` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, `insulinLabel` TEXT, `insulinEndTime` INTEGER, `peak` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `boluses`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "notes", + "columnName": "notes", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "isBasalInsulin", + "columnName": "isBasalInsulin", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "insulinConfiguration.insulinLabel", + "columnName": "insulinLabel", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "insulinConfiguration.insulinEndTime", + "columnName": "insulinEndTime", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "insulinConfiguration.peak", + "columnName": "peak", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_boluses_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_boluses_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_boluses_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_boluses_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_boluses_temporaryId", + "unique": false, + "columnNames": [ + "temporaryId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_boluses_temporaryId` ON `${TABLE_NAME}` (`temporaryId`)" + }, + { + "name": "index_boluses_pumpId", + "unique": false, + "columnNames": [ + "pumpId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_boluses_pumpId` ON `${TABLE_NAME}` (`pumpId`)" + }, + { + "name": "index_boluses_pumpSerial", + "unique": false, + "columnNames": [ + "pumpSerial" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_boluses_pumpSerial` ON `${TABLE_NAME}` (`pumpSerial`)" + }, + { + "name": "index_boluses_pumpType", + "unique": false, + "columnNames": [ + "pumpType" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_boluses_pumpType` ON `${TABLE_NAME}` (`pumpType`)" + }, + { + "name": "index_boluses_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_boluses_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_boluses_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_boluses_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "boluses", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "bolusCalculatorResults", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `targetBGLow` REAL NOT NULL, `targetBGHigh` REAL NOT NULL, `isf` REAL NOT NULL, `ic` REAL NOT NULL, `bolusIOB` REAL NOT NULL, `wasBolusIOBUsed` INTEGER NOT NULL, `basalIOB` REAL NOT NULL, `wasBasalIOBUsed` INTEGER NOT NULL, `glucoseValue` REAL NOT NULL, `wasGlucoseUsed` INTEGER NOT NULL, `glucoseDifference` REAL NOT NULL, `glucoseInsulin` REAL NOT NULL, `glucoseTrend` REAL NOT NULL, `wasTrendUsed` INTEGER NOT NULL, `trendInsulin` REAL NOT NULL, `cob` REAL NOT NULL, `wasCOBUsed` INTEGER NOT NULL, `cobInsulin` REAL NOT NULL, `carbs` REAL NOT NULL, `wereCarbsUsed` INTEGER NOT NULL, `carbsInsulin` REAL NOT NULL, `otherCorrection` REAL NOT NULL, `wasSuperbolusUsed` INTEGER NOT NULL, `superbolusInsulin` REAL NOT NULL, `wasTempTargetUsed` INTEGER NOT NULL, `totalInsulin` REAL NOT NULL, `percentageCorrection` INTEGER NOT NULL, `profileName` TEXT NOT NULL, `note` TEXT NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `bolusCalculatorResults`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "targetBGLow", + "columnName": "targetBGLow", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "targetBGHigh", + "columnName": "targetBGHigh", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "isf", + "columnName": "isf", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "ic", + "columnName": "ic", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "bolusIOB", + "columnName": "bolusIOB", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "wasBolusIOBUsed", + "columnName": "wasBolusIOBUsed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "basalIOB", + "columnName": "basalIOB", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "wasBasalIOBUsed", + "columnName": "wasBasalIOBUsed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "glucoseValue", + "columnName": "glucoseValue", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "wasGlucoseUsed", + "columnName": "wasGlucoseUsed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "glucoseDifference", + "columnName": "glucoseDifference", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "glucoseInsulin", + "columnName": "glucoseInsulin", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "glucoseTrend", + "columnName": "glucoseTrend", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "wasTrendUsed", + "columnName": "wasTrendUsed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "trendInsulin", + "columnName": "trendInsulin", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "cob", + "columnName": "cob", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "wasCOBUsed", + "columnName": "wasCOBUsed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "cobInsulin", + "columnName": "cobInsulin", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "carbs", + "columnName": "carbs", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "wereCarbsUsed", + "columnName": "wereCarbsUsed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "carbsInsulin", + "columnName": "carbsInsulin", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "otherCorrection", + "columnName": "otherCorrection", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "wasSuperbolusUsed", + "columnName": "wasSuperbolusUsed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "superbolusInsulin", + "columnName": "superbolusInsulin", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "wasTempTargetUsed", + "columnName": "wasTempTargetUsed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "totalInsulin", + "columnName": "totalInsulin", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "percentageCorrection", + "columnName": "percentageCorrection", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "profileName", + "columnName": "profileName", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "note", + "columnName": "note", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_bolusCalculatorResults_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_bolusCalculatorResults_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_bolusCalculatorResults_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_bolusCalculatorResults_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + }, + { + "name": "index_bolusCalculatorResults_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_bolusCalculatorResults_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_bolusCalculatorResults_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_bolusCalculatorResults_isValid` ON `${TABLE_NAME}` (`isValid`)" + } + ], + "foreignKeys": [ + { + "table": "bolusCalculatorResults", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "carbs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `duration` INTEGER NOT NULL, `amount` REAL NOT NULL, `notes` TEXT, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `carbs`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "notes", + "columnName": "notes", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_carbs_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_carbs_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_carbs_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_carbs_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_carbs_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_carbs_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + }, + { + "name": "index_carbs_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_carbs_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_carbs_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_carbs_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "carbs", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "effectiveProfileSwitches", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `basalBlocks` TEXT NOT NULL, `isfBlocks` TEXT NOT NULL, `icBlocks` TEXT NOT NULL, `targetBlocks` TEXT NOT NULL, `glucoseUnit` TEXT NOT NULL, `originalProfileName` TEXT NOT NULL, `originalCustomizedName` TEXT NOT NULL, `originalTimeshift` INTEGER NOT NULL, `originalPercentage` INTEGER NOT NULL, `originalDuration` INTEGER NOT NULL, `originalEnd` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, `insulinLabel` TEXT NOT NULL, `insulinEndTime` INTEGER NOT NULL, `peak` INTEGER NOT NULL, FOREIGN KEY(`referenceId`) REFERENCES `effectiveProfileSwitches`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "basalBlocks", + "columnName": "basalBlocks", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isfBlocks", + "columnName": "isfBlocks", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icBlocks", + "columnName": "icBlocks", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "targetBlocks", + "columnName": "targetBlocks", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "glucoseUnit", + "columnName": "glucoseUnit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "originalProfileName", + "columnName": "originalProfileName", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "originalCustomizedName", + "columnName": "originalCustomizedName", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "originalTimeshift", + "columnName": "originalTimeshift", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "originalPercentage", + "columnName": "originalPercentage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "originalDuration", + "columnName": "originalDuration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "originalEnd", + "columnName": "originalEnd", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "insulinConfiguration.insulinLabel", + "columnName": "insulinLabel", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "insulinConfiguration.insulinEndTime", + "columnName": "insulinEndTime", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "insulinConfiguration.peak", + "columnName": "peak", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_effectiveProfileSwitches_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_effectiveProfileSwitches_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_effectiveProfileSwitches_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_effectiveProfileSwitches_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_effectiveProfileSwitches_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_effectiveProfileSwitches_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + }, + { + "name": "index_effectiveProfileSwitches_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_effectiveProfileSwitches_isValid` ON `${TABLE_NAME}` (`isValid`)" + } + ], + "foreignKeys": [ + { + "table": "effectiveProfileSwitches", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "extendedBoluses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `duration` INTEGER NOT NULL, `amount` REAL NOT NULL, `isEmulatingTempBasal` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `extendedBoluses`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "isEmulatingTempBasal", + "columnName": "isEmulatingTempBasal", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_extendedBoluses_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_extendedBoluses_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_extendedBoluses_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_extendedBoluses_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_extendedBoluses_endId", + "unique": false, + "columnNames": [ + "endId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_extendedBoluses_endId` ON `${TABLE_NAME}` (`endId`)" + }, + { + "name": "index_extendedBoluses_pumpSerial", + "unique": false, + "columnNames": [ + "pumpSerial" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_extendedBoluses_pumpSerial` ON `${TABLE_NAME}` (`pumpSerial`)" + }, + { + "name": "index_extendedBoluses_pumpId", + "unique": false, + "columnNames": [ + "pumpId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_extendedBoluses_pumpId` ON `${TABLE_NAME}` (`pumpId`)" + }, + { + "name": "index_extendedBoluses_pumpType", + "unique": false, + "columnNames": [ + "pumpType" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_extendedBoluses_pumpType` ON `${TABLE_NAME}` (`pumpType`)" + }, + { + "name": "index_extendedBoluses_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_extendedBoluses_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_extendedBoluses_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_extendedBoluses_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "extendedBoluses", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "glucoseValues", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `raw` REAL, `value` REAL NOT NULL, `trendArrow` TEXT NOT NULL, `noise` REAL, `sourceSensor` TEXT NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `glucoseValues`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "raw", + "columnName": "raw", + "affinity": "REAL", + "notNull": false + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "trendArrow", + "columnName": "trendArrow", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "noise", + "columnName": "noise", + "affinity": "REAL", + "notNull": false + }, + { + "fieldPath": "sourceSensor", + "columnName": "sourceSensor", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_glucoseValues_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_glucoseValues_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_glucoseValues_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_glucoseValues_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + }, + { + "name": "index_glucoseValues_sourceSensor", + "unique": false, + "columnNames": [ + "sourceSensor" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_glucoseValues_sourceSensor` ON `${TABLE_NAME}` (`sourceSensor`)" + }, + { + "name": "index_glucoseValues_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_glucoseValues_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_glucoseValues_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_glucoseValues_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "glucoseValues", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "profileSwitches", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `basalBlocks` TEXT NOT NULL, `isfBlocks` TEXT NOT NULL, `icBlocks` TEXT NOT NULL, `targetBlocks` TEXT NOT NULL, `glucoseUnit` TEXT NOT NULL, `profileName` TEXT NOT NULL, `timeshift` INTEGER NOT NULL, `percentage` INTEGER NOT NULL, `duration` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, `insulinLabel` TEXT NOT NULL, `insulinEndTime` INTEGER NOT NULL, `peak` INTEGER NOT NULL, FOREIGN KEY(`referenceId`) REFERENCES `profileSwitches`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "basalBlocks", + "columnName": "basalBlocks", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isfBlocks", + "columnName": "isfBlocks", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "icBlocks", + "columnName": "icBlocks", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "targetBlocks", + "columnName": "targetBlocks", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "glucoseUnit", + "columnName": "glucoseUnit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "profileName", + "columnName": "profileName", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "timeshift", + "columnName": "timeshift", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "percentage", + "columnName": "percentage", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "insulinConfiguration.insulinLabel", + "columnName": "insulinLabel", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "insulinConfiguration.insulinEndTime", + "columnName": "insulinEndTime", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "insulinConfiguration.peak", + "columnName": "peak", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_profileSwitches_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_profileSwitches_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_profileSwitches_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_profileSwitches_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + }, + { + "name": "index_profileSwitches_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_profileSwitches_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_profileSwitches_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_profileSwitches_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_profileSwitches_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_profileSwitches_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + } + ], + "foreignKeys": [ + { + "table": "profileSwitches", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "temporaryBasals", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `type` TEXT NOT NULL, `isAbsolute` INTEGER NOT NULL, `rate` REAL NOT NULL, `duration` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `temporaryBasals`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "isAbsolute", + "columnName": "isAbsolute", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "rate", + "columnName": "rate", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_temporaryBasals_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_temporaryBasals_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_temporaryBasals_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + }, + { + "name": "index_temporaryBasals_pumpType", + "unique": false, + "columnNames": [ + "pumpType" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_pumpType` ON `${TABLE_NAME}` (`pumpType`)" + }, + { + "name": "index_temporaryBasals_endId", + "unique": false, + "columnNames": [ + "endId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_endId` ON `${TABLE_NAME}` (`endId`)" + }, + { + "name": "index_temporaryBasals_pumpSerial", + "unique": false, + "columnNames": [ + "pumpSerial" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_pumpSerial` ON `${TABLE_NAME}` (`pumpSerial`)" + }, + { + "name": "index_temporaryBasals_temporaryId", + "unique": false, + "columnNames": [ + "temporaryId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_temporaryId` ON `${TABLE_NAME}` (`temporaryId`)" + }, + { + "name": "index_temporaryBasals_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_temporaryBasals_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryBasals_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "temporaryBasals", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "temporaryTargets", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `reason` TEXT NOT NULL, `highTarget` REAL NOT NULL, `lowTarget` REAL NOT NULL, `duration` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `temporaryTargets`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "reason", + "columnName": "reason", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "highTarget", + "columnName": "highTarget", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "lowTarget", + "columnName": "lowTarget", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_temporaryTargets_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryTargets_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_temporaryTargets_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryTargets_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_temporaryTargets_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryTargets_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + }, + { + "name": "index_temporaryTargets_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryTargets_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_temporaryTargets_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_temporaryTargets_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "temporaryTargets", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "therapyEvents", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `duration` INTEGER NOT NULL, `type` TEXT NOT NULL, `note` TEXT, `enteredBy` TEXT, `glucose` REAL, `glucoseType` TEXT, `glucoseUnit` TEXT NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `therapyEvents`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "note", + "columnName": "note", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "enteredBy", + "columnName": "enteredBy", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "glucose", + "columnName": "glucose", + "affinity": "REAL", + "notNull": false + }, + { + "fieldPath": "glucoseType", + "columnName": "glucoseType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "glucoseUnit", + "columnName": "glucoseUnit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_therapyEvents_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_therapyEvents_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_therapyEvents_type", + "unique": false, + "columnNames": [ + "type" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_therapyEvents_type` ON `${TABLE_NAME}` (`type`)" + }, + { + "name": "index_therapyEvents_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_therapyEvents_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + }, + { + "name": "index_therapyEvents_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_therapyEvents_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_therapyEvents_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_therapyEvents_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_therapyEvents_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_therapyEvents_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "therapyEvents", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "totalDailyDoses", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `basalAmount` REAL NOT NULL, `bolusAmount` REAL NOT NULL, `totalAmount` REAL NOT NULL, `carbs` REAL NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `totalDailyDoses`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "basalAmount", + "columnName": "basalAmount", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "bolusAmount", + "columnName": "bolusAmount", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "totalAmount", + "columnName": "totalAmount", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "carbs", + "columnName": "carbs", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_totalDailyDoses_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_totalDailyDoses_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_totalDailyDoses_pumpId", + "unique": false, + "columnNames": [ + "pumpId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_totalDailyDoses_pumpId` ON `${TABLE_NAME}` (`pumpId`)" + }, + { + "name": "index_totalDailyDoses_pumpType", + "unique": false, + "columnNames": [ + "pumpType" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_totalDailyDoses_pumpType` ON `${TABLE_NAME}` (`pumpType`)" + }, + { + "name": "index_totalDailyDoses_pumpSerial", + "unique": false, + "columnNames": [ + "pumpSerial" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_totalDailyDoses_pumpSerial` ON `${TABLE_NAME}` (`pumpSerial`)" + }, + { + "name": "index_totalDailyDoses_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_totalDailyDoses_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_totalDailyDoses_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_totalDailyDoses_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_totalDailyDoses_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_totalDailyDoses_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "totalDailyDoses", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "apsResultLinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `apsResultId` INTEGER NOT NULL, `smbId` INTEGER, `tbrId` INTEGER, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`apsResultId`) REFERENCES `apsResults`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(`smbId`) REFERENCES `boluses`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(`tbrId`) REFERENCES `temporaryBasals`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(`referenceId`) REFERENCES `apsResultLinks`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "apsResultId", + "columnName": "apsResultId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "smbId", + "columnName": "smbId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "tbrId", + "columnName": "tbrId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_apsResultLinks_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_apsResultLinks_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_apsResultLinks_apsResultId", + "unique": false, + "columnNames": [ + "apsResultId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_apsResultLinks_apsResultId` ON `${TABLE_NAME}` (`apsResultId`)" + }, + { + "name": "index_apsResultLinks_smbId", + "unique": false, + "columnNames": [ + "smbId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_apsResultLinks_smbId` ON `${TABLE_NAME}` (`smbId`)" + }, + { + "name": "index_apsResultLinks_tbrId", + "unique": false, + "columnNames": [ + "tbrId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_apsResultLinks_tbrId` ON `${TABLE_NAME}` (`tbrId`)" + } + ], + "foreignKeys": [ + { + "table": "apsResults", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "apsResultId" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "boluses", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "smbId" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "temporaryBasals", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "tbrId" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "apsResultLinks", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "multiwaveBolusLinks", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `bolusId` INTEGER NOT NULL, `extendedBolusId` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`bolusId`) REFERENCES `boluses`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(`extendedBolusId`) REFERENCES `extendedBoluses`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(`referenceId`) REFERENCES `multiwaveBolusLinks`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "bolusId", + "columnName": "bolusId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "extendedBolusId", + "columnName": "extendedBolusId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_multiwaveBolusLinks_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_multiwaveBolusLinks_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_multiwaveBolusLinks_bolusId", + "unique": false, + "columnNames": [ + "bolusId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_multiwaveBolusLinks_bolusId` ON `${TABLE_NAME}` (`bolusId`)" + }, + { + "name": "index_multiwaveBolusLinks_extendedBolusId", + "unique": false, + "columnNames": [ + "extendedBolusId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_multiwaveBolusLinks_extendedBolusId` ON `${TABLE_NAME}` (`extendedBolusId`)" + } + ], + "foreignKeys": [ + { + "table": "boluses", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "bolusId" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "extendedBoluses", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "extendedBolusId" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "multiwaveBolusLinks", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "preferenceChanges", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `key` TEXT NOT NULL, `value` TEXT)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "key", + "columnName": "key", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "value", + "columnName": "value", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "versionChanges", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `versionCode` INTEGER NOT NULL, `versionName` TEXT NOT NULL, `gitRemote` TEXT, `commitHash` TEXT)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "versionCode", + "columnName": "versionCode", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "versionName", + "columnName": "versionName", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "gitRemote", + "columnName": "gitRemote", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "commitHash", + "columnName": "commitHash", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "userEntry", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `action` TEXT NOT NULL, `source` TEXT NOT NULL, `note` TEXT NOT NULL, `values` TEXT NOT NULL)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "action", + "columnName": "action", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "source", + "columnName": "source", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "note", + "columnName": "note", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "values", + "columnName": "values", + "affinity": "TEXT", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_userEntry_source", + "unique": false, + "columnNames": [ + "source" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_userEntry_source` ON `${TABLE_NAME}` (`source`)" + }, + { + "name": "index_userEntry_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_userEntry_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "foods", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `name` TEXT NOT NULL, `category` TEXT, `subCategory` TEXT, `portion` REAL NOT NULL, `carbs` INTEGER NOT NULL, `fat` INTEGER, `protein` INTEGER, `energy` INTEGER, `unit` TEXT NOT NULL, `gi` INTEGER, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `foods`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "subCategory", + "columnName": "subCategory", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "portion", + "columnName": "portion", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "carbs", + "columnName": "carbs", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "fat", + "columnName": "fat", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "protein", + "columnName": "protein", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "energy", + "columnName": "energy", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "unit", + "columnName": "unit", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "gi", + "columnName": "gi", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_foods_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_foods_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_foods_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_foods_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + }, + { + "name": "index_foods_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_foods_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_foods_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_foods_isValid` ON `${TABLE_NAME}` (`isValid`)" + } + ], + "foreignKeys": [ + { + "table": "foods", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "deviceStatus", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `device` TEXT, `pump` TEXT, `enacted` TEXT, `suggested` TEXT, `iob` TEXT, `uploaderBattery` INTEGER NOT NULL, `configuration` TEXT, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "device", + "columnName": "device", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "pump", + "columnName": "pump", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "enacted", + "columnName": "enacted", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "suggested", + "columnName": "suggested", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "iob", + "columnName": "iob", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "uploaderBattery", + "columnName": "uploaderBattery", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "configuration", + "columnName": "configuration", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_deviceStatus_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_deviceStatus_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_deviceStatus_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_deviceStatus_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + }, + { + "name": "index_deviceStatus_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_deviceStatus_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "offlineEvents", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `version` INTEGER NOT NULL, `dateCreated` INTEGER NOT NULL, `isValid` INTEGER NOT NULL, `referenceId` INTEGER, `timestamp` INTEGER NOT NULL, `utcOffset` INTEGER NOT NULL, `reason` TEXT NOT NULL, `duration` INTEGER NOT NULL, `nightscoutSystemId` TEXT, `nightscoutId` TEXT, `pumpType` TEXT, `pumpSerial` TEXT, `temporaryId` INTEGER, `pumpId` INTEGER, `startId` INTEGER, `endId` INTEGER, FOREIGN KEY(`referenceId`) REFERENCES `offlineEvents`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "dateCreated", + "columnName": "dateCreated", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isValid", + "columnName": "isValid", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "referenceId", + "columnName": "referenceId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "timestamp", + "columnName": "timestamp", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "utcOffset", + "columnName": "utcOffset", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "reason", + "columnName": "reason", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "duration", + "columnName": "duration", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutSystemId", + "columnName": "nightscoutSystemId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.nightscoutId", + "columnName": "nightscoutId", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpType", + "columnName": "pumpType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpSerial", + "columnName": "pumpSerial", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.temporaryId", + "columnName": "temporaryId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.pumpId", + "columnName": "pumpId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.startId", + "columnName": "startId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "interfaceIDs_backing.endId", + "columnName": "endId", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_offlineEvents_id", + "unique": false, + "columnNames": [ + "id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_offlineEvents_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_offlineEvents_isValid", + "unique": false, + "columnNames": [ + "isValid" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_offlineEvents_isValid` ON `${TABLE_NAME}` (`isValid`)" + }, + { + "name": "index_offlineEvents_nightscoutId", + "unique": false, + "columnNames": [ + "nightscoutId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_offlineEvents_nightscoutId` ON `${TABLE_NAME}` (`nightscoutId`)" + }, + { + "name": "index_offlineEvents_referenceId", + "unique": false, + "columnNames": [ + "referenceId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_offlineEvents_referenceId` ON `${TABLE_NAME}` (`referenceId`)" + }, + { + "name": "index_offlineEvents_timestamp", + "unique": false, + "columnNames": [ + "timestamp" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_offlineEvents_timestamp` ON `${TABLE_NAME}` (`timestamp`)" + } + ], + "foreignKeys": [ + { + "table": "offlineEvents", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "referenceId" + ], + "referencedColumns": [ + "id" + ] + } + ] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '09121464fb795b3c37bb1c2c2c3ea481')" + ] + } +} \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 462e3c3115..fc34dcd06f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -19,9 +19,9 @@ import info.nightscout.database.impl.transactions.SyncPumpExtendedBolusTransacti import info.nightscout.database.impl.transactions.SyncPumpTemporaryBasalTransaction import info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransaction import info.nightscout.database.impl.transactions.SyncTemporaryBasalWithTempIdTransaction -import info.nightscout.androidaps.extensions.fromDbPumpType -import info.nightscout.androidaps.extensions.toDbPumpType -import info.nightscout.androidaps.extensions.toDbSource +import info.nightscout.core.pumpExtensions.fromDbPumpType +import info.nightscout.core.pumpExtensions.toDbPumpType +import info.nightscout.core.pumpExtensions.toDbSource import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync diff --git a/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt index 7e3f67e63b..2b00ecaa18 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/DetailedBolusInfo.kt @@ -76,14 +76,14 @@ class DetailedBolusInfo { fun toDBbEventType(): TherapyEvent.Type = when (this) { - MEAL_BOLUS -> TherapyEvent.Type.MEAL_BOLUS - BOLUS_WIZARD -> TherapyEvent.Type.BOLUS_WIZARD - CORRECTION_BOLUS -> TherapyEvent.Type.CORRECTION_BOLUS - CARBS_CORRECTION -> TherapyEvent.Type.CARBS_CORRECTION - CANNULA_CHANGE -> TherapyEvent.Type.CANNULA_CHANGE - INSULIN_CHANGE -> TherapyEvent.Type.INSULIN_CHANGE + MEAL_BOLUS -> TherapyEvent.Type.MEAL_BOLUS + BOLUS_WIZARD -> TherapyEvent.Type.BOLUS_WIZARD + CORRECTION_BOLUS -> TherapyEvent.Type.CORRECTION_BOLUS + CARBS_CORRECTION -> TherapyEvent.Type.CARBS_CORRECTION + CANNULA_CHANGE -> TherapyEvent.Type.CANNULA_CHANGE + INSULIN_CHANGE -> TherapyEvent.Type.INSULIN_CHANGE PUMP_BATTERY_CHANGE -> TherapyEvent.Type.PUMP_BATTERY_CHANGE - NOTE -> TherapyEvent.Type.NOTE + NOTE -> TherapyEvent.Type.NOTE } } @@ -142,7 +142,4 @@ class DetailedBolusInfo { n.carbsTimestamp = carbsTimestamp return n } - - companion object { - } } \ No newline at end of file diff --git a/interfaces/src/main/res/values-night/colors.xml b/interfaces/src/main/res/values-night/colors.xml new file mode 100644 index 0000000000..8190c564c2 --- /dev/null +++ b/interfaces/src/main/res/values-night/colors.xml @@ -0,0 +1,17 @@ + + + + + #77dd77 + #FF8C00 + #FF5555 + + + #666666 + #000000 + #77dd77 + #ff0400 + #FF8C00 + #03A9F4 + + diff --git a/interfaces/src/main/res/values/colors.xml b/interfaces/src/main/res/values/colors.xml index 6a01b0f440..3f06959c5b 100644 --- a/interfaces/src/main/res/values/colors.xml +++ b/interfaces/src/main/res/values/colors.xml @@ -5,4 +5,12 @@ #FF8C00 #FF5555 + + #666666 + #000000 + #77dd77 + #ff0400 + #FF8C00 + #03A9F4 +
\ No newline at end of file diff --git a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt index c70ea97120..c2e1c933fb 100644 --- a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt +++ b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt @@ -1,23 +1,21 @@ package info.nightscout.androidaps.plugins.pump.combo -import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.combo.R import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.RuffyScripter import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.PluginType 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 @@ -28,15 +26,13 @@ class ComboPluginTest : TestBase() { @Mock lateinit var rh: ResourceHelper @Mock lateinit var profileFunction: ProfileFunction - @Mock lateinit var activePlugin: ActivePlugin @Mock lateinit var commandQueue: CommandQueue @Mock lateinit var pumpSync: PumpSync @Mock lateinit var sp: SP - @Mock lateinit var context: Context @Mock lateinit var dateUtil: DateUtil @Mock lateinit var ruffyScripter: RuffyScripter - val injector = HasAndroidInjector { + private val injector = HasAndroidInjector { AndroidInjector { if (it is PumpEnactResultImpl) { it.rh = rh @@ -50,7 +46,7 @@ class ComboPluginTest : TestBase() { fun prepareMocks() { `when`(rh.gs(R.string.novalidbasalrate)).thenReturn("No valid basal rate read from pump") `when`(rh.gs(R.string.combo_pump_unsupported_operation)).thenReturn("Requested operation not supported by pump") - comboPlugin = ComboPlugin(injector, aapsLogger, RxBus(aapsSchedulers, aapsLogger), rh, profileFunction, sp, commandQueue, context, pumpSync, dateUtil, ruffyScripter) + comboPlugin = ComboPlugin(injector, aapsLogger, RxBus(aapsSchedulers, aapsLogger), rh, profileFunction, sp, commandQueue, pumpSync, dateUtil, ruffyScripter) } @Test diff --git a/pump/medtronic/build.gradle b/pump/medtronic/build.gradle index 7df54d4cfb..c651f67256 100644 --- a/pump/medtronic/build.gradle +++ b/pump/medtronic/build.gradle @@ -25,4 +25,5 @@ dependencies { implementation project(':pump:rileylink') implementation project(':interfaces') implementation project(path: ':core:fabric') + testImplementation project(path: ':database:impl') } diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt index 1e624a3cbc..c000c7d138 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/plugins/pump/medtronic/comm/MedtronicHistoryDataUTest.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.data.dto.TempBasalProce import info.nightscout.androidaps.plugins.pump.medtronic.defs.MedtronicDeviceType import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil -import info.nightscout.androidaps.utils.serialisation.SealedClassHelper.gson +import info.nightscout.database.impl.serialisation.SealedClassHelper import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.TestAapsSchedulers import info.nightscout.rx.bus.RxBus @@ -139,7 +139,7 @@ class MedtronicHistoryDataUTest : TestBase() { println("PumpHistoryEntries: getFilteredItems: " + tbrs.size) - println("PumpHistoryEntries: getRewindItems: $rewindRecords.size : " + gson.toJson(rewindRecords)) + println("PumpHistoryEntries: getRewindItems: $rewindRecords.size : " + SealedClassHelper.gson.toJson(rewindRecords)) val processList: MutableList = medtronicHistoryData.createTBRProcessList(tbrs) From 61b0dba46576afb3b05bc09588981b9b330edcce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:33:43 +0000 Subject: [PATCH 29/42] chore(deps): bump material from 1.6.1 to 1.7.0 Bumps [material](https://github.com/material-components/material-components-android) from 1.6.1 to 1.7.0. - [Release notes](https://github.com/material-components/material-components-android/releases) - [Commits](https://github.com/material-components/material-components-android/compare/1.6.1...1.7.0) --- updated-dependencies: - dependency-name: com.google.android.material:material dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 870fdd0d11..50f9b2eac8 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { gson_version = '2.10' nav_version = '2.4.2' appcompat_version = '1.5.1' - material_version = '1.6.1' + material_version = '1.7.0' constraintlayout_version = '2.1.4' preferencektx_version = '1.2.0' commonslang3_version = '3.12.0' From a57907a236aa423ae886df35a98664300bdf8f60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:16:10 +0000 Subject: [PATCH 30/42] chore(deps): bump nav_version from 2.4.2 to 2.5.3 Bumps `nav_version` from 2.4.2 to 2.5.3. Updates `navigation-fragment-ktx` from 2.4.2 to 2.5.3 Updates `navigation-runtime-ktx` from 2.4.2 to 2.5.3 Updates `navigation-ui-ktx` from 2.4.2 to 2.5.3 --- updated-dependencies: - dependency-name: androidx.navigation:navigation-fragment-ktx dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: androidx.navigation:navigation-runtime-ktx dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: androidx.navigation:navigation-ui-ktx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ff1e084228..1046468f87 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ buildscript { fragmentktx_version = '1.4.1' ormLite_version = '4.46' gson_version = '2.10' - nav_version = '2.4.2' + nav_version = '2.5.3' appcompat_version = '1.5.1' material_version = '1.7.0' constraintlayout_version = '2.1.4' From 6161a0e5a27152e099b12fdd54269707293377be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:16:39 +0000 Subject: [PATCH 31/42] chore(deps): bump okhttp3_version from 4.9.0 to 4.10.0 Bumps `okhttp3_version` from 4.9.0 to 4.10.0. Updates `okhttp` from 4.9.0 to 4.10.0 - [Release notes](https://github.com/square/okhttp/releases) - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.9.0...parent-4.10.0) Updates `logging-interceptor` from 4.9.0 to 4.10.0 - [Release notes](https://github.com/square/okhttp/releases) - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.9.0...parent-4.10.0) --- updated-dependencies: - dependency-name: com.squareup.okhttp3:okhttp dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.squareup.okhttp3:logging-interceptor dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ff1e084228..fab4002701 100644 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ buildscript { mockito_version = '4.4.0' dexmaker_version = '1.2' retrofit2_version = '2.9.0' - okhttp3_version = '4.9.0' + okhttp3_version = '4.10.0' byteBuddy_version = '1.12.8' androidx_junit_version = '1.1.3' From ed973aaefb094b5e016d055be77774bca5f75b86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:17:13 +0000 Subject: [PATCH 32/42] chore(deps): bump tink-android from 1.5.0 to 1.7.0 Bumps [tink-android](https://github.com/google/tink) from 1.5.0 to 1.7.0. - [Release notes](https://github.com/google/tink/releases) - [Commits](https://github.com/google/tink/compare/v1.5.0...v1.7.0) --- updated-dependencies: - dependency-name: com.google.crypto.tink:tink-android dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ff1e084228..38d787a667 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ buildscript { commonscodec_version = '1.15' jodatime_version = '2.10.14' work_version = '2.7.1' - tink_version = '1.5.0' + tink_version = '1.7.0' json_version = '20220320' serialization_version = '1.4.1' joda_version = '2.12.1' From 29ecb1444911206e035f56bd5170aff1c569abed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:17:43 +0000 Subject: [PATCH 33/42] chore(deps): bump fragment-ktx from 1.4.1 to 1.5.4 Bumps fragment-ktx from 1.4.1 to 1.5.4. --- updated-dependencies: - dependency-name: androidx.fragment:fragment-ktx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ff1e084228..803dd635aa 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ buildscript { dagger_version = '2.44' coroutines_version = '1.6.4' activity_version = '1.4.0' - fragmentktx_version = '1.4.1' + fragmentktx_version = '1.5.4' ormLite_version = '4.46' gson_version = '2.10' nav_version = '2.4.2' From 85f85e388f7935f4fb6fe6155d3f0f5226f129a1 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 14:01:14 +0100 Subject: [PATCH 34/42] move to interfaces --- .../nightscout/androidaps/MainActivity.kt | 6 +-- .../info/nightscout/androidaps/MainApp.kt | 8 ++-- .../activities/MyPreferenceFragment.kt | 2 +- .../activities/SingleFragmentActivity.kt | 4 +- .../nightscout/androidaps/di/AppModule.kt | 14 +++---- .../androidaps/di/PluginsListModule.kt | 2 +- .../androidaps/dialogs/ExtendedBolusDialog.kt | 4 +- .../androidaps/dialogs/FillDialog.kt | 10 ++--- .../androidaps/dialogs/InsulinDialog.kt | 4 +- .../androidaps/dialogs/LoopDialog.kt | 14 +++---- .../androidaps/dialogs/TempBasalDialog.kt | 4 +- .../androidaps/dialogs/TreatmentDialog.kt | 4 +- .../androidaps/dialogs/WizardDialog.kt | 6 +-- .../implementations/ActivityNamesImpl.kt | 2 +- .../plugins/aps/loop/LoopFragment.kt | 2 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 20 +++++----- .../openAPSAMA/DetermineBasalAdapterAMAJS.kt | 6 +-- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 12 +++--- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 6 +-- .../aps/openAPSSMB/DetermineBasalResultSMB.kt | 2 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 16 ++++---- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 12 +++--- .../configBuilder/ConfigBuilderFragment.kt | 4 +- .../configBuilder/ConfigBuilderPlugin.kt | 8 ++-- .../plugins/configBuilder/PluginStore.kt | 12 +++--- .../objectives/ObjectivesPlugin.kt | 8 ++-- .../objectives/objectives/Objective0.kt | 6 +-- .../objectives/objectives/Objective5.kt | 2 +- .../constraints/safety/SafetyPlugin.kt | 22 +++++----- .../general/actions/ActionsFragment.kt | 6 +-- .../plugins/general/actions/ActionsPlugin.kt | 8 ++-- .../dataBroadcaster/DataBroadcastPlugin.kt | 6 +-- .../maintenance/ImportExportPrefsImpl.kt | 20 +++++----- .../maintenance/MaintenanceFragment.kt | 4 +- .../general/maintenance/MaintenancePlugin.kt | 6 +-- .../general/overview/OverviewFragment.kt | 6 +-- .../general/overview/OverviewPlugin.kt | 6 +-- .../PersistentNotificationPlugin.kt | 8 ++-- .../plugins/general/wear/WearPlugin.kt | 6 +-- .../wear/wearintegration/DataHandlerMobile.kt | 14 +++---- .../IobCobCalculatorPlugin.kt | 12 +++--- .../sensitivity/AbstractSensitivityPlugin.kt | 6 +-- .../sensitivity/SensitivityAAPSPlugin.kt | 6 +-- .../sensitivity/SensitivityOref1Plugin.kt | 6 +-- .../SensitivityWeightedAveragePlugin.kt | 6 +-- .../androidaps/plugins/source/AidexPlugin.kt | 10 ++--- .../androidaps/plugins/source/DexcomPlugin.kt | 12 +++--- .../plugins/source/EversensePlugin.kt | 12 +++--- .../androidaps/plugins/source/GlimpPlugin.kt | 10 ++--- .../plugins/source/GlunovoPlugin.kt | 10 ++--- .../plugins/source/IntelligoPlugin.kt | 10 ++--- .../androidaps/plugins/source/MM640gPlugin.kt | 10 ++--- .../plugins/source/PoctechPlugin.kt | 10 ++--- .../plugins/source/RandomBgPlugin.kt | 10 ++--- .../androidaps/plugins/source/TomatoPlugin.kt | 10 ++--- .../androidaps/plugins/source/XdripPlugin.kt | 10 ++--- .../androidaps/receivers/KeepAliveWorker.kt | 4 +- .../androidaps/setupwizard/SWDefinition.kt | 6 +-- .../setupwizard/elements/SWPlugin.kt | 4 +- .../alertDialogs/PrefImportSummaryDialog.kt | 8 ++-- .../NotificationHolderImpl.kt | 2 +- .../resources/IconsProviderImplementation.kt | 2 +- .../androidaps/utils/tabs/TabPageAdapter.kt | 5 +-- .../androidaps/utils/wizard/BolusWizard.kt | 12 +++--- .../utils/wizard/QuickWizardEntry.kt | 6 +-- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +-- .../interfaces/ConstraintsCheckerTest.kt | 6 +-- .../plugins/aps/loop/LoopPluginTest.kt | 6 +-- .../objectives/ObjectivesPluginTest.kt | 8 ++-- .../constraints/safety/SafetyPluginTest.kt | 6 +-- .../AbstractSensitivityPluginTest.kt | 4 +- .../utils/wizard/BolusWizardTest.kt | 6 +-- .../nightscout/automation/AutomationPlugin.kt | 6 +-- .../automation/actions/ActionLoopDisable.kt | 4 +- .../automation/actions/ActionLoopEnable.kt | 4 +- .../automation/actions/ActionRunAutotune.kt | 9 ++--- .../automation/actions/ActionSendSMS.kt | 6 +-- .../nightscout/androidaps/TestPumpPlugin.kt | 12 +++--- .../actions/ActionLoopDisableTest.kt | 4 +- .../actions/ActionLoopEnableTest.kt | 4 +- .../automation/actions/ActionsTestBase.kt | 8 ++-- .../automation/triggers/TriggerTestBase.kt | 2 +- .../DaggerAppCompatActivityWithResult.kt | 6 +-- .../androidaps/data/LocalInsulin.kt | 2 +- .../androidaps/data/PumpEnactResultImpl.kt | 6 +-- .../androidaps/extensions/BolusExtension.kt | 2 +- .../androidaps/interfaces/ActivePlugin.kt | 11 +++-- .../androidaps/interfaces/Constraints.kt | 2 +- .../DetermineBasalAdapterInterface.kt | 2 +- .../androidaps/interfaces/Insulin.kt | 2 +- .../androidaps/interfaces/IobCobCalculator.kt | 2 +- .../nightscout/androidaps/interfaces/Loop.kt | 4 +- .../nightscout/androidaps/interfaces/Pump.kt | 8 ++-- .../androidaps/interfaces/PumpPluginBase.kt | 6 +-- .../androidaps/plugins/aps/loop/APSResult.kt | 2 +- .../maintenance/PrefFileListProvider.kt | 14 +++---- .../general/maintenance/PrefsFileContract.kt | 2 +- .../activities/PrefImportListActivity.kt | 10 ++--- .../formats/EncryptedPrefsFormat.kt | 26 ++++++------ .../EventDismissBolusProgressIfRunning.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +-- .../androidaps/data/ConstraintTest.kt | 2 +- .../nightscout/androidaps/data/IobTest.kt | 2 +- .../androidaps/data/MealDataTest.kt | 2 +- .../androidaps/data/PumpEnactResultTest.kt | 2 +- .../interfaces/PluginDescriptionTest.kt | 4 +- .../plugins/aps/loop/APSResultTest.kt | 2 +- .../formats/EncryptedPrefsFormatTest.kt | 13 +++--- .../implementation/AndroidPermissionImpl.kt | 4 +- .../implementation/LocalAlertUtilsImpl.kt | 8 ++-- .../constraints/ConstraintsImpl.kt | 2 +- .../pump/PumpSyncImplementation.kt | 40 +++++++++---------- .../queue/CommandQueueImplementation.kt | 14 +++---- .../CommandInsightSetTBROverNotification.kt | 4 +- .../queue/commands/CommandLoadEvents.kt | 7 ++-- .../queue/commands/CommandLoadHistory.kt | 7 ++-- .../queue/commands/CommandSMBBolus.kt | 11 +++-- .../queue/commands/CommandSetProfile.kt | 13 +++--- .../queue/commands/CommandSetUserSettings.kt | 7 ++-- .../queue/commands/CommandStartPump.kt | 4 +- .../queue/commands/CommandStopPump.kt | 4 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +-- .../queue/CommandQueueImplementationTest.kt | 10 ++--- .../implementation/queue/QueueThreadTest.kt | 14 +++---- .../pump/insight/LocalInsightPlugin.java | 28 ++++++------- .../interfaces/AndroidPermission.kt | 1 + .../nightscout/interfaces/ConfigBuilder.kt | 3 ++ .../java/info/nightscout/interfaces/Safety.kt | 3 -- .../{ => aps}/VariableSensitivityResult.kt | 2 +- .../interfaces/{ => autotune}/Autotune.kt | 2 +- .../{ => constraints}/Constraint.kt | 2 +- .../interfaces/constraints/Safety.kt | 5 +++ .../interfaces/{data => iob}/Iob.kt | 2 +- .../interfaces/{data => iob}/MealData.kt | 2 +- .../{ => maintenance}/ImportExportPrefs.kt | 3 +- .../{data => }/maintenance/PrefsFile.kt | 2 +- .../{data => }/maintenance/PrefsFormat.kt | 4 +- .../{data => }/maintenance/PrefsImportDir.kt | 2 +- .../interfaces/{ => plugin}/PluginBase.kt | 2 +- .../{ => plugin}/PluginDescription.kt | 2 +- .../interfaces/{ => plugin}/PluginFragment.kt | 2 +- .../interfaces/{ => plugin}/PluginType.kt | 2 +- .../nightscout/interfaces/{ => pump}/Dana.kt | 4 +- .../interfaces/{ => pump}/Diaconn.kt | 4 +- .../interfaces/{ => pump}/Insight.kt | 4 +- .../{data => pump}/PumpEnactResult.kt | 2 +- .../interfaces/{ => pump}/VirtualPump.kt | 2 +- .../nightscout/interfaces/queue/Callback.kt | 2 +- .../{data => }/smsCommunicator/Sms.kt | 2 +- .../{ => smsCommunicator}/SmsCommunicator.kt | 4 +- .../interfaces/{ => sync}/NsClient.kt | 2 +- .../nightscout/interfaces/{ => sync}/Sync.kt | 2 +- .../interfaces/{ => ui}/ActivityNames.kt | 4 +- .../interfaces/{ => ui}/IconsProvider.kt | 2 +- .../general/openhumans/OpenHumansUploader.kt | 9 +++-- .../configBuilder/RunningConfiguration.kt | 10 ++--- .../bgQualityCheck/BgQualityCheckPlugin.kt | 8 ++-- .../constraints/dstHelper/DstHelperPlugin.kt | 13 +++--- .../phoneChecker/PhoneCheckerPlugin.kt | 8 ++-- .../SignatureVerifierPlugin.kt | 10 ++--- .../storage/StorageConstraintPlugin.kt | 12 +++--- .../versionChecker/VersionCheckerPlugin.kt | 14 +++---- .../general/autotune/AutotunePlugin.kt | 8 ++-- .../plugins/general/food/FoodFragment.kt | 6 +-- .../plugins/general/food/FoodPlugin.kt | 10 ++--- .../notifications/NotificationStore.kt | 2 +- .../general/smsCommunicator/AuthRequest.kt | 12 +++--- .../SmsCommunicatorFragment.kt | 4 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 24 +++++------ .../activities/SmsCommunicatorOtpActivity.kt | 2 +- .../general/themes/ThemeSwitcherPlugin.kt | 8 ++-- .../xdripStatusline/StatusLinePlugin.kt | 6 +-- .../plugins/insulin/InsulinOrefBasePlugin.kt | 8 ++-- .../plugins/profile/ProfileFragment.kt | 2 +- .../plugins/profile/ProfilePlugin.kt | 20 +++++----- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 10 ++--- .../plugins/source/BGSourceFragment.kt | 6 +-- .../plugins/source/NSClientSourcePlugin.kt | 10 ++--- .../plugins/sync/nsShared/NSClientFragment.kt | 6 +-- .../plugins/sync/nsShared/StoreDataForDb.kt | 28 ++++++------- .../nsShared/events/EventNSClientNewLog.kt | 2 +- .../nsShared/events/EventNSClientStatus.kt | 2 +- .../plugins/sync/nsclient/NSClientPlugin.kt | 10 ++--- .../nsclient/data/NSDeviceStatusHandler.kt | 2 +- .../sync/nsclient/services/NSClientService.kt | 4 +- .../nsclient/workers/NSClientAddAckWorker.kt | 30 +++++++------- .../workers/NSClientAddUpdateWorker.kt | 4 +- .../workers/NSClientUpdateRemoveAckWorker.kt | 4 +- .../sync/nsclientV3/NSClientV3Plugin.kt | 10 ++--- .../sync/nsclientV3/workers/LoadBgWorker.kt | 2 +- .../workers/LoadDeviceStatusWorker.kt | 2 +- .../workers/LoadTreatmentsWorker.kt | 2 +- .../plugins/sync/tidepool/TidepoolPlugin.kt | 8 ++-- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +-- .../BgQualityCheckPluginTest.kt | 2 +- .../storage/StorageConstraintPluginTest.kt | 4 +- .../smsCommunicator/AuthRequestTest.kt | 10 ++--- .../SmsCommunicatorPluginTest.kt | 16 ++++---- .../general/smsCommunicator/SmsTest.kt | 2 +- .../plugins/pump/combo/ComboPlugin.java | 10 ++--- .../plugins/pump/combo/ComboPluginTest.kt | 4 +- .../androidaps/dana/DanaFragment.kt | 4 +- .../activities/DanaUserOptionsActivity.kt | 2 +- .../danaRKorean/DanaRKoreanPlugin.kt | 6 +-- .../comm/MsgInitConnStatusTime_k.kt | 2 +- .../services/DanaRKoreanExecutionService.java | 16 ++++---- .../androidaps/danaRv2/DanaRv2Plugin.java | 6 +-- .../danaRv2/comm/MsgCheckValue_v2.kt | 2 +- .../services/DanaRv2ExecutionService.java | 16 ++++---- .../androidaps/danar/AbstractDanaRPlugin.java | 20 +++++----- .../androidaps/danar/DanaRPlugin.java | 6 +-- .../androidaps/danar/comm/MsgBolusStart.kt | 2 +- .../danar/comm/MsgBolusStartWithSpeed.kt | 2 +- .../danar/comm/MsgInitConnStatusTime.kt | 2 +- .../danar/comm/MsgSetExtendedBolusStart.kt | 2 +- .../AbstractDanaRExecutionService.java | 2 +- .../danar/services/DanaRExecutionService.java | 10 ++--- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +-- .../plugins/pump/danaR/DanaRPluginTest.kt | 8 ++-- .../pump/danaR/comm/MessageHashTableRTest.kt | 2 +- .../pump/danaR/comm/MsgBolusStartTest.kt | 2 +- .../danaR/comm/MsgBolusStartWithSpeedTest.kt | 2 +- .../comm/MsgSetExtendedBolusStartTest.kt | 2 +- .../pump/danaRKorean/DanaRKoreanPluginTest.kt | 8 ++-- .../comm/MessageHashTableRKoreanTest.kt | 2 +- .../plugins/pump/danaRv2/DanaRv2PluginTest.kt | 8 ++-- .../danaRv2/comm/MessageHashTableRv2Test.kt | 2 +- .../androidaps/danars/DanaRSPlugin.kt | 12 +++--- .../DanaRSPacketBolusSetStepBolusStart.kt | 2 +- .../danars/services/DanaRSService.kt | 4 +- .../androidaps/danars/DanaRSPluginTest.kt | 8 ++-- .../danars/comm/DanaRsMessageHashTableTest.kt | 2 +- .../DanaRsPacketBolusSetStepBolusStartTest.kt | 4 +- .../androidaps/diaconn/DiaconnG8Fragment.kt | 2 +- .../androidaps/diaconn/DiaconnG8Plugin.kt | 16 ++++---- .../DiaconnG8UserOptionsActivity.kt | 2 +- .../diaconn/service/BLECommonService.kt | 4 +- .../diaconn/service/DiaconnG8Service.kt | 4 +- .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 12 +++--- .../pump/medtronic/MedtronicPumpPlugin.kt | 14 +++---- .../common/viewmodel/ActionViewModelBase.kt | 3 +- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 14 +++---- .../dash/ui/DashPodManagementActivity.kt | 2 +- .../dash/ui/OmnipodDashOverviewFragment.kt | 2 +- .../action/DashInitializePodViewModel.kt | 5 +-- .../action/DashInsertCannulaViewModel.kt | 4 +- .../action/DashDeactivatePodViewModel.kt | 4 +- .../omnipod/eros/OmnipodErosPumpPlugin.java | 14 +++---- .../eros/manager/AapsOmnipodErosManager.java | 4 +- .../eros/ui/ErosPodManagementActivity.kt | 2 +- .../eros/ui/OmnipodErosOverviewFragment.kt | 2 +- .../action/ErosInitializePodViewModel.kt | 2 +- .../action/ErosInsertCannulaViewModel.kt | 2 +- .../action/ErosDeactivatePodViewModel.kt | 2 +- .../omnipod/eros/OmnipodErosPumpPluginTest.kt | 6 +-- .../plugins/pump/common/PumpPluginAbstract.kt | 6 +-- .../fragments/TreatmentsUserEntryFragment.kt | 4 +- .../info/nightscout/ui/dialogs/CarbsDialog.kt | 10 ++--- .../java/info/nightscout/ui/widget/Widget.kt | 4 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +-- 260 files changed, 858 insertions(+), 872 deletions(-) delete mode 100644 interfaces/src/main/java/info/nightscout/interfaces/Safety.kt rename interfaces/src/main/java/info/nightscout/interfaces/{ => aps}/VariableSensitivityResult.kt (64%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => autotune}/Autotune.kt (82%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => constraints}/Constraint.kt (98%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/constraints/Safety.kt rename interfaces/src/main/java/info/nightscout/interfaces/{data => iob}/Iob.kt (96%) rename interfaces/src/main/java/info/nightscout/interfaces/{data => iob}/MealData.kt (85%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => maintenance}/ImportExportPrefs.kt (84%) rename interfaces/src/main/java/info/nightscout/interfaces/{data => }/maintenance/PrefsFile.kt (87%) rename interfaces/src/main/java/info/nightscout/interfaces/{data => }/maintenance/PrefsFormat.kt (94%) rename interfaces/src/main/java/info/nightscout/interfaces/{data => }/maintenance/PrefsImportDir.kt (52%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => plugin}/PluginBase.kt (99%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => plugin}/PluginDescription.kt (98%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => plugin}/PluginFragment.kt (57%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => plugin}/PluginType.kt (83%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => pump}/Dana.kt (78%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => pump}/Diaconn.kt (61%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => pump}/Insight.kt (64%) rename interfaces/src/main/java/info/nightscout/interfaces/{data => pump}/PumpEnactResult.kt (97%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => pump}/VirtualPump.kt (60%) rename interfaces/src/main/java/info/nightscout/interfaces/{data => }/smsCommunicator/Sms.kt (94%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => smsCommunicator}/SmsCommunicator.kt (62%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => sync}/NsClient.kt (94%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => sync}/Sync.kt (72%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => ui}/ActivityNames.kt (96%) rename interfaces/src/main/java/info/nightscout/interfaces/{ => ui}/IconsProvider.kt (69%) diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index 7d74e8e14d..4d01447407 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -56,10 +56,10 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.interfaces.IconsProvider -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator +import info.nightscout.interfaces.ui.IconsProvider import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 758a5fedc8..5be051f1d0 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -15,9 +15,6 @@ import androidx.work.PeriodicWorkRequest import androidx.work.WorkManager import dagger.android.AndroidInjector import dagger.android.DaggerApplication -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction -import info.nightscout.database.impl.transactions.VersionChangeTransaction import info.nightscout.androidaps.db.CompatDBHelper import info.nightscout.androidaps.di.DaggerAppComponent import info.nightscout.androidaps.di.StaticInjector @@ -33,13 +30,16 @@ import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.androidaps.utils.ProcessLifecycleListener import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.database.impl.transactions.VersionChangeTransaction import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.general.overview.notifications.NotificationStore import info.nightscout.plugins.general.themes.ThemeSwitcherPlugin import info.nightscout.rx.logging.AAPSLogger 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 375a4db0d6..b50279df35 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -23,7 +23,6 @@ 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.PluginBase import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploader @@ -58,6 +57,7 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionTyp import info.nightscout.androidaps.utils.protection.ProtectionCheck.ProtectionType.NONE import info.nightscout.automation.AutomationPlugin import info.nightscout.interfaces.Config +import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.general.autotune.AutotunePlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.general.xdripStatusline.StatusLinePlugin diff --git a/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt index 29a3d92568..c3d19e1e83 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/SingleFragmentActivity.kt @@ -6,10 +6,10 @@ import android.os.Bundle import android.view.Menu import android.view.MenuItem import info.nightscout.androidaps.R -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.plugins.configBuilder.PluginStore -import info.nightscout.interfaces.locale.LocaleHelper import info.nightscout.androidaps.utils.protection.ProtectionCheck +import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.interfaces.plugin.PluginBase import javax.inject.Inject class SingleFragmentActivity : DaggerAppCompatActivityWithResult() { 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 bf2d90a912..af89d8eca5 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -7,7 +7,6 @@ import dagger.Module import dagger.Provides import dagger.android.HasAndroidInjector import info.nightscout.androidaps.MainApp -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.implementations.ActivityNamesImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue @@ -35,6 +34,7 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.androidaps.utils.buildHelper.ConfigImpl import info.nightscout.androidaps.utils.resources.IconsProviderImplementation import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.AndroidPermissionImpl import info.nightscout.implementation.BolusTimerImpl import info.nightscout.implementation.CarbTimerImpl @@ -47,22 +47,22 @@ 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.ConfigBuilder -import info.nightscout.interfaces.IconsProvider -import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.interfaces.LocalAlertUtils import info.nightscout.interfaces.NotificationHolder -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.SmsCommunicator +import info.nightscout.interfaces.autotune.Autotune +import info.nightscout.interfaces.maintenance.ImportExportPrefs +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.interfaces.storage.FileStorage import info.nightscout.interfaces.storage.Storage +import info.nightscout.interfaces.ui.ActivityNames +import info.nightscout.interfaces.ui.IconsProvider import info.nightscout.plugins.general.autotune.AutotunePlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.sync.nsclient.DataSyncSelectorImplementation 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 a879517549..7f6fb53b2e 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/PluginsListModule.kt @@ -9,7 +9,6 @@ import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.diaconn.DiaconnG8Plugin -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploader import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.aps.openAPSAMA.OpenAPSAMAPlugin @@ -45,6 +44,7 @@ import info.nightscout.androidaps.plugins.source.RandomBgPlugin import info.nightscout.androidaps.plugins.source.TomatoPlugin import info.nightscout.androidaps.plugins.source.XdripPlugin import info.nightscout.automation.AutomationPlugin +import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin import info.nightscout.plugins.constraints.dstHelper.DstHelperPlugin import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt index 45e2d14775..6625dc84fd 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt @@ -20,9 +20,9 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BO import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index 13d6b4970a..88f887a40a 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -7,9 +7,6 @@ import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner import info.nightscout.androidaps.R -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.databinding.DialogFillBinding import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin @@ -25,9 +22,12 @@ import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.Constraint +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index 4da736be18..36e10be75a 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -31,13 +31,13 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt index 73d6a1c4e1..8a28a6f4bf 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -12,9 +12,6 @@ import android.view.WindowManager import androidx.fragment.app.FragmentManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.androidaps.databinding.DialogLoopBinding import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin @@ -33,13 +30,16 @@ import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ActivityNames +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index ed6322fbc8..779eb8a0fe 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -22,10 +22,10 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BO import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index 397a10bbe0..9f92ef79db 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -26,11 +26,11 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index f0af37c084..ec8f92fc63 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -20,8 +20,6 @@ import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.databinding.DialogWizardBinding import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.valueToUnits @@ -36,9 +34,11 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/implementations/ActivityNamesImpl.kt b/app/src/main/java/info/nightscout/androidaps/implementations/ActivityNamesImpl.kt index 41670112cf..307ab4bf13 100644 --- a/app/src/main/java/info/nightscout/androidaps/implementations/ActivityNamesImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/implementations/ActivityNamesImpl.kt @@ -9,8 +9,8 @@ import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.activities.SingleFragmentActivity import info.nightscout.androidaps.dialogs.ProfileSwitchDialog import info.nightscout.androidaps.dialogs.WizardDialog -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.services.AlarmSoundService +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.ui.activities.BolusProgressHelperActivity import info.nightscout.ui.activities.ErrorHelperActivity import info.nightscout.ui.activities.TDDStatsActivity diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt index f83e248508..2f58cff830 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus 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 d19e234bc2..c015aa4a30 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 @@ -16,12 +16,7 @@ import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction -import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -48,16 +43,21 @@ import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ActivityNames +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt index 2ab1bad396..6a49eb3514 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt @@ -3,21 +3,21 @@ package info.nightscout.androidaps.plugins.aps.openAPSAMA import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.data.IobTotal -import info.nightscout.interfaces.data.MealData import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.androidaps.plugins.aps.loop.ScriptReader -import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.iob.MealData import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index 26e2f972d2..acfd94599e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -4,8 +4,6 @@ import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin @@ -23,10 +21,12 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index 506fe73044..573c11de72 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -3,26 +3,26 @@ package info.nightscout.androidaps.plugins.aps.openAPSSMB import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.data.IobTotal -import info.nightscout.interfaces.data.MealData import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus +import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.iob.MealData import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt index 59784e761e..12440368a9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalResultSMB.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.aps.openAPSSMB import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.VariableSensitivityResult import info.nightscout.androidaps.plugins.aps.loop.APSResult +import info.nightscout.interfaces.aps.VariableSensitivityResult import info.nightscout.rx.logging.LTag import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index fd1c4c8e0f..36b0777cf3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -6,36 +6,36 @@ import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.PluginBase -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.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.OpenAPSFragment import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index e9d5687b6a..d5ce9e2c5e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -3,31 +3,31 @@ package info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.data.IobTotal -import info.nightscout.interfaces.data.MealData -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.TddCalculator import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB -import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.utils.Round import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt index 623286d1b9..a8bce40daf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt @@ -26,8 +26,8 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.PR import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRebuildTabs 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 923f18cfa2..6d444dcb8b 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 @@ -18,10 +18,10 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.NsClient -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.sync.NsClient import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppInitialized import info.nightscout.rx.events.EventConfigBuilderChange diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt index 6c8c218555..2db9134fcb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt @@ -5,16 +5,16 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.NsClient -import info.nightscout.interfaces.Overview -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.Sensitivity -import info.nightscout.interfaces.Sync import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.Safety +import info.nightscout.interfaces.Overview +import info.nightscout.interfaces.constraints.Safety +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.sync.NsClient +import info.nightscout.interfaces.sync.Sync import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import javax.inject.Inject 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 4dcb5e0308..1982d8db17 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 @@ -3,9 +3,7 @@ package info.nightscout.androidaps.plugins.constraints.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.PluginBase 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 @@ -18,8 +16,10 @@ import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Obje import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective7 import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective9 import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP 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 45c6a41f79..7dc1002b3e 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 @@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt index 5d2ef6aa1e..cbbc6f1467 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective5.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.constraints.objectives.objectives import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.plugins.constraints.safety.SafetyPlugin +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.shared.utils.T import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt index a1c5025ef8..a742ff3ed2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt @@ -9,31 +9,31 @@ import info.nightscout.androidaps.extensions.storeDouble import info.nightscout.androidaps.extensions.storeInt import info.nightscout.androidaps.extensions.storeString import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.Safety 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.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.constraints.Safety +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.utils.Round 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 org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index 445925b8aa..08b6179ebc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -12,8 +12,6 @@ import androidx.core.content.ContextCompat import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.HistoryBrowseActivity -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.databinding.ActionsFragmentBinding import info.nightscout.androidaps.dialogs.ExtendedBolusDialog import info.nightscout.androidaps.dialogs.FillDialog @@ -37,11 +35,13 @@ import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.ActivityNames +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventCustomActionsChanged diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt index 900e6745c0..e7cfb73cba 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsPlugin.kt @@ -3,11 +3,11 @@ package info.nightscout.androidaps.plugins.general.actions import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton 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 0a25f69a2a..9fe2ab032b 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 @@ -19,9 +19,9 @@ import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt index 5b3203fa67..b7cf24b42c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt @@ -24,7 +24,6 @@ import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult import info.nightscout.androidaps.activities.PreferencesActivity -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.diaconn.events.EventDiaconnG8PumpLogReset import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat @@ -38,18 +37,19 @@ import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.interfaces.ImportExportPrefs -import info.nightscout.interfaces.data.maintenance.PrefFileNotFoundError -import info.nightscout.interfaces.data.maintenance.PrefIOError -import info.nightscout.interfaces.data.maintenance.PrefMetadata -import info.nightscout.interfaces.data.maintenance.Prefs -import info.nightscout.interfaces.data.maintenance.PrefsFile -import info.nightscout.interfaces.data.maintenance.PrefsFormat -import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.data.maintenance.PrefsStatus +import info.nightscout.interfaces.maintenance.ImportExportPrefs +import info.nightscout.interfaces.maintenance.PrefFileNotFoundError +import info.nightscout.interfaces.maintenance.PrefIOError +import info.nightscout.interfaces.maintenance.PrefMetadata +import info.nightscout.interfaces.maintenance.Prefs +import info.nightscout.interfaces.maintenance.PrefsFile +import info.nightscout.interfaces.maintenance.PrefsFormat +import info.nightscout.interfaces.maintenance.PrefsMetadataKey +import info.nightscout.interfaces.maintenance.PrefsStatus import info.nightscout.interfaces.storage.Storage import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index ce64fb49e3..c0675bc702 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -10,7 +10,6 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.SingleFragmentActivity import info.nightscout.androidaps.dana.database.DanaHistoryDatabase -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding import info.nightscout.androidaps.diaconn.database.DiaconnHistoryDatabase import info.nightscout.androidaps.events.EventPreferenceChange @@ -29,7 +28,8 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.PR import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.ImportExportPrefs +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.maintenance.ImportExportPrefs import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus 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 4d4f1ba2e4..a9724212aa 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,11 +7,11 @@ import androidx.core.content.FileProvider import dagger.android.HasAndroidInjector import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R -import info.nightscout.interfaces.PluginBase import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.general.maintenance.LoggerUtils import info.nightscout.plugins.sync.nsclient.data.NSSettingsStatus import info.nightscout.rx.logging.AAPSLogger 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 2bf9222da3..de3ce9b3c2 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 @@ -29,7 +29,6 @@ import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.databinding.OverviewFragmentBinding import info.nightscout.androidaps.dialogs.InsulinDialog import info.nightscout.androidaps.dialogs.LoopDialog @@ -78,12 +77,13 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.interfaces.end +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin 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 06e1c044bb..783e182d9f 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 @@ -21,9 +21,9 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.Overview -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index 28933ed660..99dfdd038c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -19,11 +19,11 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.IconsProvider import info.nightscout.interfaces.NotificationHolder -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.ui.IconsProvider import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAutosensCalculationFinished diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt index c5cb2570f7..3b7884ae42 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt @@ -9,9 +9,9 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBo import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataHandlerMobile import info.nightscout.androidaps.plugins.general.wear.wearintegration.DataLayerListenerServiceMobileHelper import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAutosensCalculationFinished 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 4e89584e82..d08374f055 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 @@ -4,11 +4,6 @@ import android.app.NotificationManager import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper -import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.dialogs.InsulinDialog import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.toStringShort @@ -44,11 +39,16 @@ import info.nightscout.database.entities.TotalDailyDose import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.entities.interfaces.end +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index 36175e3412..33997f9a7e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -5,8 +5,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.IobTotal -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventNewHistoryData @@ -27,11 +25,13 @@ import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.data.MealData +import info.nightscout.interfaces.iob.MealData +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt index f513893abd..fb7d67c40b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt @@ -2,16 +2,16 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.utils.Round import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import kotlin.math.max import kotlin.math.min diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt index 66614fc3a3..8992a77d47 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType @@ -11,9 +10,10 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.plugins.utils.Percentile import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt index bba17187b8..811c4d6128 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType @@ -11,10 +10,11 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.plugins.utils.Percentile import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt index 377c0ac213..58b3450fd3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -4,7 +4,6 @@ import androidx.collection.LongSparseArray import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType @@ -12,9 +11,10 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 c2952c2453..97ba39dfd3 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 @@ -6,18 +6,18 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 78d2cf94ef..0c1a7996e8 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 @@ -9,9 +9,6 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.Profile @@ -24,10 +21,13 @@ import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 abf984eadd..873ecf3f75 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 @@ -6,17 +6,17 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TherapyEvent -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 659ff06446..51d63091de 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 @@ -7,14 +7,14 @@ import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 4f91486fac..4bd03f5ac6 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 @@ -6,8 +6,6 @@ import android.os.Handler import android.os.HandlerThread import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger @@ -16,10 +14,12 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 7b30df2780..60a4654986 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 @@ -8,8 +8,6 @@ import android.os.HandlerThread import android.util.Log import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger @@ -18,10 +16,12 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 f4f29ba3c7..31e5146dcc 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 @@ -6,15 +6,15 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 00ffd09c3f..26c519f3c6 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 @@ -6,15 +6,15 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger 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 c293e1e3c7..fb00a23db6 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 @@ -5,16 +5,16 @@ import android.os.HandlerThread import android.os.SystemClock import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.utils.extensions.isRunningTest import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger 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 4c6afa72b9..cffbb6b902 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 @@ -6,14 +6,14 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 ba89e19878..edab93336c 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 @@ -6,15 +6,15 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.receivers.Intents import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 0e79e2697c..b3d91ddb14 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -15,7 +15,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.IobCobCalculator @@ -25,9 +24,10 @@ import info.nightscout.androidaps.plugins.general.maintenance.MaintenancePlugin import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.utils.extensions.buildDeviceStatus import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventProfileSwitchChanged 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 3d3c4e1980..6b2c504f9b 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -13,8 +13,6 @@ import info.nightscout.androidaps.dialogs.ProfileSwitchDialog import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.constraints.objectives.ObjectivesFragment @@ -41,8 +39,10 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.isRunningTest import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.Config +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.maintenance.ImportExportPrefs +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.profile.ProfileFragment import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt index 5083051cc7..abcfa73e3c 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWPlugin.kt @@ -9,12 +9,12 @@ import android.widget.RadioGroup import android.widget.TextView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.MyPreferenceFragment -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.plugins.configBuilder.PluginStore import info.nightscout.androidaps.setupwizard.SWDefinition import info.nightscout.androidaps.setupwizard.events.EventSWUpdate +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.events.EventConfigBuilderChange import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt b/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt index cf7146d777..6f592f763c 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/alertDialogs/PrefImportSummaryDialog.kt @@ -18,11 +18,11 @@ import androidx.annotation.StyleRes import androidx.appcompat.view.ContextThemeWrapper import com.google.android.material.dialog.MaterialAlertDialogBuilder import info.nightscout.androidaps.R -import info.nightscout.shared.extensions.runOnUiThread -import info.nightscout.interfaces.data.maintenance.Prefs -import info.nightscout.interfaces.data.maintenance.PrefsStatus import info.nightscout.androidaps.utils.ToastUtils -import java.util.* +import info.nightscout.interfaces.maintenance.Prefs +import info.nightscout.interfaces.maintenance.PrefsStatus +import info.nightscout.shared.extensions.runOnUiThread +import java.util.LinkedList object PrefImportSummaryDialog { diff --git a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt index a0ddbacf5b..458ca453ea 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/androidNotification/NotificationHolderImpl.kt @@ -10,8 +10,8 @@ import androidx.core.app.NotificationCompat import androidx.core.app.TaskStackBuilder import info.nightscout.androidaps.MainActivity import info.nightscout.core.main.R -import info.nightscout.interfaces.IconsProvider import info.nightscout.interfaces.NotificationHolder +import info.nightscout.interfaces.ui.IconsProvider import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/utils/resources/IconsProviderImplementation.kt b/app/src/main/java/info/nightscout/androidaps/utils/resources/IconsProviderImplementation.kt index e8e72dc8cf..43686c1945 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/resources/IconsProviderImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/resources/IconsProviderImplementation.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils.resources import info.nightscout.androidaps.R import info.nightscout.interfaces.Config -import info.nightscout.interfaces.IconsProvider +import info.nightscout.interfaces.ui.IconsProvider import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt b/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt index eb3c6239cc..404093e3c1 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/tabs/TabPageAdapter.kt @@ -3,9 +3,8 @@ package info.nightscout.androidaps.utils.tabs import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.viewpager2.adapter.FragmentStateAdapter -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginFragment -import java.util.* +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginFragment class TabPageAdapter(private val activity: AppCompatActivity) : FragmentStateAdapter(activity) { diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index d60de392db..9e687bcfac 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -5,9 +5,6 @@ import android.text.Spanned import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorResultTransaction import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.extensions.highValueToUnitsToString import info.nightscout.androidaps.extensions.lowValueToUnitsToString @@ -29,14 +26,17 @@ import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ActivityNames +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertOrUpdateBolusCalculatorResultTransaction import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.CarbTimer import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginBase +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt index 47b1b0cd60..a90d319b71 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt @@ -2,8 +2,6 @@ package info.nightscout.androidaps.utils.wizard import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop @@ -11,7 +9,9 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.PluginBase +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.utils.JsonHelper.safeGetInt import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 257a6c9c02..7829779b22 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject 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 52a89ecaec..25181580dd 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -31,9 +31,9 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.constraints.ConstraintsImpl import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.shared.sharedPreferences.SP 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 4f23e8ab06..312d63248a 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt @@ -6,7 +6,6 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints @@ -15,10 +14,11 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.bus.RxBus diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt index 6ac486a489..7a6ec7a912 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt @@ -5,13 +5,13 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.constraints.Constraint +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 bcc97f28eb..104488dc83 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 @@ -4,19 +4,19 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBaseWithProfile -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.pump.defs.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.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt index e3aa72718d..d6ea838f24 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt @@ -3,12 +3,12 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult +import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import org.junit.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 7efdc68d4c..5f837ab3cd 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 @@ -7,16 +7,16 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt index 0042eb21e8..1398789af1 100644 --- a/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt +++ b/automation/src/main/java/info/nightscout/automation/AutomationPlugin.kt @@ -45,9 +45,9 @@ import info.nightscout.automation.triggers.TriggerTimeRange import info.nightscout.automation.triggers.TriggerWifiSsid import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt index 79a48efc99..8109f0e2a6 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopDisable.kt @@ -10,8 +10,8 @@ import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt index 1a6e5bf0e7..6b6c838f42 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionLoopEnable.kt @@ -9,8 +9,8 @@ import info.nightscout.automation.R import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventRefreshOverview diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt index ca2d1c1455..f30ed453c9 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionRunAutotune.kt @@ -5,18 +5,17 @@ import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Autotune import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.InputDuration import info.nightscout.automation.elements.InputProfileName import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder +import info.nightscout.interfaces.autotune.Autotune +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt index 45c23849bc..26450f611e 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionSendSMS.kt @@ -3,13 +3,13 @@ package info.nightscout.automation.actions import android.widget.LinearLayout import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.interfaces.queue.Callback -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.InputString import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator +import info.nightscout.interfaces.utils.JsonHelper import org.json.JSONObject import javax.inject.Inject diff --git a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index b367dbc15c..8b70132d3f 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,20 +1,20 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject @Suppress("MemberVisibilityCanBePrivate") diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt index 4d9679164d..ecdcc68d5d 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopDisableTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.R +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.queue.Callback import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt index f353efeb29..7b750a0a7b 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionLoopEnableTest.kt @@ -1,8 +1,8 @@ package info.nightscout.automation.actions -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.queue.Callback import info.nightscout.automation.R +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.queue.Callback import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index c77e943724..9b32804c91 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -14,11 +14,11 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.triggers.Trigger import info.nightscout.database.entities.OfflineEvent import info.nightscout.interfaces.ConfigBuilder -import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.SmsCommunicator +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt index 7afa0f0b49..a253920eaa 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerTestBase.kt @@ -7,12 +7,12 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.interfaces.PluginDescription import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.automation.AutomationPlugin import info.nightscout.automation.services.LastLocationDataContainer +import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.rx.bus.RxBus import info.nightscout.shared.sharedPreferences.SP import org.junit.Before diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt b/core/core-main/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt index b4d6d72760..a59cfa061d 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt @@ -5,14 +5,14 @@ import android.content.pm.PackageManager import androidx.activity.result.contract.ActivityResultContracts import androidx.core.app.ActivityCompat import dagger.android.support.DaggerAppCompatActivity -import info.nightscout.core.main.R -import info.nightscout.interfaces.ImportExportPrefs -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.main.R +import info.nightscout.interfaces.maintenance.ImportExportPrefs import info.nightscout.interfaces.permissions.OptimizationPermissionContract import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject open class DaggerAppCompatActivityWithResult : DaggerAppCompatActivity() { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt index df103f7fdd..e276084525 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.data import info.nightscout.database.entities.Bolus -import info.nightscout.interfaces.data.Iob +import info.nightscout.interfaces.iob.Iob import kotlin.math.exp import kotlin.math.pow diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt index d3249b9959..3080bae1d8 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/PumpEnactResultImpl.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.data import dagger.android.HasAndroidInjector -import info.nightscout.core.main.R -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.core.main.R +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.utils.Round -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import javax.inject.Inject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt index af0a005fad..f2ef7b6bdb 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt @@ -4,7 +4,7 @@ import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.database.entities.Bolus -import info.nightscout.interfaces.data.Iob +import info.nightscout.interfaces.iob.Iob fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob { if (!isValid || type == Bolus.Type.PRIMING ) return Iob() diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt index 7a05ba6088..e3ecd0741a 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt @@ -1,12 +1,11 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.Overview -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.Safety -import info.nightscout.interfaces.Sync -import java.util.* +import info.nightscout.interfaces.constraints.Safety +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.sync.NsClient +import info.nightscout.interfaces.sync.Sync interface ActivePlugin { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt index d799b40c82..ea0a4a1394 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint /** * Constraints interface diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt index 882eafb46c..2ace25add1 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.data.IobTotal -import info.nightscout.interfaces.data.MealData import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus +import info.nightscout.interfaces.iob.MealData interface DetermineBasalAdapterInterface { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt index d5f59886e2..5c5ffdd6b2 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.ConfigExportImport -import info.nightscout.interfaces.data.Iob +import info.nightscout.interfaces.iob.Iob interface Insulin : ConfigExportImport { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt index df24dd5f67..3f497a0134 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.interfaces.data.MealData +import info.nightscout.interfaces.iob.MealData import org.json.JSONArray interface IobCobCalculator { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt index 47ca978fc3..9e39f10357 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.database.entities.OfflineEvent -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.PumpEnactResult interface Loop { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt index ed84388ac4..8a669ca254 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.data.PumpEnactResult -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.CustomCommand import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt index f9744b0681..fefc8aecc9 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpPluginBase.kt @@ -3,9 +3,9 @@ package info.nightscout.androidaps.interfaces import android.os.SystemClock import dagger.android.HasAndroidInjector import info.nightscout.core.main.R -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt index 598bfe2953..7c5b8ca53c 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.main.R import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.utils.HtmlHelper.fromHtml import info.nightscout.rx.logging.AAPSLogger diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt index 67a8a3f3e3..bd85f8f809 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefFileListProvider.kt @@ -3,16 +3,16 @@ package info.nightscout.androidaps.plugins.general.maintenance import android.content.Context import android.os.Environment import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.core.main.R import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils import info.nightscout.androidaps.plugins.general.maintenance.formats.EncryptedPrefsFormat +import info.nightscout.core.main.R import info.nightscout.interfaces.Config -import info.nightscout.interfaces.data.maintenance.PrefMetadata -import info.nightscout.interfaces.data.maintenance.PrefMetadataMap -import info.nightscout.interfaces.data.maintenance.PrefsFile -import info.nightscout.interfaces.data.maintenance.PrefsImportDir -import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.data.maintenance.PrefsStatus +import info.nightscout.interfaces.maintenance.PrefMetadata +import info.nightscout.interfaces.maintenance.PrefMetadataMap +import info.nightscout.interfaces.maintenance.PrefsFile +import info.nightscout.interfaces.maintenance.PrefsImportDir +import info.nightscout.interfaces.maintenance.PrefsMetadataKey +import info.nightscout.interfaces.maintenance.PrefsStatus import info.nightscout.interfaces.storage.Storage import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.DateTime diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt index 817235649f..cafbd1173b 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/PrefsFileContract.kt @@ -6,7 +6,7 @@ import androidx.activity.result.contract.ActivityResultContract import androidx.fragment.app.FragmentActivity import info.nightscout.androidaps.extensions.safeGetParcelableExtra import info.nightscout.androidaps.plugins.general.maintenance.activities.PrefImportListActivity -import info.nightscout.interfaces.data.maintenance.PrefsFile +import info.nightscout.interfaces.maintenance.PrefsFile class PrefsFileContract : ActivityResultContract() { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt index b01410c029..767ac658ef 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/activities/PrefImportListActivity.kt @@ -11,15 +11,15 @@ import androidx.fragment.app.FragmentActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerAppCompatActivity +import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider +import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract import info.nightscout.core.main.R import info.nightscout.core.main.databinding.MaintenanceImportListActivityBinding import info.nightscout.core.main.databinding.MaintenanceImportListItemBinding -import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvider -import info.nightscout.interfaces.data.maintenance.PrefsFile -import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract -import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.data.maintenance.PrefsStatus import info.nightscout.interfaces.locale.LocaleHelper +import info.nightscout.interfaces.maintenance.PrefsFile +import info.nightscout.interfaces.maintenance.PrefsMetadataKey +import info.nightscout.interfaces.maintenance.PrefsStatus import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt index 80fb603c22..383038e5e2 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormat.kt @@ -1,26 +1,26 @@ package info.nightscout.androidaps.plugins.general.maintenance.formats -import info.nightscout.core.main.R -import info.nightscout.androidaps.utils.CryptoUtil import info.nightscout.androidaps.extensions.hexStringToByteArray import info.nightscout.androidaps.extensions.toHex -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.androidaps.utils.CryptoUtil +import info.nightscout.core.main.R +import info.nightscout.interfaces.maintenance.PrefFileNotFoundError +import info.nightscout.interfaces.maintenance.PrefFormatError +import info.nightscout.interfaces.maintenance.PrefIOError +import info.nightscout.interfaces.maintenance.PrefMetadata +import info.nightscout.interfaces.maintenance.PrefMetadataMap +import info.nightscout.interfaces.maintenance.Prefs +import info.nightscout.interfaces.maintenance.PrefsFormat +import info.nightscout.interfaces.maintenance.PrefsMetadataKey +import info.nightscout.interfaces.maintenance.PrefsStatus import info.nightscout.interfaces.storage.Storage -import info.nightscout.interfaces.data.maintenance.PrefFileNotFoundError -import info.nightscout.interfaces.data.maintenance.PrefFormatError -import info.nightscout.interfaces.data.maintenance.PrefIOError -import info.nightscout.interfaces.data.maintenance.PrefMetadata -import info.nightscout.interfaces.data.maintenance.PrefMetadataMap -import info.nightscout.interfaces.data.maintenance.Prefs -import info.nightscout.interfaces.data.maintenance.PrefsFormat -import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.data.maintenance.PrefsStatus +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONException import org.json.JSONObject import java.io.File import java.io.FileNotFoundException import java.io.IOException -import java.util.* +import java.util.LinkedList import javax.inject.Inject import javax.inject.Singleton diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt index 177bdbde9e..0bde74e952 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventDismissBolusProgressIfRunning.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.plugins.general.overview.events -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.rx.events.Event class EventDismissBolusProgressIfRunning(val result: PumpEnactResult?, val id: Long?) : Event() \ No newline at end of file diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 257a6c9c02..7829779b22 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt index e427d91bd9..215ce818e1 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/ConstraintTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.data import info.nightscout.androidaps.TestBase -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTest.kt index 412d46f5f5..d36845c822 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTest.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.data -import info.nightscout.interfaces.data.Iob +import info.nightscout.interfaces.iob.Iob import org.junit.Assert import org.junit.Test diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt index 80d8c79ac7..49c3aeb2a1 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/MealDataTest.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.data -import info.nightscout.interfaces.data.MealData +import info.nightscout.interfaces.iob.MealData import org.junit.Assert import org.junit.Test diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt index ae1da713f6..fb47551e69 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/PumpEnactResultTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.core.main.R -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.pump.PumpEnactResult import org.json.JSONObject import org.junit.Assert import org.junit.Before diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt index 1b8670cc1c..1fa246105a 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/PluginDescriptionTest.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.interfaces import androidx.fragment.app.Fragment -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import org.junit.Assert import org.junit.Test diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt index a3b08207e6..fe9df82e40 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/aps/loop/APSResultTest.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble import org.junit.Assert diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt index 8813652ae9..63a1f3862f 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/EncryptedPrefsFormatTest.kt @@ -2,14 +2,13 @@ package info.nightscout.androidaps.plugins.general.maintenance.formats import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.utils.CryptoUtil +import info.nightscout.interfaces.maintenance.PrefFormatError +import info.nightscout.interfaces.maintenance.PrefMetadata +import info.nightscout.interfaces.maintenance.Prefs +import info.nightscout.interfaces.maintenance.PrefsFormat +import info.nightscout.interfaces.maintenance.PrefsMetadataKey +import info.nightscout.interfaces.maintenance.PrefsStatus import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.data.maintenance.PrefFormatError -import info.nightscout.interfaces.data.maintenance.PrefMetadata -import info.nightscout.interfaces.data.maintenance.Prefs -import info.nightscout.interfaces.data.maintenance.PrefsFormat -import info.nightscout.interfaces.data.maintenance.PrefsMetadataKey -import info.nightscout.interfaces.data.maintenance.PrefsStatus -import info.nightscout.shared.sharedPreferences.SP import org.hamcrest.CoreMatchers import org.junit.Assert import org.junit.Assume diff --git a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt index 38d00cf57a..7da34cedf5 100644 --- a/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/AndroidPermissionImpl.kt @@ -19,9 +19,9 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt index 587270034b..46ef41b774 100644 --- a/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/LocalAlertUtilsImpl.kt @@ -1,8 +1,5 @@ package info.nightscout.implementation -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper -import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger @@ -12,11 +9,14 @@ import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.LocalAlertUtils -import info.nightscout.interfaces.SmsCommunicator import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt index 4d1edd7c7a..f1f7e5a011 100644 --- a/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt @@ -1,9 +1,9 @@ package info.nightscout.implementation.constraints import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.interfaces.constraints.Constraint import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index fc34dcd06f..1afa3c168b 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -1,6 +1,23 @@ package info.nightscout.implementation.pump -import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification +import info.nightscout.core.main.R +import info.nightscout.core.pumpExtensions.fromDbPumpType +import info.nightscout.core.pumpExtensions.toDbPumpType +import info.nightscout.core.pumpExtensions.toDbSource +import info.nightscout.database.entities.Bolus +import info.nightscout.database.entities.Carbs +import info.nightscout.database.entities.ExtendedBolus +import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.entities.TotalDailyDose +import info.nightscout.database.entities.UserEntry +import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.database.impl.transactions.InsertBolusWithTempIdTransaction @@ -19,26 +36,9 @@ import info.nightscout.database.impl.transactions.SyncPumpExtendedBolusTransacti import info.nightscout.database.impl.transactions.SyncPumpTemporaryBasalTransaction import info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransaction import info.nightscout.database.impl.transactions.SyncTemporaryBasalWithTempIdTransaction -import info.nightscout.core.pumpExtensions.fromDbPumpType -import info.nightscout.core.pumpExtensions.toDbPumpType -import info.nightscout.core.pumpExtensions.toDbSource -import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.core.main.R -import info.nightscout.database.entities.Bolus -import info.nightscout.database.entities.Carbs -import info.nightscout.database.entities.ExtendedBolus -import info.nightscout.database.entities.TemporaryBasal -import info.nightscout.database.entities.TherapyEvent -import info.nightscout.database.entities.TotalDailyDose -import info.nightscout.database.entities.UserEntry -import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.database.entities.embedments.InterfaceIDs -import info.nightscout.interfaces.VirtualPump import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.VirtualPump import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index 6c4186909f..6ed3b595ec 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -7,13 +7,9 @@ import android.text.Spanned import androidx.appcompat.app.AppCompatActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.dialogs.BolusProgressDialog -import info.nightscout.core.pumpExtensions.insertCarbsTransaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints @@ -27,9 +23,12 @@ import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.queue.commands.Command.CommandType import info.nightscout.androidaps.utils.extensions.getCustomizedName import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.pumpExtensions.insertCarbsTransaction import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.ProfileSwitch import info.nightscout.database.entities.interfaces.end +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus import info.nightscout.implementation.queue.commands.CommandCancelExtendedBolus @@ -48,15 +47,16 @@ import info.nightscout.implementation.queue.commands.CommandStartPump import info.nightscout.implementation.queue.commands.CommandStopPump import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute import info.nightscout.implementation.queue.commands.CommandTempBasalPercent -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.CustomCommand +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt index 805cd565b2..4fe4b8c174 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandInsightSetTBROverNotification.kt @@ -2,10 +2,10 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Insight -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.implementation.R +import info.nightscout.interfaces.pump.Insight +import info.nightscout.interfaces.queue.Callback import javax.inject.Inject class CommandInsightSetTBROverNotification constructor( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt index 9d7150c09e..c2927375d4 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadEvents.kt @@ -2,13 +2,12 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Dana -import info.nightscout.interfaces.Diaconn -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.implementation.R +import info.nightscout.interfaces.pump.Dana +import info.nightscout.interfaces.pump.Diaconn +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.LTag - import javax.inject.Inject class CommandLoadEvents( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt index fb804b716e..128d7df3bd 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandLoadHistory.kt @@ -2,13 +2,12 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Dana -import info.nightscout.interfaces.Diaconn -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.implementation.R +import info.nightscout.interfaces.pump.Dana +import info.nightscout.interfaces.pump.Diaconn +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.LTag - import javax.inject.Inject class CommandLoadHistory( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt index 1504be8a80..5c51ac8bc6 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSMBBolus.kt @@ -1,17 +1,16 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command +import info.nightscout.implementation.R +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.queue.Callback +import info.nightscout.rx.logging.LTag import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T -import info.nightscout.implementation.R -import info.nightscout.rx.logging.LTag - import javax.inject.Inject class CommandSMBBolus( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt index bc37d95512..6e5f8618fb 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt @@ -2,19 +2,18 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command -import info.nightscout.shared.utils.DateUtil +import info.nightscout.database.impl.ValueWrapper import info.nightscout.implementation.R +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject class CommandSetProfile constructor( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt index a027b01d3f..2ccb6a1a76 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetUserSettings.kt @@ -2,13 +2,12 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Dana -import info.nightscout.interfaces.Diaconn -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.implementation.R +import info.nightscout.interfaces.pump.Dana +import info.nightscout.interfaces.pump.Diaconn +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.LTag - import javax.inject.Inject class CommandSetUserSettings( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt index 58d8d699b5..3f4863dbbb 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStartPump.kt @@ -2,10 +2,10 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Insight -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.implementation.R +import info.nightscout.interfaces.pump.Insight +import info.nightscout.interfaces.queue.Callback import javax.inject.Inject class CommandStartPump( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt index e618791d06..e2c64a1031 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandStopPump.kt @@ -2,10 +2,10 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Insight -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.implementation.R +import info.nightscout.interfaces.pump.Insight +import info.nightscout.interfaces.queue.Callback import javax.inject.Inject class CommandStopPump( diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 257a6c9c02..7829779b22 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index 33ea916bbf..532b7dee34 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -6,10 +6,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction @@ -17,19 +14,22 @@ import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.queue.commands.Command import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.Bolus +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandBolus import info.nightscout.implementation.queue.commands.CommandCustomCommand import info.nightscout.implementation.queue.commands.CommandExtendedBolus import info.nightscout.implementation.queue.commands.CommandLoadHistory import info.nightscout.implementation.queue.commands.CommandTempBasalPercent -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.CustomCommand +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt index 30ce88d798..0ee309ab82 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt @@ -6,18 +6,18 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.AndroidPermission -import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.queue.commands.Command +import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.R import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute +import info.nightscout.interfaces.AndroidPermission +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index f4e20c86ac..1d96b532f0 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -30,8 +30,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.insight.R; import info.nightscout.androidaps.insight.database.InsightBolusID; @@ -40,24 +38,15 @@ import info.nightscout.androidaps.insight.database.InsightHistoryOffset; import info.nightscout.androidaps.insight.database.InsightPumpID; import info.nightscout.androidaps.insight.database.InsightPumpID.EventType; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.interfaces.Insight; -import info.nightscout.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.Pump; -import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.interfaces.PumpSync.PumpState.TemporaryBasal; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.interfaces.pump.defs.ManufacturerType; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.plugins.pump.insight.app_layer.Service; import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.HistoryReadingDirection; import info.nightscout.androidaps.plugins.pump.insight.app_layer.history.ReadHistoryEventsMessage; @@ -124,16 +113,27 @@ import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_erro import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_errors.NoActiveTBRToCanceLException; import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator; import info.nightscout.androidaps.plugins.pump.insight.utils.ParameterBlockUtil; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.shared.utils.T; import info.nightscout.interfaces.Config; -import info.nightscout.interfaces.PluginType; +import info.nightscout.interfaces.constraints.Constraint; +import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.plugin.PluginDescription; +import info.nightscout.interfaces.plugin.PluginType; +import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.Insight; +import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.defs.ManufacturerType; +import info.nightscout.interfaces.pump.defs.PumpDescription; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventRefreshOverview; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; @Singleton public class LocalInsightPlugin extends PumpPluginBase implements Pump, Insight, Constraints, diff --git a/interfaces/src/main/java/info/nightscout/interfaces/AndroidPermission.kt b/interfaces/src/main/java/info/nightscout/interfaces/AndroidPermission.kt index 5cf3b3c10d..675d1936ea 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/AndroidPermission.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/AndroidPermission.kt @@ -2,6 +2,7 @@ package info.nightscout.interfaces import android.content.Context import androidx.fragment.app.FragmentActivity +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator interface AndroidPermission { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt b/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt index 352b657ac8..ef64088a84 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/ConfigBuilder.kt @@ -1,5 +1,8 @@ package info.nightscout.interfaces +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginType + interface ConfigBuilder { fun initialize() fun storeSettings(from: String) diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Safety.kt b/interfaces/src/main/java/info/nightscout/interfaces/Safety.kt deleted file mode 100644 index 7418f4ce87..0000000000 --- a/interfaces/src/main/java/info/nightscout/interfaces/Safety.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.interfaces - -interface Safety : ConfigExportImport \ No newline at end of file diff --git a/interfaces/src/main/java/info/nightscout/interfaces/VariableSensitivityResult.kt b/interfaces/src/main/java/info/nightscout/interfaces/aps/VariableSensitivityResult.kt similarity index 64% rename from interfaces/src/main/java/info/nightscout/interfaces/VariableSensitivityResult.kt rename to interfaces/src/main/java/info/nightscout/interfaces/aps/VariableSensitivityResult.kt index c34196d5f7..9e851d8241 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/VariableSensitivityResult.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/aps/VariableSensitivityResult.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.aps interface VariableSensitivityResult { var variableSens: Double? diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Autotune.kt b/interfaces/src/main/java/info/nightscout/interfaces/autotune/Autotune.kt similarity index 82% rename from interfaces/src/main/java/info/nightscout/interfaces/Autotune.kt rename to interfaces/src/main/java/info/nightscout/interfaces/autotune/Autotune.kt index bf80da51e3..40aba6f8d3 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/Autotune.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/autotune/Autotune.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.autotune interface Autotune { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Constraint.kt b/interfaces/src/main/java/info/nightscout/interfaces/constraints/Constraint.kt similarity index 98% rename from interfaces/src/main/java/info/nightscout/interfaces/Constraint.kt rename to interfaces/src/main/java/info/nightscout/interfaces/constraints/Constraint.kt index a030b41874..a332b9328d 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/Constraint.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/constraints/Constraint.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.constraints import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/interfaces/src/main/java/info/nightscout/interfaces/constraints/Safety.kt b/interfaces/src/main/java/info/nightscout/interfaces/constraints/Safety.kt new file mode 100644 index 0000000000..277d6ba07c --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/constraints/Safety.kt @@ -0,0 +1,5 @@ +package info.nightscout.interfaces.constraints + +import info.nightscout.interfaces.ConfigExportImport + +interface Safety : ConfigExportImport \ No newline at end of file diff --git a/interfaces/src/main/java/info/nightscout/interfaces/data/Iob.kt b/interfaces/src/main/java/info/nightscout/interfaces/iob/Iob.kt similarity index 96% rename from interfaces/src/main/java/info/nightscout/interfaces/data/Iob.kt rename to interfaces/src/main/java/info/nightscout/interfaces/iob/Iob.kt index c8ac1e5908..fdbd0e0cd0 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/data/Iob.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/iob/Iob.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.data +package info.nightscout.interfaces.iob class Iob { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/data/MealData.kt b/interfaces/src/main/java/info/nightscout/interfaces/iob/MealData.kt similarity index 85% rename from interfaces/src/main/java/info/nightscout/interfaces/data/MealData.kt rename to interfaces/src/main/java/info/nightscout/interfaces/iob/MealData.kt index 39feaba54e..1f43ee9678 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/data/MealData.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/iob/MealData.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.data +package info.nightscout.interfaces.iob class MealData { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/ImportExportPrefs.kt b/interfaces/src/main/java/info/nightscout/interfaces/maintenance/ImportExportPrefs.kt similarity index 84% rename from interfaces/src/main/java/info/nightscout/interfaces/ImportExportPrefs.kt rename to interfaces/src/main/java/info/nightscout/interfaces/maintenance/ImportExportPrefs.kt index 19996bd1b6..18ea0f32d3 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/ImportExportPrefs.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/maintenance/ImportExportPrefs.kt @@ -1,8 +1,7 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.maintenance import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity -import info.nightscout.interfaces.data.maintenance.PrefsFile interface ImportExportPrefs { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsFile.kt b/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFile.kt similarity index 87% rename from interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsFile.kt rename to interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFile.kt index d3f32e4464..77d205bb0d 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsFile.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFile.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.data.maintenance +package info.nightscout.interfaces.maintenance import android.os.Parcelable import kotlinx.parcelize.Parcelize diff --git a/interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsFormat.kt b/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFormat.kt similarity index 94% rename from interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsFormat.kt rename to interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFormat.kt index 33dfb513aa..4fbfa1a262 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsFormat.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsFormat.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.data.maintenance +package info.nightscout.interfaces.maintenance import android.content.Context import android.os.Parcelable @@ -40,7 +40,7 @@ enum class PrefsMetadataKey(val key: String, @DrawableRes val icon: Int, @String FILE_FORMAT -> when (value) { PrefsFormat.FORMAT_KEY_ENC -> context.getString(R.string.metadata_format_new) PrefsFormat.FORMAT_KEY_NOENC -> context.getString(R.string.metadata_format_debug) - else -> context.getString(R.string.metadata_format_other) + else -> context.getString(R.string.metadata_format_other) } CREATED_AT -> value.replace("T", " ").replace("Z", " (UTC)") else -> value diff --git a/interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsImportDir.kt b/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsImportDir.kt similarity index 52% rename from interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsImportDir.kt rename to interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsImportDir.kt index 3b8fa1f84b..eddfc99b5d 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/data/maintenance/PrefsImportDir.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/maintenance/PrefsImportDir.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.data.maintenance +package info.nightscout.interfaces.maintenance enum class PrefsImportDir { ROOT_DIR, diff --git a/interfaces/src/main/java/info/nightscout/interfaces/PluginBase.kt b/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginBase.kt similarity index 99% rename from interfaces/src/main/java/info/nightscout/interfaces/PluginBase.kt rename to interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginBase.kt index f0534edb8a..bc61cb95a4 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/PluginBase.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginBase.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.plugin import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat diff --git a/interfaces/src/main/java/info/nightscout/interfaces/PluginDescription.kt b/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginDescription.kt similarity index 98% rename from interfaces/src/main/java/info/nightscout/interfaces/PluginDescription.kt rename to interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginDescription.kt index e2bdc514b5..af5418d15c 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/PluginDescription.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginDescription.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.plugin import info.nightscout.interfaces.annotations.InterfacesOpenForTesting diff --git a/interfaces/src/main/java/info/nightscout/interfaces/PluginFragment.kt b/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginFragment.kt similarity index 57% rename from interfaces/src/main/java/info/nightscout/interfaces/PluginFragment.kt rename to interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginFragment.kt index 1bd0bb628d..0b10db8c2c 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/PluginFragment.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginFragment.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.plugin interface PluginFragment { var plugin: PluginBase? diff --git a/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt b/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginType.kt similarity index 83% rename from interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt rename to interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginType.kt index 7060741f00..8b900ea2b6 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/PluginType.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/plugin/PluginType.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.plugin /** * Main plugin type diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Dana.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/Dana.kt similarity index 78% rename from interfaces/src/main/java/info/nightscout/interfaces/Dana.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/Dana.kt index 0e1fe8db35..0a578aabeb 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/Dana.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/Dana.kt @@ -1,6 +1,4 @@ -package info.nightscout.interfaces - -import info.nightscout.interfaces.data.PumpEnactResult +package info.nightscout.interfaces.pump /** * Functionality supported by Dana* pumps only diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Diaconn.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/Diaconn.kt similarity index 61% rename from interfaces/src/main/java/info/nightscout/interfaces/Diaconn.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/Diaconn.kt index 31a4c8d741..3e45d7dd8a 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/Diaconn.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/Diaconn.kt @@ -1,6 +1,4 @@ -package info.nightscout.interfaces - -import info.nightscout.interfaces.data.PumpEnactResult +package info.nightscout.interfaces.pump interface Diaconn { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Insight.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/Insight.kt similarity index 64% rename from interfaces/src/main/java/info/nightscout/interfaces/Insight.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/Insight.kt index 7b4ad61cb6..6349b6c5ac 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/Insight.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/Insight.kt @@ -1,6 +1,4 @@ -package info.nightscout.interfaces - -import info.nightscout.interfaces.data.PumpEnactResult +package info.nightscout.interfaces.pump interface Insight { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/data/PumpEnactResult.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpEnactResult.kt similarity index 97% rename from interfaces/src/main/java/info/nightscout/interfaces/data/PumpEnactResult.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/PumpEnactResult.kt index fa7aa7c081..e73ba889a2 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/data/PumpEnactResult.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpEnactResult.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.data +package info.nightscout.interfaces.pump import org.json.JSONObject diff --git a/interfaces/src/main/java/info/nightscout/interfaces/VirtualPump.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/VirtualPump.kt similarity index 60% rename from interfaces/src/main/java/info/nightscout/interfaces/VirtualPump.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/VirtualPump.kt index 73506746e1..2e785096e2 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/VirtualPump.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/VirtualPump.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.pump interface VirtualPump { var fakeDataDetected: Boolean diff --git a/interfaces/src/main/java/info/nightscout/interfaces/queue/Callback.kt b/interfaces/src/main/java/info/nightscout/interfaces/queue/Callback.kt index 1caedf9aca..1f76e17009 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/queue/Callback.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/queue/Callback.kt @@ -1,6 +1,6 @@ package info.nightscout.interfaces.queue -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.pump.PumpEnactResult abstract class Callback : Runnable { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/data/smsCommunicator/Sms.kt b/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/Sms.kt similarity index 94% rename from interfaces/src/main/java/info/nightscout/interfaces/data/smsCommunicator/Sms.kt rename to interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/Sms.kt index bee9dd4ddc..2224347a93 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/data/smsCommunicator/Sms.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/Sms.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces.data.smsCommunicator +package info.nightscout.interfaces.smsCommunicator import android.telephony.SmsMessage diff --git a/interfaces/src/main/java/info/nightscout/interfaces/SmsCommunicator.kt b/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/SmsCommunicator.kt similarity index 62% rename from interfaces/src/main/java/info/nightscout/interfaces/SmsCommunicator.kt rename to interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/SmsCommunicator.kt index 419bf80daf..a699169598 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/SmsCommunicator.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/smsCommunicator/SmsCommunicator.kt @@ -1,6 +1,4 @@ -package info.nightscout.interfaces - -import info.nightscout.interfaces.data.smsCommunicator.Sms +package info.nightscout.interfaces.smsCommunicator interface SmsCommunicator { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/NsClient.kt b/interfaces/src/main/java/info/nightscout/interfaces/sync/NsClient.kt similarity index 94% rename from interfaces/src/main/java/info/nightscout/interfaces/NsClient.kt rename to interfaces/src/main/java/info/nightscout/interfaces/sync/NsClient.kt index d24ee84c66..763d6a610f 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/NsClient.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/sync/NsClient.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.sync import android.text.Spanned import org.json.JSONObject diff --git a/interfaces/src/main/java/info/nightscout/interfaces/Sync.kt b/interfaces/src/main/java/info/nightscout/interfaces/sync/Sync.kt similarity index 72% rename from interfaces/src/main/java/info/nightscout/interfaces/Sync.kt rename to interfaces/src/main/java/info/nightscout/interfaces/sync/Sync.kt index 6cb0ba3233..c98703081e 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/Sync.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/sync/Sync.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.sync interface Sync { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/ActivityNames.kt b/interfaces/src/main/java/info/nightscout/interfaces/ui/ActivityNames.kt similarity index 96% rename from interfaces/src/main/java/info/nightscout/interfaces/ActivityNames.kt rename to interfaces/src/main/java/info/nightscout/interfaces/ui/ActivityNames.kt index e7c167e043..f1d53938f1 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/ActivityNames.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/ui/ActivityNames.kt @@ -1,8 +1,8 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.ui -import androidx.fragment.app.FragmentManager import android.content.Context import androidx.annotation.RawRes +import androidx.fragment.app.FragmentManager /** * Interface to use activities located in different modules diff --git a/interfaces/src/main/java/info/nightscout/interfaces/IconsProvider.kt b/interfaces/src/main/java/info/nightscout/interfaces/ui/IconsProvider.kt similarity index 69% rename from interfaces/src/main/java/info/nightscout/interfaces/IconsProvider.kt rename to interfaces/src/main/java/info/nightscout/interfaces/ui/IconsProvider.kt index 8bb8b4b2a0..552bc18253 100644 --- a/interfaces/src/main/java/info/nightscout/interfaces/IconsProvider.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/ui/IconsProvider.kt @@ -1,4 +1,4 @@ -package info.nightscout.interfaces +package info.nightscout.interfaces.ui interface IconsProvider { fun getIcon(): Int diff --git a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt index 59ac4b7fa4..feeaa05b28 100644 --- a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt +++ b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt @@ -19,7 +19,6 @@ import androidx.work.OneTimeWorkRequestBuilder import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.plugin.general.openhumans.delegates.OHAppIDDelegate import info.nightscout.androidaps.plugin.general.openhumans.delegates.OHCounterDelegate @@ -28,8 +27,10 @@ import info.nightscout.androidaps.plugin.general.openhumans.ui.OHFragment import info.nightscout.androidaps.plugin.general.openhumans.ui.OHLoginActivity import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.interfaces.TraceableDBEntry -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper @@ -68,7 +69,7 @@ class OpenHumansUploader @Inject internal constructor( private val rxBus: RxBus ) : PluginBase( PluginDescription() - .mainType(info.nightscout.interfaces.PluginType.GENERAL) + .mainType(PluginType.GENERAL) .pluginIcon(R.drawable.open_humans_white) .pluginName(R.string.open_humans) .shortName(R.string.open_humans_short) diff --git a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt index f6e997f5bb..f7433dbe4d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt +++ b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt @@ -1,17 +1,17 @@ package info.nightscout.plugins.configBuilder -import info.nightscout.core.main.R import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Insulin -import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.pump.defs.PumpType +import info.nightscout.core.main.R import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.defs.PumpType +import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt index 993b6ebdd2..e91fa10f2e 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt @@ -5,10 +5,10 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt index 53690ec3ae..8ee4dd0a71 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/dstHelper/DstHelperPlugin.kt @@ -2,20 +2,19 @@ package info.nightscout.plugins.constraints.dstHelper import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.T import java.util.Calendar import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt index c5ee79edd8..37bfa3c01d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/phoneChecker/PhoneCheckerPlugin.kt @@ -5,12 +5,12 @@ import android.os.Build import com.scottyab.rootbeer.RootBeer import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt index 258f248f3d..a3f9521d00 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt @@ -5,17 +5,17 @@ import android.content.pm.PackageManager import android.os.Handler import android.os.HandlerThread import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.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.EventNewNotification +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.spongycastle.util.encoders.Hex import java.io.ByteArrayOutputStream diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt index b71f025c06..a0f6337a8e 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/storage/StorageConstraintPlugin.kt @@ -3,20 +3,20 @@ package info.nightscout.plugins.constraints.storage import android.os.Environment import android.os.StatFs import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.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.EventNewNotification +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.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 javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt index 52a80549f3..0e1ea16d5b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/constraints/versionChecker/VersionCheckerPlugin.kt @@ -1,21 +1,21 @@ package info.nightscout.plugins.constraints.versionChecker import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.constraints.versionChecker.VersionCheckerUtils import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import java.util.concurrent.TimeUnit import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index 9043b0605e..1398243b9b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -13,11 +13,11 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.Autotune import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.autotune.Autotune +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.plugins.R 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 9327ed76d0..5aceb5a85d 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 @@ -12,8 +12,6 @@ import android.widget.ArrayAdapter import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InvalidateFoodTransaction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck @@ -22,7 +20,9 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.Food import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.ActivityNames +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InvalidateFoodTransaction +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.plugins.R import info.nightscout.plugins.databinding.FoodFragmentBinding import info.nightscout.plugins.databinding.FoodItemBinding diff --git a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt index cafe8e9c0e..cb29c791b7 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/food/FoodPlugin.kt @@ -5,14 +5,14 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.SyncNsFoodTransaction import info.nightscout.androidaps.extensions.foodFromJson import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.database.entities.Food -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.SyncNsFoodTransaction +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt index 3caa3d3903..35de937bba 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/overview/notifications/NotificationStore.kt @@ -13,10 +13,10 @@ import android.view.ViewGroup import androidx.core.app.NotificationCompat import androidx.recyclerview.widget.RecyclerView import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.IconsProvider import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.ui.IconsProvider import info.nightscout.plugins.R import info.nightscout.plugins.databinding.OverviewNotificationItemBinding import info.nightscout.plugins.general.overview.notifications.events.EventUpdateOverviewNotification diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt index 173bc37b12..8eea5d6237 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/AuthRequest.kt @@ -2,18 +2,18 @@ package info.nightscout.plugins.general.smsCommunicator import android.os.SystemClock import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.data.smsCommunicator.Sms import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.smsCommunicator.Sms +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import javax.inject.Inject class AuthRequest internal constructor( diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt index 8709b172e9..88ae48bd4f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt @@ -6,8 +6,8 @@ import android.view.View import android.view.ViewGroup import dagger.android.support.DaggerFragment import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.interfaces.data.smsCommunicator.Sms +import info.nightscout.interfaces.smsCommunicator.Sms +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.plugins.databinding.SmscommunicatorFragmentBinding import info.nightscout.plugins.general.smsCommunicator.events.EventSmsCommunicatorUpdateGui 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 b1a9c2f03f..acb267c4c1 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 @@ -12,12 +12,6 @@ import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin @@ -41,17 +35,23 @@ import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction +import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.SmsCommunicator -import info.nightscout.interfaces.data.smsCommunicator.Sms +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.smsCommunicator.Sms +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.events.EventSmsCommunicatorUpdateGui import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword diff --git a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt index 41cd2a3ace..293537f26a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/smsCommunicator/activities/SmsCommunicatorOtpActivity.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.SmsCommunicator +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.plugins.R import info.nightscout.plugins.databinding.SmscommunicatorActivityOtpBinding import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword diff --git a/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt index 86e00294bf..66a6035d5c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/themes/ThemeSwitcherPlugin.kt @@ -6,14 +6,14 @@ import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventThemeSwitch import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject diff --git a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt index 936b78fd40..9d19e6c95c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -12,9 +12,9 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt index 3fac0105ab..bee4df0a77 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt @@ -8,11 +8,11 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.data.Iob +import info.nightscout.interfaces.iob.Iob import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index c9c41de409..cd17c2fd8d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -22,9 +22,9 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.plugins.R import info.nightscout.plugins.databinding.ProfileFragmentBinding import info.nightscout.plugins.ui.TimeListEdit diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index 361914fc60..10427a1a9e 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -6,39 +6,39 @@ 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.annotations.OpenForTesting import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.PluginBase -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.ProfileSource import info.nightscout.androidaps.interfaces.ProfileStore -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.XDripBroadcast -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventLocalProfileChanged import info.nightscout.rx.events.EventProfileStoreChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt index f4c9728d2c..3048694003 100644 --- a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -4,7 +4,6 @@ import android.os.SystemClock import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.dialogs.BolusProgressDialog import info.nightscout.androidaps.events.EventPreferenceChange @@ -20,11 +19,12 @@ import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.core.fabric.FabricPrivacy 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.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.VirtualPump import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt index dcb28c108c..252c9624fe 100644 --- a/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/BGSourceFragment.kt @@ -14,8 +14,6 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.extensions.directionToIcon import info.nightscout.androidaps.extensions.valueToUnitsString @@ -29,7 +27,9 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.PluginBase +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InvalidateGlucoseValueTransaction +import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.plugins.R import info.nightscout.plugins.databinding.SourceFragmentBinding import info.nightscout.plugins.databinding.SourceItemBinding diff --git a/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt index a82ce7769b..81da15e4d9 100644 --- a/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/source/NSClientSourcePlugin.kt @@ -5,19 +5,19 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction import info.nightscout.interfaces.Config -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.StoreDataForDb import info.nightscout.plugins.sync.nsclient.data.NSSgv diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt index f1b792a522..5ad00e1e8b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/NSClientFragment.kt @@ -20,9 +20,9 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry import info.nightscout.interfaces.BuildHelper -import info.nightscout.interfaces.NsClient -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginFragment +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginFragment +import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.R import info.nightscout.plugins.databinding.NsClientFragmentBinding import info.nightscout.plugins.sync.nsShared.events.EventNSClientUpdateGUI diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt index 99c60525e3..d54871a809 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/StoreDataForDb.kt @@ -5,19 +5,6 @@ import android.os.SystemClock import androidx.work.Worker import androidx.work.WorkerParameters import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CgmSourceTransaction -import info.nightscout.database.impl.transactions.SyncNsBolusCalculatorResultTransaction -import info.nightscout.database.impl.transactions.SyncNsBolusTransaction -import info.nightscout.database.impl.transactions.SyncNsCarbsTransaction -import info.nightscout.database.impl.transactions.SyncNsEffectiveProfileSwitchTransaction -import info.nightscout.database.impl.transactions.SyncNsExtendedBolusTransaction -import info.nightscout.database.impl.transactions.SyncNsOfflineEventTransaction -import info.nightscout.database.impl.transactions.SyncNsProfileSwitchTransaction -import info.nightscout.database.impl.transactions.SyncNsTemporaryBasalTransaction -import info.nightscout.database.impl.transactions.SyncNsTemporaryTargetTransaction -import info.nightscout.database.impl.transactions.SyncNsTherapyEventTransaction -import info.nightscout.database.impl.transactions.UserEntryTransaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger @@ -35,10 +22,23 @@ import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CgmSourceTransaction +import info.nightscout.database.impl.transactions.SyncNsBolusCalculatorResultTransaction +import info.nightscout.database.impl.transactions.SyncNsBolusTransaction +import info.nightscout.database.impl.transactions.SyncNsCarbsTransaction +import info.nightscout.database.impl.transactions.SyncNsEffectiveProfileSwitchTransaction +import info.nightscout.database.impl.transactions.SyncNsExtendedBolusTransaction +import info.nightscout.database.impl.transactions.SyncNsOfflineEventTransaction +import info.nightscout.database.impl.transactions.SyncNsProfileSwitchTransaction +import info.nightscout.database.impl.transactions.SyncNsTemporaryBasalTransaction +import info.nightscout.database.impl.transactions.SyncNsTemporaryTargetTransaction +import info.nightscout.database.impl.transactions.SyncNsTherapyEventTransaction +import info.nightscout.database.impl.transactions.UserEntryTransaction import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.R import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.plugins.source.NSClientSourcePlugin diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt index 203531a68b..bdc98f1463 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientNewLog.kt @@ -1,6 +1,6 @@ package info.nightscout.plugins.sync.nsShared.events -import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.sync.NsClient import info.nightscout.rx.events.Event import java.text.SimpleDateFormat import java.util.Locale diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt index 68e0958394..c16495dc8f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsShared/events/EventNSClientStatus.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsShared.events import info.nightscout.androidaps.events.EventStatus -import info.nightscout.interfaces.NsClient +import info.nightscout.interfaces.sync.NsClient import info.nightscout.shared.interfaces.ResourceHelper class EventNSClientStatus(var text: String, val version: NsClient.Version) : EventStatus() { diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt index 6590746f28..3bd035618b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/NSClientPlugin.kt @@ -19,11 +19,11 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.NsClient -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.Sync +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.sync.NsClient +import info.nightscout.interfaces.sync.Sync import info.nightscout.interfaces.utils.HtmlHelper.fromHtml import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.NSClientFragment diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt index e0205828a6..dfbb7bfca4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/data/NSDeviceStatusHandler.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclient.data -import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.Config +import info.nightscout.interfaces.sync.NsClient import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt index 0c5ff7bd2f..9cc36898e6 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt @@ -16,17 +16,17 @@ import com.google.gson.GsonBuilder import com.google.gson.JsonDeserializer import dagger.android.DaggerService import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.interfaces.NsClient import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.sync.NsClient import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.interfaces.utils.JsonHelper.safeGetStringAllowNull import info.nightscout.plugins.R diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt index 6fa6f7ed50..64064b6cb4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddAckWorker.kt @@ -6,20 +6,6 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.UpdateNsIdBolusCalculatorResultTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdBolusTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdCarbsTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdDeviceStatusTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdEffectiveProfileSwitchTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdExtendedBolusTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdFoodTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdGlucoseValueTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdOfflineEventTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdProfileSwitchTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryBasalTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryTargetTransaction -import info.nightscout.database.impl.transactions.UpdateNsIdTherapyEventTransaction import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.DataSyncSelector.PairBolus import info.nightscout.androidaps.interfaces.DataSyncSelector.PairBolusCalculatorResult @@ -36,7 +22,21 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryTarge import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTherapyEvent import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.database.entities.DeviceStatus -import info.nightscout.interfaces.NsClient +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.UpdateNsIdBolusCalculatorResultTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdBolusTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdCarbsTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdDeviceStatusTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdEffectiveProfileSwitchTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdExtendedBolusTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdFoodTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdGlucoseValueTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdOfflineEventTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdProfileSwitchTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryBasalTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdTemporaryTargetTransaction +import info.nightscout.database.impl.transactions.UpdateNsIdTherapyEventTransaction +import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.plugins.sync.nsclient.acks.NSAddAck diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt index 1ccae0ac76..eb3a30a3e5 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientAddUpdateWorker.kt @@ -5,16 +5,16 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository 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.receivers.DataWorkerStorage import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config -import info.nightscout.interfaces.VirtualPump +import info.nightscout.interfaces.pump.VirtualPump import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.StoreDataForDb diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt index 5b73bcbec9..b6c1e48806 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/workers/NSClientUpdateRemoveAckWorker.kt @@ -5,7 +5,6 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.DataSyncSelector.PairBolus import info.nightscout.androidaps.interfaces.DataSyncSelector.PairBolusCalculatorResult @@ -19,8 +18,9 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector.PairProfileSwitch import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryBasal import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTemporaryTarget import info.nightscout.androidaps.interfaces.DataSyncSelector.PairTherapyEvent -import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.plugins.sync.nsclient.acks.NSUpdateAck import info.nightscout.rx.AapsSchedulers diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index b45e2c0e01..bd8e8cf1b6 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -18,11 +18,11 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.NsClient -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.Sync +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.sync.NsClient +import info.nightscout.interfaces.sync.Sync import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.plugins.R import info.nightscout.plugins.sync.nsShared.NSClientFragment diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt index 937f56a258..be6e4606fc 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadBgWorker.kt @@ -8,8 +8,8 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.R import info.nightscout.plugins.source.NSClientSourcePlugin import info.nightscout.plugins.sync.nsShared.StoreDataForDb diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt index 265372776a..3f985178a8 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadDeviceStatusWorker.kt @@ -5,8 +5,8 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.plugins.sync.nsclient.data.NSDeviceStatusHandler import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt index 997bd7bab5..8c44b303b2 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/workers/LoadTreatmentsWorker.kt @@ -8,8 +8,8 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.NsClient import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsShared.StoreDataForDb import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog import info.nightscout.plugins.sync.nsclientV3.NSClientV3Plugin diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt index 2bdcaab27c..cb8c7d4fed 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/TidepoolPlugin.kt @@ -11,10 +11,10 @@ import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.PluginBase -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.Sync +import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.sync.Sync import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.plugins.R import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 257a6c9c02..7829779b22 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt index 96a9d91b02..b56f18ef4a 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/bgQualityCheck/BgQualityCheckPluginTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.GlucoseValue -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt index 64cd79fa8d..8eb0e6427a 100644 --- a/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/constraints/storage/StorageConstraintPluginTest.kt @@ -3,10 +3,10 @@ package info.nightscout.plugins.constraints.storage import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.interfaces.Constraint -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt index d1b19d7e47..d60e0e9084 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/AuthRequestTest.kt @@ -2,16 +2,16 @@ package info.nightscout.plugins.general.smsCommunicator import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.TestBase -import info.nightscout.interfaces.data.smsCommunicator.Sms -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.SmsCommunicator +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.smsCommunicator.Sms +import info.nightscout.interfaces.smsCommunicator.SmsCommunicator +import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T -import info.nightscout.plugins.R import org.junit.Assert import org.junit.Before import org.junit.Test 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 eedd871589..61fa6f3c8b 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 @@ -7,11 +7,6 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction -import info.nightscout.database.impl.transactions.Transaction import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints @@ -23,14 +18,19 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.CancelCurrentOfflineEventIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentOfflineEventTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction +import info.nightscout.database.impl.transactions.Transaction import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.data.smsCommunicator.Sms +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.smsCommunicator.Sms import info.nightscout.plugins.R import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePassword import info.nightscout.plugins.general.smsCommunicator.otp.OneTimePasswordValidationResult diff --git a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsTest.kt index 6b4a9cb796..32037c6d04 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/smsCommunicator/SmsTest.kt @@ -2,7 +2,7 @@ package info.nightscout.plugins.general.smsCommunicator import android.telephony.SmsMessage import info.nightscout.androidaps.TestBase -import info.nightscout.interfaces.data.smsCommunicator.Sms +import info.nightscout.interfaces.smsCommunicator.Sms import org.junit.Assert import org.junit.Test import org.mockito.Mockito diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index e1c785ef2e..8fdc98efea 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -21,7 +21,6 @@ import javax.inject.Singleton; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.combo.R; -import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.CommandQueue; @@ -47,11 +46,12 @@ import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpH import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.PumpHistoryRequest; import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Tdd; import info.nightscout.core.fabric.InstanceId; -import info.nightscout.interfaces.Constraint; -import info.nightscout.interfaces.PluginDescription; -import info.nightscout.interfaces.PluginType; -import info.nightscout.interfaces.data.PumpEnactResult; +import info.nightscout.interfaces.constraints.Constraint; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.plugin.PluginDescription; +import info.nightscout.interfaces.plugin.PluginType; +import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.PumpEnactResult; import info.nightscout.interfaces.pump.defs.ManufacturerType; import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.interfaces.pump.defs.PumpType; diff --git a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt index c2e1c933fb..4aaafda1e6 100644 --- a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt +++ b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.RuffyScripter import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginType +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt index 9d548b19f0..f407361604 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt @@ -25,9 +25,9 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.userEntry.UserEntryMapper.Action import info.nightscout.androidaps.utils.userEntry.UserEntryMapper.Sources import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.Dana +import info.nightscout.interfaces.pump.Dana import info.nightscout.interfaces.pump.defs.PumpType +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt index 31eacc0867..b182f56320 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt @@ -9,10 +9,10 @@ import info.nightscout.androidaps.dana.databinding.DanarUserOptionsActivityBindi import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constants import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventInitializationChanged import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index 16659fb8e6..0de5d14033 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -10,7 +10,6 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danaRKorean.services.DanaRKoreanExecutionService import info.nightscout.androidaps.danar.AbstractDanaRPlugin import info.nightscout.androidaps.danar.R -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin @@ -20,8 +19,9 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusTime_k.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusTime_k.kt index d4db1502d1..105e16bc48 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusTime_k.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/comm/MsgInitConnStatusTime_k.kt @@ -3,9 +3,9 @@ package info.nightscout.androidaps.danaRKorean.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.events.EventRebuildTabs import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java index 41658f5a24..ca98c27fb0 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java @@ -8,7 +8,6 @@ import java.io.IOException; import javax.inject.Inject; -import info.nightscout.interfaces.Constants; import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.dana.events.EventDanaRNewStatus; import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin; @@ -37,7 +36,6 @@ import info.nightscout.androidaps.danar.comm.MsgSettingShippingInfo; import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.dialogs.BolusProgressDialog; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; @@ -46,19 +44,21 @@ import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; -import info.nightscout.rx.events.EventOverviewBolusProgress; -import info.nightscout.interfaces.notifications.Notification; -import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.queue.commands.Command; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.shared.utils.T; +import info.nightscout.interfaces.Constants; +import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventProfileSwitchChanged; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; public class DanaRKoreanExecutionService extends AbstractDanaRExecutionService { @Inject AAPSLogger aapsLogger; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index 3b370f91cf..dd79780492 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -16,7 +16,6 @@ import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.danaRv2.services.DanaRv2ExecutionService; import info.nightscout.androidaps.danar.AbstractDanaRPlugin; import info.nightscout.androidaps.danar.R; -import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; @@ -26,8 +25,9 @@ import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage; import info.nightscout.core.fabric.FabricPrivacy; -import info.nightscout.interfaces.Constraint; -import info.nightscout.interfaces.data.PumpEnactResult; +import info.nightscout.interfaces.constraints.Constraint; +import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.PumpEnactResult; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.utils.Round; import info.nightscout.rx.AapsSchedulers; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgCheckValue_v2.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgCheckValue_v2.kt index 0869ee08d3..50cdf256b3 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgCheckValue_v2.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/comm/MsgCheckValue_v2.kt @@ -4,9 +4,9 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.events.EventRebuildTabs import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java index d1bfa31449..d7311d4bd5 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java @@ -10,7 +10,6 @@ import java.io.IOException; import javax.inject.Inject; import dagger.android.HasAndroidInjector; -import info.nightscout.interfaces.Constants; import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.dana.events.EventDanaRNewStatus; import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin; @@ -49,32 +48,33 @@ import info.nightscout.androidaps.danar.comm.MsgStatusBasic; import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.dialogs.BolusProgressDialog; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; -import info.nightscout.interfaces.ActivityNames; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.Pump; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; -import info.nightscout.rx.events.EventOverviewBolusProgress; +import info.nightscout.androidaps.queue.commands.Command; +import info.nightscout.interfaces.Constants; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.pump.PumpEnactResult; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.queue.Callback; -import info.nightscout.androidaps.queue.commands.Command; -import info.nightscout.shared.utils.DateUtil; -import info.nightscout.shared.utils.T; +import info.nightscout.interfaces.ui.ActivityNames; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventProfileSwitchChanged; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; +import info.nightscout.shared.utils.T; public class DanaRv2ExecutionService extends AbstractDanaRExecutionService { @Inject HasAndroidInjector injector; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index bb17c5aa31..655e5573a4 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -10,36 +10,36 @@ import info.nightscout.androidaps.dana.DanaFragment; import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.dana.comm.RecordTypes; import info.nightscout.androidaps.danar.services.AbstractDanaRExecutionService; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.interfaces.Constraint; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.interfaces.Dana; -import info.nightscout.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.Pump; -import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.interfaces.pump.defs.ManufacturerType; 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.shared.utils.DateUtil; import info.nightscout.androidaps.utils.DecimalFormatter; +import info.nightscout.interfaces.constraints.Constraint; +import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.plugin.PluginDescription; +import info.nightscout.interfaces.plugin.PluginType; +import info.nightscout.interfaces.pump.Dana; +import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.defs.ManufacturerType; +import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.interfaces.utils.Round; -import info.nightscout.interfaces.PluginType; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventConfigBuilderChange; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; import io.reactivex.rxjava3.disposables.CompositeDisposable; /** diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index f4170805d9..dc03bb6aa0 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -14,7 +14,6 @@ import javax.inject.Singleton; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.danar.services.DanaRExecutionService; -import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; @@ -23,8 +22,9 @@ import info.nightscout.androidaps.interfaces.Constraints; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.core.fabric.FabricPrivacy; -import info.nightscout.interfaces.Constraint; -import info.nightscout.interfaces.data.PumpEnactResult; +import info.nightscout.interfaces.constraints.Constraint; +import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.PumpEnactResult; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.utils.Round; import info.nightscout.rx.AapsSchedulers; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt index d920a16c19..d22424bed1 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStart.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt index 9c82f2682d..caa86a6b6b 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgBolusStartWithSpeed.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusTime.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusTime.kt index 4b8c1631fe..a965466572 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusTime.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgInitConnStatusTime.kt @@ -2,9 +2,9 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danar.R -import info.nightscout.interfaces.PluginType import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.rx.events.EventRebuildTabs import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt index 126bf34b9e..3bfc0a5aad 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MsgSetExtendedBolusStart.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.danar.comm import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.rx.logging.LTag diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java index 1791ccce0b..e318218720 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java @@ -47,8 +47,8 @@ import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.utils.ToastUtils; import info.nightscout.core.fabric.FabricPrivacy; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.pump.PumpEnactResult; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventAppExit; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java index 9ca9e5720d..f31c154d06 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java @@ -9,7 +9,6 @@ import java.io.IOException; import javax.inject.Inject; import dagger.android.HasAndroidInjector; -import info.nightscout.interfaces.Constants; import info.nightscout.androidaps.dana.DanaPump; import info.nightscout.androidaps.dana.events.EventDanaRNewStatus; import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin; @@ -44,7 +43,6 @@ import info.nightscout.androidaps.danar.comm.MsgStatus; import info.nightscout.androidaps.danar.comm.MsgStatusBasic; import info.nightscout.androidaps.danar.comm.MsgStatusBolusExtended; import info.nightscout.androidaps.danar.comm.MsgStatusTempBasal; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.dialogs.BolusProgressDialog; import info.nightscout.androidaps.events.EventPumpStatusChanged; @@ -52,18 +50,20 @@ import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; -import info.nightscout.rx.events.EventOverviewBolusProgress; +import info.nightscout.androidaps.queue.commands.Command; +import info.nightscout.interfaces.Constants; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.pump.PumpEnactResult; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.queue.Callback; -import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; +import info.nightscout.rx.events.EventOverviewBolusProgress; import info.nightscout.rx.events.EventProfileSwitchChanged; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; public class DanaRExecutionService extends AbstractDanaRExecutionService { diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index df7e553b7b..687981b742 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt index 27db7e5408..987c8c2c19 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt @@ -2,16 +2,16 @@ package info.nightscout.androidaps.plugins.pump.danaR import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MessageHashTableRTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MessageHashTableRTest.kt index 7f3557ca5d..1277865b0c 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MessageHashTableRTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MessageHashTableRTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MessageHashTableR -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartTest.kt index 9a404ddf22..5c437e4fa9 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgBolusStart -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito.`when` diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartWithSpeedTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartWithSpeedTest.kt index f3d7917092..0660d978af 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartWithSpeedTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgBolusStartWithSpeedTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgBolusStartWithSpeed -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSetExtendedBolusStartTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSetExtendedBolusStartTest.kt index 7ce268f28e..ff068be94c 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSetExtendedBolusStartTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/MsgSetExtendedBolusStartTest.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.danaR.comm import info.nightscout.androidaps.danar.comm.MsgSetExtendedBolusStart -import info.nightscout.interfaces.Constraint +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito.`when` diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt index e0f7cebf4c..62af1423b6 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt @@ -2,16 +2,16 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/comm/MessageHashTableRKoreanTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/comm/MessageHashTableRKoreanTest.kt index 9c053d2990..cb0d8752cc 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/comm/MessageHashTableRKoreanTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/comm/MessageHashTableRKoreanTest.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.danaRKorean.comm import info.nightscout.androidaps.danaRKorean.comm.MessageHashTableRKorean -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.plugins.pump.danaR.comm.DanaRTestBase +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt index b8ea019892..9d2ea27f0a 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt @@ -2,18 +2,18 @@ package info.nightscout.androidaps.plugins.pump.danaRv2 import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginType import info.nightscout.shared.sharedPreferences.SP import org.junit.Before import org.junit.Test diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MessageHashTableRv2Test.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MessageHashTableRv2Test.kt index 815fef0d08..782c123942 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MessageHashTableRv2Test.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/comm/MessageHashTableRv2Test.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.plugins.pump.danaRv2.comm import info.nightscout.androidaps.danaRv2.comm.MessageHashTableRv2 import info.nightscout.androidaps.danaRv2.comm.MsgStatusAPS_v2 import info.nightscout.androidaps.danar.comm.MessageBase -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.plugins.pump.danaR.comm.DanaRTestBase +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mockito.`when` diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index d228207688..4a11212c12 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -13,7 +13,6 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.dana.comm.RecordTypes import info.nightscout.androidaps.danars.events.EventDanaRSDeviceChange import info.nightscout.androidaps.danars.services.DanaRSService -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -31,12 +30,13 @@ import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalSt import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.Dana -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.Dana +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt index 8821e375e4..4df7ee77c9 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSetStepBolusStart.kt @@ -3,8 +3,8 @@ package info.nightscout.androidaps.danars.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt index 01ff1567be..3f7679c154 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt @@ -66,11 +66,11 @@ import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.queue.commands.Command import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt index 7e7504cb76..f8ecf62623 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt @@ -2,14 +2,14 @@ package info.nightscout.androidaps.danars import android.content.Context import dagger.android.AndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.PluginType -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.plugin.PluginType import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsMessageHashTableTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsMessageHashTableTest.kt index 0d3147c3e1..8c04713b61 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsMessageHashTableTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsMessageHashTableTest.kt @@ -6,8 +6,8 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.DanaRSTestBase import info.nightscout.androidaps.danars.encryption.BleEncryption import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.Constraint import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Test import org.mockito.Mock diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt index 2830b3f4fc..9def3f4307 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt @@ -6,11 +6,11 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.danars.DanaRSTestBase import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.Constraint -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints +import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage +import info.nightscout.interfaces.constraints.Constraint import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt index 5c7738a7c4..6f68542f21 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.utils.WarnColors import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventExtendedBolusChange diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index 8c99c3021d..e81abac241 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -9,7 +9,6 @@ import android.text.format.DateFormat import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.diaconn.events.EventDiaconnG8DeviceChange import info.nightscout.androidaps.diaconn.service.DiaconnG8Service @@ -29,17 +28,18 @@ import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalSt import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.Constraint -import info.nightscout.interfaces.Diaconn -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Diaconn +import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.actions.CustomAction +import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt index 49b8f8418f..f572989f6c 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt @@ -13,8 +13,8 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt index 821b72c64a..dc355d6366 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt @@ -28,12 +28,12 @@ import info.nightscout.androidaps.diaconn.packet.InsulinLackReportPacket import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.waitMillis -import info.nightscout.interfaces.ActivityNames -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.interfaces.ui.ActivityNames 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 java.util.UUID import java.util.concurrent.ScheduledFuture import javax.inject.Inject diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index 279e1ab710..a459bdeb53 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -57,12 +57,12 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotifi import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.queue.commands.Command import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppExit diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index 77a03b7cec..b512cc0884 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.eopatch import android.os.SystemClock import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.CommandQueue @@ -19,15 +18,16 @@ import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.ui.EopatchOverviewFragment import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.actions.CustomAction +import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.queue.CustomCommand import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.AapsSchedulers diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index 1e37bd6d98..ccafc41165 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -7,7 +7,6 @@ import android.os.IBinder import android.os.SystemClock import androidx.preference.Preference import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue @@ -54,15 +53,16 @@ import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil.Companion.isSame import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification -import info.nightscout.interfaces.pump.defs.ManufacturerType -import info.nightscout.interfaces.pump.defs.PumpType +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType +import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpType +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt index 61cd019ef0..e15fdd5660 100644 --- a/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt +++ b/pump/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt @@ -3,12 +3,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common. import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 4df111bcc9..72074e1868 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -5,7 +5,6 @@ import android.os.Handler import android.os.HandlerThread import android.text.format.DateFormat import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.convertedToAbsolute @@ -52,17 +51,18 @@ import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.PluginType -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.actions.CustomAction +import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.interfaces.pump.actions.CustomAction -import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.queue.CustomCommand +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.Round import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.AapsSchedulers diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt index ac8018229d..920fd9402d 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt @@ -16,8 +16,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activation import info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivation.DashPodDeactivationWizardActivity import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventQueueChanged import info.nightscout.shared.extensions.toVisibility diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt index a1c4702eb2..292f304cb2 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt @@ -32,11 +32,11 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Constants import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventQueueChanged diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt index d74f67a3fb..87317ea555 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt @@ -2,9 +2,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activatio import androidx.annotation.StringRes import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InitializePodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.dash.R @@ -15,10 +13,11 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.DashHistory import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.InitialResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.ResolvedResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.I8n +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag - +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.core.Single import io.reactivex.rxjava3.kotlin.plusAssign diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index 45ce5dc07a..d3223f513e 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.activatio import androidx.annotation.StringRes import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.PumpSync @@ -20,8 +19,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.Constants import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.I8n import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.mapProfileToBasalProgram import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt index dee5b59d53..bde420b990 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt @@ -2,14 +2,14 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.ui.wizard.deactivat import androidx.annotation.StringRes import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification -import info.nightscout.interfaces.notifications.Notification import info.nightscout.androidaps.plugins.pump.omnipod.common.R import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.action.DeactivatePodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index c808ce0162..c74d233ee9 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -34,8 +34,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import dagger.android.HasAndroidInjector; -import info.nightscout.core.pumpExtensions.DetailedBolusInfoExtensionKt; -import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; @@ -90,17 +88,19 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUti import info.nightscout.androidaps.services.AlarmSoundService; import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.core.fabric.FabricPrivacy; -import info.nightscout.interfaces.ActivityNames; -import info.nightscout.interfaces.PluginDescription; -import info.nightscout.interfaces.PluginType; -import info.nightscout.interfaces.data.PumpEnactResult; +import info.nightscout.core.pumpExtensions.DetailedBolusInfoExtensionKt; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.plugin.PluginDescription; +import info.nightscout.interfaces.plugin.PluginType; +import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.actions.CustomActionType; import info.nightscout.interfaces.pump.defs.ManufacturerType; import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.interfaces.pump.defs.PumpType; -import info.nightscout.interfaces.pump.actions.CustomActionType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.interfaces.queue.CustomCommand; +import info.nightscout.interfaces.ui.ActivityNames; import info.nightscout.interfaces.utils.Round; import info.nightscout.interfaces.utils.TimeChangeType; import info.nightscout.rx.AapsSchedulers; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index 9511e6fd61..a5adbaa938 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -68,11 +68,11 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.Om import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; import info.nightscout.core.pumpExtensions.DetailedBolusInfoExtensionKt; -import info.nightscout.interfaces.ActivityNames; -import info.nightscout.interfaces.data.PumpEnactResult; import info.nightscout.interfaces.notifications.Notification; import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.PumpEnactResult; import info.nightscout.interfaces.pump.defs.PumpType; +import info.nightscout.interfaces.ui.ActivityNames; import info.nightscout.pump.core.utils.ByteUtil; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt index aefc980840..d9870bbff6 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt @@ -28,9 +28,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivati import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventQueueChanged import info.nightscout.shared.extensions.toVisibility diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt index e41288b454..5e1e03f96a 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt @@ -41,10 +41,10 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Constants import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventQueueChanged diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt index 6dddc8120f..fd48ae35fc 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt @@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activatio import androidx.annotation.StringRes import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InitializePodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger import io.reactivex.rxjava3.core.Single diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt index 84bd6add79..60cc0048ea 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt @@ -2,13 +2,13 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.activatio import androidx.annotation.StringRes import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InsertCannulaViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.R import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger import io.reactivex.rxjava3.core.Single diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt index 2fb49cdc22..b18d831771 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt @@ -2,12 +2,12 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.ui.wizard.deactivat import androidx.annotation.StringRes import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.plugins.pump.omnipod.common.R import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.action.DeactivatePodViewModel import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt index 41926f97d0..f45c47b3f3 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt @@ -5,17 +5,17 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.ActivityNames import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager +import info.nightscout.interfaces.pump.defs.PumpType +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.TestAapsSchedulers import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import org.joda.time.DateTimeZone import org.joda.time.tz.UTCProvider import org.junit.Assert diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index 42275f8ca3..bbe9267e45 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -6,7 +6,6 @@ import android.content.ServiceConnection import android.text.format.DateFormat import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -26,8 +25,9 @@ import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.core.fabric.FabricPrivacy -import info.nightscout.interfaces.PluginDescription -import info.nightscout.interfaces.data.PumpEnactResult +import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt index b719e71300..f182e681f0 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsUserEntryFragment.kt @@ -12,7 +12,6 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger @@ -23,7 +22,8 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources -import info.nightscout.interfaces.ImportExportPrefs +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.maintenance.ImportExportPrefs import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.shared.extensions.toVisibility diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index b407ea9ccb..891af79f93 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -8,9 +8,6 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import com.google.common.base.Joiner -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.CommandQueue @@ -30,12 +27,15 @@ import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit -import info.nightscout.interfaces.ActivityNames +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.CarbTimer -import info.nightscout.interfaces.Constraint import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.interfaces.ResourceHelper diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt index 2ca80b0d34..32ecd1c3c1 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt @@ -26,11 +26,11 @@ import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.database.entities.interfaces.end -import info.nightscout.interfaces.ActivityNames import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.VariableSensitivityResult +import info.nightscout.interfaces.aps.VariableSensitivityResult +import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.extensions.toVisibility diff --git a/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 257a6c9c02..7829779b22 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.data.PumpEnactResult import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpEnactResult import info.nightscout.interfaces.pump.defs.ManufacturerType +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.TimeChangeType import org.json.JSONObject From 96a99fc0dbda9aeaade3a9f30e7b156494c4d2cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 13:05:37 +0000 Subject: [PATCH 35/42] chore(deps): bump play-services-location from 20.0.0 to 21.0.1 Bumps play-services-location from 20.0.0 to 21.0.1. --- updated-dependencies: - dependency-name: com.google.android.gms:play-services-location dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2aa7c8b230..aadd30e3e1 100644 --- a/build.gradle +++ b/build.gradle @@ -44,7 +44,7 @@ buildscript { wearable_version = '2.9.0' play_services_wearable_version = '17.1.0' - play_services_location_version = '20.0.0' + play_services_location_version = '21.0.1' } repositories { google() From 821fe884da030292f1f934aa6acce3f4b4028f02 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 14:23:13 +0100 Subject: [PATCH 36/42] update rootbeer lib --- interfaces/build.gradle | 1 - plugins/build.gradle | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/interfaces/build.gradle b/interfaces/build.gradle index 99cb129e22..996cf6c443 100644 --- a/interfaces/build.gradle +++ b/interfaces/build.gradle @@ -26,7 +26,6 @@ dependencies { implementation project(':database:entities') api "androidx.appcompat:appcompat:$appcompat_version" - api "androidx.preference:preference-ktx:$preferencektx_version" // Dagger api "com.google.dagger:dagger:$dagger_version" diff --git a/plugins/build.gradle b/plugins/build.gradle index b2a00d7926..bb31fcebbe 100644 --- a/plugins/build.gradle +++ b/plugins/build.gradle @@ -42,8 +42,7 @@ dependencies { // Phone checker - // updating to 0.0.9 prevents AAPS from build - api 'com.scottyab:rootbeer-lib:0.0.8' + api 'com.scottyab:rootbeer-lib:0.1.0' //SmsCommunicator api 'com.eatthepath:java-otp:0.3.1' From d0a240b4175d6f3d9b13079341e98aa436ededc5 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 14:54:51 +0100 Subject: [PATCH 37/42] IobTotal -> interfaces --- .../androidaps/dialogs/WizardDialog.kt | 1 + .../openAPSAMA/DetermineBasalAdapterAMAJS.kt | 2 +- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 2 +- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 2 +- .../dataBroadcaster/DataBroadcastPlugin.kt | 1 + .../PersistentNotificationPlugin.kt | 1 + .../wear/wearintegration/DataHandlerMobile.kt | 1 + .../IobCobCalculatorPlugin.kt | 7 +- .../androidaps/utils/wizard/BolusWizard.kt | 1 + .../utils/wizard/QuickWizardEntry.kt | 1 + .../PrepareIobAutosensGraphDataWorker.kt | 88 +++++++---- .../utils/wizard/BolusWizardTest.kt | 2 +- .../automation/triggers/TriggerIobTest.kt | 2 +- .../nightscout/androidaps/data/IobTotal.kt | 143 ------------------ .../extensions/ExtendedBolusExtension.kt | 2 +- .../extensions/TemporaryBasalExtension.kt | 2 +- .../DetermineBasalAdapterInterface.kt | 2 +- .../androidaps/interfaces/IobCobCalculator.kt | 2 +- .../androidaps/plugins/aps/loop/APSResult.kt | 2 +- .../plugins/general/overview/OverviewData.kt | 7 +- .../InMemoryGlucoseValueDataPoint.kt | 8 +- .../iob/iobCobCalculator/AutosensDataStore.kt | 4 +- .../nightscout/core/iob/IobTotalExtension.kt | 103 +++++++++++++ .../androidaps/data/IobTotalTest.kt | 1 + .../interfaces/iob}/InMemoryGlucoseValue.kt | 2 +- .../nightscout/interfaces/iob/IobTotal.kt | 19 +++ .../plugins/general/autotune/AutotuneIob.kt | 5 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 1 + .../xdripStatusline/StatusLinePlugin.kt | 1 + .../extensions/DeviceStatusExtension.kt | 1 + .../general/autotune/AutotunePrepTest.kt | 4 +- .../SmsCommunicatorPluginTest.kt | 2 +- .../TreatmentsTemporaryBasalsFragment.kt | 10 +- 33 files changed, 231 insertions(+), 201 deletions(-) delete mode 100644 core/core-main/src/main/java/info/nightscout/androidaps/data/IobTotal.kt create mode 100644 core/core-main/src/main/java/info/nightscout/core/iob/IobTotalExtension.kt rename {core/core-main/src/main/java/info/nightscout/androidaps/data => interfaces/src/main/java/info/nightscout/interfaces/iob}/InMemoryGlucoseValue.kt (89%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/iob/IobTotal.kt diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index ec8f92fc63..c61990bc68 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -34,6 +34,7 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.round import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.Constants diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt index 6a49eb3514..a3e2380f62 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.aps.openAPSAMA import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -17,6 +16,7 @@ import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index 573c11de72..c6b152bbc1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.aps.openAPSSMB import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -18,6 +17,7 @@ import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index d5ce9e2c5e..6bf251e708 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.getPassedDurationToTimeInMinutes import info.nightscout.androidaps.extensions.plannedRemainingMinutes @@ -20,6 +19,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.utils.Round import info.nightscout.rx.logging.AAPSLogger 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 9fe2ab032b..634ef7dc2d 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 @@ -18,6 +18,7 @@ import info.nightscout.androidaps.receivers.Intents import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.round import info.nightscout.interfaces.Config import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index 99dfdd038c..1917e67088 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -18,6 +18,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.round import info.nightscout.interfaces.Constants import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.plugin.PluginBase 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 d08374f055..24485ea475 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 @@ -31,6 +31,7 @@ import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.androidaps.utils.wizard.QuickWizardEntry import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.round import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TemporaryBasal diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index 33997f9a7e..d7d0efa5f2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -4,7 +4,6 @@ import androidx.collection.LongSparseArray import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.events.EventNewHistoryData @@ -21,6 +20,11 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.workflow.CalculationWorkflow import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.combine +import info.nightscout.core.iob.copy +import info.nightscout.core.iob.determineBasalJson +import info.nightscout.core.iob.plus +import info.nightscout.core.iob.round import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal @@ -28,6 +32,7 @@ import info.nightscout.database.entities.interfaces.end import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index 9e687bcfac..4d2566a139 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -20,6 +20,7 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.iob.round import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.TemporaryTarget diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt index a90d319b71..3ea31569ea 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt @@ -8,6 +8,7 @@ import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider +import info.nightscout.core.iob.round import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt index 0ee562bcce..a2d3b6ed61 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareIobAutosensGraphDataWorker.kt @@ -10,13 +10,8 @@ import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.LineGraphSeries import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.data.IobTotal -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.aps.SMBDefaults 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 @@ -27,11 +22,18 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.receivers.DataWorkerStorage -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.core.iob.combine +import info.nightscout.core.iob.copy +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.aps.SMBDefaults +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import kotlin.math.abs import kotlin.math.max @@ -51,9 +53,10 @@ class PrepareIobAutosensGraphDataWorker( @Inject lateinit var repository: AppRepository @Inject lateinit var rxBus: RxBus var ctx: Context + init { (context.applicationContext as HasAndroidInjector).androidInjector().inject(this) - ctx = rh.getThemedCtx(context) + ctx = rh.getThemedCtx(context) } class PrepareIobAutosensData( @@ -61,6 +64,37 @@ class PrepareIobAutosensGraphDataWorker( val overviewData: OverviewData ) + class IobTotalDataPoint(time: Long) : IobTotal(time), DataPointWithLabelInterface { + + constructor(i: IobTotal) : this(i.time) { + iob = i.iob + activity = i.activity + bolussnooze = i.bolussnooze + basaliob = i.basaliob + netbasalinsulin = i.netbasalinsulin + hightempinsulin = i.hightempinsulin + lastBolusTime = i.lastBolusTime + iobWithZeroTemp = i.iobWithZeroTemp?.copy() + netInsulin = i.netInsulin + extendedBolusInsulin = i.extendedBolusInsulin + } + + private var color = 0 + override fun getX(): Double = time.toDouble() + override fun getY(): Double = iob + override fun setY(y: Double) {} + override val label = "" + override val duration = 0L + override val shape = PointsWithLabelGraphSeries.Shape.IOB_PREDICTION + override val size = 0.5f + + override fun color(context: Context?): Int = color + fun setColor(color: Int): IobTotalDataPoint { + this.color = color + return this + } + } + override fun doWork(): Result { val data = dataWorkerStorage.pickupObject(inputData.getLong(DataWorkerStorage.STORE_KEY, -1)) as PrepareIobAutosensData? ?: return Result.failure(workDataOf("Error" to "missing input data")) @@ -157,15 +191,15 @@ class PrepareIobAutosensGraphDataWorker( // DEVIATIONS if (autosensData != null) { - var color = rh.gac( ctx, R.attr.deviationBlackColor) // "=" + var color = rh.gac(ctx, R.attr.deviationBlackColor) // "=" if (autosensData.type == "" || autosensData.type == "non-meal") { - if (autosensData.pastSensitivity == "C") color = rh.gac( ctx, R.attr.deviationGreyColor) - if (autosensData.pastSensitivity == "+") color = rh.gac( ctx, R.attr.deviationGreenColor) - if (autosensData.pastSensitivity == "-") color = rh.gac( ctx, R.attr.deviationRedColor) + if (autosensData.pastSensitivity == "C") color = rh.gac(ctx, R.attr.deviationGreyColor) + if (autosensData.pastSensitivity == "+") color = rh.gac(ctx, R.attr.deviationGreenColor) + if (autosensData.pastSensitivity == "-") color = rh.gac(ctx, R.attr.deviationRedColor) } else if (autosensData.type == "uam") { - color = rh.gac( ctx, R.attr.uamColor) + color = rh.gac(ctx, R.attr.uamColor) } else if (autosensData.type == "csf") { - color = rh.gac( ctx, R.attr.deviationGreyColor) + color = rh.gac(ctx, R.attr.deviationGreyColor) } devArray.add(DeviationDataPoint(time.toDouble(), autosensData.deviation, color, data.overviewData.devScale)) data.overviewData.maxDevValueFound = maxOf(data.overviewData.maxDevValueFound, abs(autosensData.deviation), abs(bgi)) @@ -191,14 +225,14 @@ class PrepareIobAutosensGraphDataWorker( // IOB data.overviewData.iobSeries = FixedLineGraphSeries(Array(iobArray.size) { i -> iobArray[i] }).also { it.isDrawBackground = true - it.backgroundColor = -0x7f000001 and rh.gac( ctx, R.attr.iobColor) //50% - it.color = rh.gac( ctx, R.attr.iobColor) + it.backgroundColor = -0x7f000001 and rh.gac(ctx, R.attr.iobColor) //50% + it.color = rh.gac(ctx, R.attr.iobColor) it.thickness = 3 } data.overviewData.absIobSeries = FixedLineGraphSeries(Array(absIobArray.size) { i -> absIobArray[i] }).also { it.isDrawBackground = true - it.backgroundColor = -0x7f000001 and rh.gac( ctx, R.attr.iobColor) //50% - it.color = rh.gac( ctx, R.attr.iobColor) + it.backgroundColor = -0x7f000001 and rh.gac(ctx, R.attr.iobColor) //50% + it.color = rh.gac(ctx, R.attr.iobColor) it.thickness = 3 } @@ -209,7 +243,7 @@ class PrepareIobAutosensGraphDataWorker( val iobPrediction: MutableList = ArrayList() val iobPredictionArray = data.iobCobCalculator.calculateIobArrayForSMB(lastAutosensResult, SMBDefaults.exercise_mode, SMBDefaults.half_basal_exercise_target, isTempTarget) for (i in iobPredictionArray) { - iobPrediction.add(i.setColor(rh.gac( ctx, R.attr.iobPredASColor))) + iobPrediction.add(IobTotalDataPoint(i).setColor(rh.gac(ctx, R.attr.iobPredASColor))) data.overviewData.maxIobValueFound = max(data.overviewData.maxIobValueFound, abs(i.iob)) } data.overviewData.iobPredictions1Series = PointsWithLabelGraphSeries(Array(iobPrediction.size) { i -> iobPrediction[i] }) @@ -221,8 +255,8 @@ class PrepareIobAutosensGraphDataWorker( // COB data.overviewData.cobSeries = FixedLineGraphSeries(Array(cobArray.size) { i -> cobArray[i] }).also { it.isDrawBackground = true - it.backgroundColor = -0x7f000001 and rh.gac( ctx, R.attr.cobColor) //50% - it.color = rh.gac( ctx, R.attr.cobColor) + it.backgroundColor = -0x7f000001 and rh.gac(ctx, R.attr.cobColor) //50% + it.color = rh.gac(ctx, R.attr.cobColor) it.thickness = 3 } data.overviewData.cobMinFailOverSeries = PointsWithLabelGraphSeries(Array(minFailOverActiveList.size) { i -> minFailOverActiveList[i] }) @@ -230,7 +264,7 @@ class PrepareIobAutosensGraphDataWorker( // ACTIVITY data.overviewData.activitySeries = FixedLineGraphSeries(Array(actArrayHist.size) { i -> actArrayHist[i] }).also { it.isDrawBackground = false - it.color = rh.gac( ctx, R.attr.activityColor) + it.color = rh.gac(ctx, R.attr.activityColor) it.thickness = 3 } data.overviewData.activityPredictionSeries = FixedLineGraphSeries(Array(actArrayPrediction.size) { i -> actArrayPrediction[i] }).also { @@ -238,14 +272,14 @@ class PrepareIobAutosensGraphDataWorker( paint.style = Paint.Style.STROKE paint.strokeWidth = 3f paint.pathEffect = DashPathEffect(floatArrayOf(4f, 4f), 0f) - paint.color = rh.gac( ctx, R.attr.activityColor) + paint.color = rh.gac(ctx, R.attr.activityColor) }) } // BGI data.overviewData.minusBgiSeries = FixedLineGraphSeries(Array(bgiArrayHist.size) { i -> bgiArrayHist[i] }).also { it.isDrawBackground = false - it.color = rh.gac( ctx, R.attr.bgiColor) + it.color = rh.gac(ctx, R.attr.bgiColor) it.thickness = 3 } data.overviewData.minusBgiHistSeries = FixedLineGraphSeries(Array(bgiArrayPrediction.size) { i -> bgiArrayPrediction[i] }).also { @@ -253,7 +287,7 @@ class PrepareIobAutosensGraphDataWorker( paint.style = Paint.Style.STROKE paint.strokeWidth = 3f paint.pathEffect = DashPathEffect(floatArrayOf(4f, 4f), 0f) - paint.color = rh.gac( ctx, R.attr.bgiColor) + paint.color = rh.gac(ctx, R.attr.bgiColor) }) } @@ -264,17 +298,17 @@ class PrepareIobAutosensGraphDataWorker( // RATIO data.overviewData.ratioSeries = LineGraphSeries(Array(ratioArray.size) { i -> ratioArray[i] }).also { - it.color = rh.gac( ctx, R.attr.ratioColor) + it.color = rh.gac(ctx, R.attr.ratioColor) it.thickness = 3 } // DEV SLOPE data.overviewData.dsMaxSeries = LineGraphSeries(Array(dsMaxArray.size) { i -> dsMaxArray[i] }).also { - it.color = rh.gac( ctx, R.attr.devSlopePosColor) + it.color = rh.gac(ctx, R.attr.devSlopePosColor) it.thickness = 3 } data.overviewData.dsMinSeries = LineGraphSeries(Array(dsMinArray.size) { i -> dsMinArray[i] }).also { - it.color = rh.gac( ctx, R.attr.devSlopeNegColor) + it.color = rh.gac(ctx, R.attr.devSlopeNegColor) it.thickness = 3 } rxBus.send(EventIobCalculationProgress(CalculationWorkflow.ProgressData.PREPARE_IOB_AUTOSENS_DATA, 100, null)) 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 5f837ab3cd..f3482a95a3 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 @@ -4,7 +4,6 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints @@ -16,6 +15,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.bus.RxBus diff --git a/automation/src/test/java/info/nightscout/automation/triggers/TriggerIobTest.kt b/automation/src/test/java/info/nightscout/automation/triggers/TriggerIobTest.kt index d5b7d746c1..32033a643d 100644 --- a/automation/src/test/java/info/nightscout/automation/triggers/TriggerIobTest.kt +++ b/automation/src/test/java/info/nightscout/automation/triggers/TriggerIobTest.kt @@ -1,9 +1,9 @@ package info.nightscout.automation.triggers import com.google.common.base.Optional -import info.nightscout.androidaps.data.IobTotal import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator +import info.nightscout.interfaces.iob.IobTotal import org.json.JSONObject import org.junit.Assert import org.junit.Before diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/IobTotal.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/IobTotal.kt deleted file mode 100644 index 3e8c0c383c..0000000000 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/IobTotal.kt +++ /dev/null @@ -1,143 +0,0 @@ -package info.nightscout.androidaps.data - -import android.content.Context -import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface -import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries -import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.Round -import org.json.JSONException -import org.json.JSONObject - -@Suppress("SpellCheckingInspection") -class IobTotal(val time: Long) : DataPointWithLabelInterface { - - var iob = 0.0 - var activity = 0.0 - var bolussnooze = 0.0 - var basaliob = 0.0 - var netbasalinsulin = 0.0 - var hightempinsulin = 0.0 - - // oref1 - var lastBolusTime: Long = 0 - var iobWithZeroTemp: IobTotal? = null - var netInsulin = 0.0 // for calculations from temp basals only - var extendedBolusInsulin = 0.0 // total insulin for extended bolus - fun copy(): IobTotal { - val i = IobTotal(time) - i.iob = iob - i.activity = activity - i.bolussnooze = bolussnooze - i.basaliob = basaliob - i.netbasalinsulin = netbasalinsulin - i.hightempinsulin = hightempinsulin - i.lastBolusTime = lastBolusTime - i.iobWithZeroTemp = iobWithZeroTemp?.copy() - i.netInsulin = netInsulin - i.extendedBolusInsulin = extendedBolusInsulin - return i - } - - operator fun plus(other: IobTotal): IobTotal { - iob += other.iob - activity += other.activity - bolussnooze += other.bolussnooze - basaliob += other.basaliob - netbasalinsulin += other.netbasalinsulin - hightempinsulin += other.hightempinsulin - netInsulin += other.netInsulin - extendedBolusInsulin += other.extendedBolusInsulin - return this - } - - fun round(): IobTotal { - iob = Round.roundTo(iob, 0.001) - activity = Round.roundTo(activity, 0.0001) - bolussnooze = Round.roundTo(bolussnooze, 0.0001) - basaliob = Round.roundTo(basaliob, 0.001) - netbasalinsulin = Round.roundTo(netbasalinsulin, 0.001) - hightempinsulin = Round.roundTo(hightempinsulin, 0.001) - netInsulin = Round.roundTo(netInsulin, 0.001) - extendedBolusInsulin = Round.roundTo(extendedBolusInsulin, 0.001) - return this - } - - fun json(dateUtil: DateUtil): JSONObject { - val json = JSONObject() - try { - json.put("iob", iob) - json.put("basaliob", basaliob) - json.put("activity", activity) - json.put("time", dateUtil.toISOString(time)) - } catch (ignored: JSONException) { - } - return json - } - - fun determineBasalJson(dateUtil: DateUtil): JSONObject { - val json = JSONObject() - try { - json.put("iob", iob) - json.put("basaliob", basaliob) - json.put("bolussnooze", bolussnooze) - json.put("activity", activity) - json.put("lastBolusTime", lastBolusTime) - json.put("time", dateUtil.toISOString(time)) - /* - - This is requested by SMB determine_basal but by based on Scott's info - it's MDT specific safety check only - It's causing rounding issues in determine_basal - - JSONObject lastTemp = new JSONObject(); - lastTemp.put("date", lastTempDate); - lastTemp.put("rate", lastTempRate); - lastTemp.put("duration", lastTempDuration); - json.put("lastTemp", lastTemp); - */ - if (iobWithZeroTemp != null) { - val iwzt = iobWithZeroTemp!!.determineBasalJson(dateUtil) - json.put("iobWithZeroTemp", iwzt) - } - } catch (ignored: JSONException) { - } - return json - } - - // DataPoint interface - private var color = 0 - override fun getX(): Double = time.toDouble() - override fun getY(): Double = iob - override fun setY(y: Double) {} - override val label = "" - override val duration = 0L - override val shape = PointsWithLabelGraphSeries.Shape.IOB_PREDICTION - override val size = 0.5f - - override fun color(context: Context?): Int { - return color - } - - fun setColor(color: Int): IobTotal { - this.color = color - return this - } - - companion object { - - fun combine(bolusIOB: IobTotal, basalIob: IobTotal): IobTotal { - val result = IobTotal(bolusIOB.time) - result.iob = bolusIOB.iob + basalIob.basaliob - result.activity = bolusIOB.activity + basalIob.activity - result.bolussnooze = bolusIOB.bolussnooze - result.basaliob = bolusIOB.basaliob + basalIob.basaliob - result.netbasalinsulin = bolusIOB.netbasalinsulin + basalIob.netbasalinsulin - result.hightempinsulin = basalIob.hightempinsulin + bolusIOB.hightempinsulin - result.netInsulin = basalIob.netInsulin + bolusIOB.netInsulin - result.extendedBolusInsulin = basalIob.extendedBolusInsulin + bolusIOB.extendedBolusInsulin - result.lastBolusTime = bolusIOB.lastBolusTime - result.iobWithZeroTemp = basalIob.iobWithZeroTemp - return result - } - } -} diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt index 5651f1e0a8..c0838d5cb7 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult @@ -9,6 +8,7 @@ import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import kotlin.math.ceil diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt index 1e546136db..229b6e3d01 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult @@ -9,6 +8,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import kotlin.math.ceil diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt index 2ace25add1..c9038b209c 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData interface DetermineBasalAdapterInterface { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt index 3f497a0134..0d9a3d41bc 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.BasalData @@ -8,6 +7,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData import org.json.JSONArray diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt index 7c5b8ca53c..82591b0af5 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.plugins.aps.loop import android.text.Spanned import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.interfaces.ActivePlugin @@ -13,6 +12,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.main.R import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.utils.HtmlHelper.fromHtml import info.nightscout.rx.logging.AAPSLogger diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt index dd4c076fc1..19ff66a822 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt @@ -7,9 +7,6 @@ import androidx.annotation.DrawableRes import com.jjoe64.graphview.series.BarGraphSeries import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.androidaps.data.IobTotal -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.convertedToPercent import info.nightscout.androidaps.extensions.isInProgress import info.nightscout.androidaps.extensions.toStringFull @@ -27,9 +24,13 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.utils.DefaultValueHelper +import info.nightscout.core.iob.round import info.nightscout.core.main.R import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TemporaryTarget +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt index 58ea6df7b6..beb081c4ac 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/InMemoryGlucoseValueDataPoint.kt @@ -1,11 +1,11 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.interfaces.Constants -import info.nightscout.core.main.R -import info.nightscout.androidaps.data.InMemoryGlucoseValue -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.core.main.R +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.iob.InMemoryGlucoseValue import info.nightscout.shared.interfaces.ResourceHelper class InMemoryGlucoseValueDataPoint( diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt index cf78d672d6..1e05ddc5fc 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/AutosensDataStore.kt @@ -3,11 +3,11 @@ package info.nightscout.androidaps.plugins.iob.iobCobCalculator import androidx.collection.LongSparseArray import androidx.collection.size import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.data.InMemoryGlucoseValue -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventBucketedDataCreated import info.nightscout.database.entities.GlucoseValue +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.iob.InMemoryGlucoseValue import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/core/core-main/src/main/java/info/nightscout/core/iob/IobTotalExtension.kt b/core/core-main/src/main/java/info/nightscout/core/iob/IobTotalExtension.kt new file mode 100644 index 0000000000..cd8c3b2041 --- /dev/null +++ b/core/core-main/src/main/java/info/nightscout/core/iob/IobTotalExtension.kt @@ -0,0 +1,103 @@ +package info.nightscout.core.iob + +import info.nightscout.interfaces.iob.IobTotal +import info.nightscout.interfaces.utils.Round +import info.nightscout.shared.utils.DateUtil +import org.json.JSONException +import org.json.JSONObject + +fun IobTotal.copy(): IobTotal { + val i = IobTotal(time) + i.iob = iob + i.activity = activity + i.bolussnooze = bolussnooze + i.basaliob = basaliob + i.netbasalinsulin = netbasalinsulin + i.hightempinsulin = hightempinsulin + i.lastBolusTime = lastBolusTime + i.iobWithZeroTemp = iobWithZeroTemp?.copy() + i.netInsulin = netInsulin + i.extendedBolusInsulin = extendedBolusInsulin + return i +} + +operator fun IobTotal.plus(other: IobTotal): IobTotal { + iob += other.iob + activity += other.activity + bolussnooze += other.bolussnooze + basaliob += other.basaliob + netbasalinsulin += other.netbasalinsulin + hightempinsulin += other.hightempinsulin + netInsulin += other.netInsulin + extendedBolusInsulin += other.extendedBolusInsulin + return this +} + +fun IobTotal.round(): IobTotal { + iob = Round.roundTo(iob, 0.001) + activity = Round.roundTo(activity, 0.0001) + bolussnooze = Round.roundTo(bolussnooze, 0.0001) + basaliob = Round.roundTo(basaliob, 0.001) + netbasalinsulin = Round.roundTo(netbasalinsulin, 0.001) + hightempinsulin = Round.roundTo(hightempinsulin, 0.001) + netInsulin = Round.roundTo(netInsulin, 0.001) + extendedBolusInsulin = Round.roundTo(extendedBolusInsulin, 0.001) + return this +} + +fun IobTotal.json(dateUtil: DateUtil): JSONObject { + val json = JSONObject() + try { + json.put("iob", iob) + json.put("basaliob", basaliob) + json.put("activity", activity) + json.put("time", dateUtil.toISOString(time)) + } catch (ignored: JSONException) { + } + return json +} + +fun IobTotal.determineBasalJson(dateUtil: DateUtil): JSONObject { + val json = JSONObject() + try { + json.put("iob", iob) + json.put("basaliob", basaliob) + json.put("bolussnooze", bolussnooze) + json.put("activity", activity) + json.put("lastBolusTime", lastBolusTime) + json.put("time", dateUtil.toISOString(time)) + /* + + This is requested by SMB determine_basal but by based on Scott's info + it's MDT specific safety check only + It's causing rounding issues in determine_basal + + JSONObject lastTemp = new JSONObject(); + lastTemp.put("date", lastTempDate); + lastTemp.put("rate", lastTempRate); + lastTemp.put("duration", lastTempDuration); + json.put("lastTemp", lastTemp); + */ + if (iobWithZeroTemp != null) { + val iwzt = iobWithZeroTemp!!.determineBasalJson(dateUtil) + json.put("iobWithZeroTemp", iwzt) + } + } catch (ignored: JSONException) { + } + return json +} + +fun IobTotal.Companion.combine(bolusIOB: IobTotal, basalIob: IobTotal): IobTotal { + val result = IobTotal(bolusIOB.time) + result.iob = bolusIOB.iob + basalIob.basaliob + result.activity = bolusIOB.activity + basalIob.activity + result.bolussnooze = bolusIOB.bolussnooze + result.basaliob = bolusIOB.basaliob + basalIob.basaliob + result.netbasalinsulin = bolusIOB.netbasalinsulin + basalIob.netbasalinsulin + result.hightempinsulin = basalIob.hightempinsulin + bolusIOB.hightempinsulin + result.netInsulin = basalIob.netInsulin + bolusIOB.netInsulin + result.extendedBolusInsulin = basalIob.extendedBolusInsulin + bolusIOB.extendedBolusInsulin + result.lastBolusTime = bolusIOB.lastBolusTime + result.iobWithZeroTemp = basalIob.iobWithZeroTemp + return result +} diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt index 84ae1fe96b..8855905c53 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.data import android.content.Context import info.nightscout.androidaps.TestBase +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.shared.utils.DateUtil import org.junit.Assert import org.junit.Before diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt b/interfaces/src/main/java/info/nightscout/interfaces/iob/InMemoryGlucoseValue.kt similarity index 89% rename from core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt rename to interfaces/src/main/java/info/nightscout/interfaces/iob/InMemoryGlucoseValue.kt index 040a191bf6..502936840b 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/InMemoryGlucoseValue.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/iob/InMemoryGlucoseValue.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.data +package info.nightscout.interfaces.iob import info.nightscout.database.entities.GlucoseValue diff --git a/interfaces/src/main/java/info/nightscout/interfaces/iob/IobTotal.kt b/interfaces/src/main/java/info/nightscout/interfaces/iob/IobTotal.kt new file mode 100644 index 0000000000..b15f4210c2 --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/iob/IobTotal.kt @@ -0,0 +1,19 @@ +package info.nightscout.interfaces.iob + +@Suppress("SpellCheckingInspection") +open class IobTotal(val time: Long) { + + var iob = 0.0 + var activity = 0.0 + var bolussnooze = 0.0 + var basaliob = 0.0 + var netbasalinsulin = 0.0 + var hightempinsulin = 0.0 + + // oref1 + var lastBolusTime: Long = 0 + var iobWithZeroTemp: IobTotal? = null + var netInsulin = 0.0 // for calculations from temp basals only + var extendedBolusInsulin = 0.0 // total insulin for extended bolus + companion object +} diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt index 70f3611d92..999a0cf25d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt @@ -1,14 +1,13 @@ package info.nightscout.plugins.general.autotune -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.data.LocalInsulin -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.extensions.durationInMinutes import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toJson import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.core.iob.round import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.ExtendedBolus @@ -16,7 +15,9 @@ import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile 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 acb267c4c1..edb9100927 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 @@ -30,6 +30,7 @@ import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.round import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action diff --git a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt index 9d19e6c95c..b8b441de59 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -12,6 +12,7 @@ import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.iob.round import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index 93acb73248..3650f605e4 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -6,6 +6,7 @@ import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.receivers.ReceiverStatusStore +import info.nightscout.core.iob.json import info.nightscout.database.entities.DeviceStatus import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.shared.utils.DateUtil diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt index 26785eebbe..ef8b98136a 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt @@ -2,11 +2,9 @@ package info.nightscout.plugins.general.autotune import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.extensions.shiftBlock import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.database.entities.Bolus @@ -14,7 +12,9 @@ import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile 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 61fa6f3c8b..6f9dd15f6f 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 @@ -5,7 +5,6 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.androidaps.data.IobTotal import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue @@ -26,6 +25,7 @@ import info.nightscout.database.impl.transactions.Transaction import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 84c10618b8..82eede23eb 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -15,11 +15,6 @@ import androidx.lifecycle.Lifecycle import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.data.IobTotal -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper -import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction -import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalTransaction import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.extensions.toTemporaryBasal @@ -36,6 +31,11 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.database.entities.interfaces.end +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InvalidateExtendedBolusTransaction +import info.nightscout.database.impl.transactions.InvalidateTemporaryBasalTransaction +import info.nightscout.interfaces.iob.IobTotal import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventTempBasalChange From 0442a9ae5b3bb6454798f37193710aefcfec4721 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 14:58:53 +0100 Subject: [PATCH 38/42] LocalInsulin -> autotune --- .../nightscout/androidaps/extensions/BolusExtension.kt | 7 ------- .../nightscout/plugins/general/autotune/AutotuneCore.kt | 4 ++-- .../plugins/general/autotune/AutotuneFragment.kt | 2 +- .../nightscout/plugins/general/autotune/AutotuneIob.kt | 9 +++++++-- .../plugins/general/autotune/AutotunePlugin.kt | 2 +- .../nightscout/plugins/general/autotune/AutotunePrep.kt | 2 +- .../plugins/general/autotune/data/ATProfile.kt | 1 - .../plugins/general/autotune}/data/LocalInsulin.kt | 2 +- .../plugins/general/autotune/AutotuneCoreTest.kt | 2 +- .../plugins/general/autotune/AutotunePrepTest.kt | 2 +- 10 files changed, 15 insertions(+), 18 deletions(-) rename {core/core-main/src/main/java/info/nightscout/androidaps => plugins/src/main/java/info/nightscout/plugins/general/autotune}/data/LocalInsulin.kt (96%) diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt index f2ef7b6bdb..3ff4d80b33 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.database.entities.Bolus @@ -10,10 +9,4 @@ fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob { if (!isValid || type == Bolus.Type.PRIMING ) return Iob() val insulinInterface: Insulin = activePlugin.activeInsulin return insulinInterface.iobCalcForTreatment(this, time, dia) -} - -// Add specific calculation for Autotune (reference localInsulin for Peak/dia) -fun Bolus.iobCalc(time: Long, localInsulin: LocalInsulin): Iob { - if (!isValid || type == Bolus.Type.PRIMING ) return Iob() - return localInsulin.iobCalcForTreatment(this, time) } \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneCore.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneCore.kt index 4f8d3f531d..e43eca07cf 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneCore.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneCore.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.general.autotune -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile +import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.plugins.utils.Percentile import info.nightscout.shared.sharedPreferences.SP -import java.util.* +import java.util.Calendar import javax.inject.Inject import javax.inject.Singleton import kotlin.math.max diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 4f8fd1a4ab..6912e3eb9f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -19,7 +19,6 @@ import android.widget.TableRow import android.widget.TextView import dagger.android.HasAndroidInjector import dagger.android.support.DaggerFragment -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin @@ -38,6 +37,7 @@ import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R import info.nightscout.plugins.databinding.AutotuneFragmentBinding import info.nightscout.plugins.general.autotune.data.ATProfile +import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.events.EventAutotuneUpdateGui import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.rx.AapsSchedulers diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt index 999a0cf25d..cfc929c823 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt @@ -1,8 +1,6 @@ package info.nightscout.plugins.general.autotune -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.extensions.durationInMinutes -import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toJson import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.Profile @@ -17,10 +15,12 @@ import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.iob.Iob import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile +import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.sync.nsclient.extensions.toJson import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -247,6 +247,11 @@ open class AutotuneIob @Inject constructor( open fun getIOB(time: Long, localInsulin: LocalInsulin): IobTotal = getCalculationToTimeTreatments(time, localInsulin).round() + // Add specific calculation for Autotune (reference localInsulin for Peak/dia) + fun Bolus.iobCalc(time: Long, localInsulin: LocalInsulin): Iob { + if (!isValid || type == Bolus.Type.PRIMING ) return Iob() + return localInsulin.iobCalcForTreatment(this, time) + } private fun getCalculationToTimeTreatments(time: Long, localInsulin: LocalInsulin): IobTotal { val total = IobTotal(time) val detailedLog = sp.getBoolean(R.string.key_autotune_additional_log, false) diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index 1398243b9b..93bb41e5b9 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -2,7 +2,6 @@ package info.nightscout.plugins.general.autotune import android.view.View import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Insulin @@ -22,6 +21,7 @@ import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile +import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.plugins.general.autotune.events.EventAutotuneUpdateGui import info.nightscout.plugins.profile.ProfilePlugin diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt index 37792897b3..4a02eb820d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePrep.kt @@ -1,6 +1,5 @@ package info.nightscout.plugins.general.autotune -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.GlucoseValue @@ -11,6 +10,7 @@ import info.nightscout.plugins.general.autotune.data.ATProfile import info.nightscout.plugins.general.autotune.data.BGDatum import info.nightscout.plugins.general.autotune.data.CRDatum import info.nightscout.plugins.general.autotune.data.DiaDeviation +import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.data.PeakDeviation import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.shared.sharedPreferences.SP diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index 3148854abf..7ee238986e 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -1,7 +1,6 @@ package info.nightscout.plugins.general.autotune.data import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.blockValueBySeconds diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt similarity index 96% rename from core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt rename to plugins/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt index e276084525..5f4770d0d9 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/LocalInsulin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/LocalInsulin.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.data +package info.nightscout.plugins.general.autotune.data import info.nightscout.database.entities.Bolus import info.nightscout.interfaces.iob.Iob diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt index fb9a4946c9..71910b1fd7 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt @@ -2,7 +2,6 @@ package info.nightscout.plugins.general.autotune import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile import info.nightscout.database.entities.data.Block @@ -11,6 +10,7 @@ import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile +import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.utils.DateUtil diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt index ef8b98136a..400405ed3c 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt @@ -2,7 +2,6 @@ package info.nightscout.plugins.general.autotune import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile -import info.nightscout.androidaps.data.LocalInsulin import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.shiftBlock @@ -18,6 +17,7 @@ import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile +import info.nightscout.plugins.general.autotune.data.LocalInsulin import info.nightscout.plugins.general.autotune.data.PreppedGlucose import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP From cca40b960673bbfc0a897c1227f3208527ea9b04 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 15:26:28 +0100 Subject: [PATCH 39/42] move to interfaces --- .../androidaps/activities/ProfileHelperActivity.kt | 4 ++-- .../plugins/configBuilder/ConfigBuilderPlugin.kt | 2 +- .../androidaps/plugins/configBuilder/PluginStore.kt | 2 +- .../info/nightscout/androidaps/data/ProfileSealed.kt | 1 + .../main/java/info/nightscout/androidaps/data/Sms.kt | 2 -- .../nightscout/androidaps/extensions/BolusExtension.kt | 2 +- .../androidaps/extensions/ExtendedBolusExtension.kt | 2 +- .../androidaps/extensions/ProfileSwitchExtension.kt | 2 +- .../androidaps/extensions/TemporaryBasalExtension.kt | 2 +- .../nightscout/androidaps/interfaces/ActivePlugin.kt | 1 + .../info/nightscout/androidaps/interfaces/Profile.kt | 8 ++++---- .../nightscout/androidaps/interfaces/ProfileSource.kt | 2 +- .../nightscout/androidaps/interfaces/ProfileStore.kt | 4 ++-- .../info/nightscout/androidaps/data/IobTotalTest.kt | 10 ++++++++-- .../androidaps/interfaces/ProfileStoreTest.kt | 3 +-- .../info/nightscout/interfaces/insulin}/Insulin.kt | 2 +- .../info/nightscout/interfaces/profile}/PureProfile.kt | 2 +- .../plugins/configBuilder/RunningConfiguration.kt | 2 +- .../plugins/general/autotune/AutotunePlugin.kt | 2 +- .../plugins/general/autotune/data/ATProfile.kt | 4 ++-- .../info/nightscout/plugins/insulin/ActivityGraph.kt | 2 +- .../nightscout/plugins/insulin/InsulinLyumjevPlugin.kt | 6 +++--- .../plugins/insulin/InsulinOrefBasePlugin.kt | 2 +- .../plugins/insulin/InsulinOrefFreePeakPlugin.kt | 6 +++--- .../plugins/insulin/InsulinOrefRapidActingPlugin.kt | 6 +++--- .../insulin/InsulinOrefUltraRapidActingPlugin.kt | 6 +++--- .../info/nightscout/plugins/profile/ProfilePlugin.kt | 2 +- .../plugins/general/autotune/AutotuneCoreTest.kt | 2 +- .../plugins/general/autotune/AutotunePrepTest.kt | 2 +- .../plugins/insulin/InsulinLyumjevPluginTest.kt | 6 +++--- .../plugins/insulin/InsulinOrefBasePluginTest.kt | 2 +- .../plugins/insulin/InsulinOrefFreePeakPluginTest.kt | 6 +++--- .../insulin/InsulinOrefRapidActingPluginTest.kt | 6 +++--- .../insulin/InsulinOrefUltraRapidActingPluginTest.kt | 6 +++--- .../nightscout/ui/defaultProfile/DefaultProfile.kt | 10 ++++++---- .../nightscout/ui/defaultProfile/DefaultProfileDPV.kt | 7 ++++--- 36 files changed, 72 insertions(+), 64 deletions(-) delete mode 100644 core/core-main/src/main/java/info/nightscout/androidaps/data/Sms.kt rename {core/core-main/src/main/java/info/nightscout/androidaps/interfaces => interfaces/src/main/java/info/nightscout/interfaces/insulin}/Insulin.kt (95%) rename {core/core-main/src/main/java/info/nightscout/androidaps/data => interfaces/src/main/java/info/nightscout/interfaces/profile}/PureProfile.kt (92%) diff --git a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt index a666b777c7..29bfbb5acb 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/ProfileHelperActivity.kt @@ -10,8 +10,6 @@ import com.google.android.material.tabs.TabLayout import com.google.common.collect.Lists import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.data.PureProfile -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.databinding.ActivityProfilehelperBinding import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin @@ -21,6 +19,8 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.events.EventLocalProfileChanged 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 6d444dcb8b..0d9959f35d 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 @@ -6,7 +6,6 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpSync @@ -18,6 +17,7 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt index 2db9134fcb..54799844d5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt @@ -3,7 +3,6 @@ package info.nightscout.androidaps.plugins.configBuilder import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump @@ -11,6 +10,7 @@ import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.interfaces.Config import info.nightscout.interfaces.Overview import info.nightscout.interfaces.constraints.Safety +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.sync.NsClient diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt index feb2c409e8..1e0e2f4d11 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt @@ -23,6 +23,7 @@ import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/Sms.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/Sms.kt deleted file mode 100644 index f252fa6ef7..0000000000 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/Sms.kt +++ /dev/null @@ -1,2 +0,0 @@ -package info.nightscout.androidaps.data - diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt index 3ff4d80b33..1354b7a890 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.extensions import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.database.entities.Bolus +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.iob.Iob fun Bolus.iobCalc(activePlugin: ActivePlugin, time: Long, dia: Double): Iob { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt index c0838d5cb7..a1582d04ae 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal @@ -8,6 +7,7 @@ import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.iob.IobTotal import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt index e4b873ac12..33f9243544 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt @@ -1,13 +1,13 @@ package info.nightscout.androidaps.utils.extensions import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.extensions.targetBlockFromJsonArray import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.database.entities.ProfileSwitch import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt index 229b6e3d01..a8b4e56c16 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt @@ -1,6 +1,5 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal @@ -8,6 +7,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.iob.IobTotal import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt index e3ecd0741a..ff457dfa41 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.Overview import info.nightscout.interfaces.constraints.Safety +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.sync.NsClient diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt index 2fba1bfdae..d8ee302e25 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt @@ -1,16 +1,16 @@ package info.nightscout.androidaps.interfaces -import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.data.PureProfile -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to1Decimal import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.interfaces.utils.Round import info.nightscout.interfaces.Config +import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.PureProfile +import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.joda.time.DateTime import org.json.JSONObject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt index 55a51588b1..cd7b621c7d 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.data.PureProfile +import info.nightscout.interfaces.profile.PureProfile import org.json.JSONArray interface ProfileSource { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt index 364022fefc..d5d940cf30 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt @@ -3,15 +3,15 @@ package info.nightscout.androidaps.interfaces import androidx.collection.ArrayMap import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.data.PureProfile -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt index 8855905c53..497fe194c6 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/IobTotalTest.kt @@ -2,6 +2,12 @@ package info.nightscout.androidaps.data import android.content.Context import info.nightscout.androidaps.TestBase +import info.nightscout.core.iob.combine +import info.nightscout.core.iob.copy +import info.nightscout.core.iob.determineBasalJson +import info.nightscout.core.iob.json +import info.nightscout.core.iob.plus +import info.nightscout.core.iob.round import info.nightscout.interfaces.iob.IobTotal import info.nightscout.shared.utils.DateUtil import org.junit.Assert @@ -14,8 +20,8 @@ class IobTotalTest : TestBase() { @Mock lateinit var context: Context - lateinit var dateUtil: DateUtil - var now = 0L + private lateinit var dateUtil: DateUtil + private var now = 0L @Before fun prepare() { diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt index 3c9b826862..d880e0905f 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/interfaces/ProfileStoreTest.kt @@ -1,8 +1,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.TestBaseWithProfile -import info.nightscout.androidaps.data.PureProfile -import org.json.JSONObject +import info.nightscout.interfaces.profile.PureProfile import org.junit.Assert import org.junit.Test diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt b/interfaces/src/main/java/info/nightscout/interfaces/insulin/Insulin.kt similarity index 95% rename from core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt rename to interfaces/src/main/java/info/nightscout/interfaces/insulin/Insulin.kt index 5c5ffdd6b2..eca31317b8 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Insulin.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/insulin/Insulin.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces.insulin import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InsulinConfiguration diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt b/interfaces/src/main/java/info/nightscout/interfaces/profile/PureProfile.kt similarity index 92% rename from core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt rename to interfaces/src/main/java/info/nightscout/interfaces/profile/PureProfile.kt index 112640e877..ef9ffffa66 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/PureProfile.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/profile/PureProfile.kt @@ -1,4 +1,4 @@ -package info.nightscout.androidaps.data +package info.nightscout.interfaces.profile import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock diff --git a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt index f7433dbe4d..d63acfd0d6 100644 --- a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt +++ b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.configBuilder import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.core.main.R import info.nightscout.interfaces.Config import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.pump.defs.PumpType diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index 93bb41e5b9..3f796a26af 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -4,7 +4,6 @@ import android.view.View import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore @@ -14,6 +13,7 @@ import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.autotune.Autotune +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index 7ee238986e..2ab6cf945f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -2,10 +2,8 @@ package info.nightscout.plugins.general.autotune.data import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.blockValueBySeconds import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.ProfileStore @@ -14,6 +12,8 @@ import info.nightscout.core.main.R import info.nightscout.database.entities.data.Block import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.shared.SafeParse diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt index 7a1c3321db..beb9055f23 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/ActivityGraph.kt @@ -6,8 +6,8 @@ import android.util.AttributeSet import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.database.entities.Bolus +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.shared.utils.T import kotlin.math.floor diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt index 1eec73b2ee..059169e2e1 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt index bee4df0a77..5300a7e885 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt @@ -1,13 +1,13 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.utils.HardLimits import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.iob.Iob import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt index e98300cb08..903d6143ab 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt @@ -3,14 +3,14 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.putInt import info.nightscout.androidaps.extensions.storeInt -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import javax.inject.Inject diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt index 1fa1929cd4..fdbd18f2db 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt index 43193fd712..740d21eae6 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt @@ -1,14 +1,14 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index 10427a1a9e..c49635672c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -8,7 +8,6 @@ import androidx.work.workDataOf import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile @@ -29,6 +28,7 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt index 71910b1fd7..66b3c4a597 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotuneCoreTest.kt @@ -3,10 +3,10 @@ package info.nightscout.plugins.general.autotune import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.data.PureProfile import info.nightscout.database.entities.data.Block import info.nightscout.database.entities.data.TargetBlock import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile diff --git a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt index 400405ed3c..d571db34fa 100644 --- a/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/general/autotune/AutotunePrepTest.kt @@ -3,7 +3,6 @@ package info.nightscout.plugins.general.autotune import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.data.PureProfile import info.nightscout.androidaps.extensions.shiftBlock import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.database.entities.Bolus @@ -14,6 +13,7 @@ import info.nightscout.database.entities.data.TargetBlock import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.iob.IobTotal +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt index bd285c2499..04ea3c601f 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt @@ -2,14 +2,14 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Rule diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt index 3df05ad905..712a324645 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt @@ -2,12 +2,12 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.HardLimits import info.nightscout.database.entities.Bolus import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt index fb11a045dc..b637b05f7b 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt @@ -3,13 +3,13 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert.assertEquals import org.junit.Before diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt index 20e20fd41f..19821a2fc5 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt @@ -2,14 +2,14 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Rule diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt index 72cd7b7702..7ca00cd442 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt @@ -2,14 +2,14 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Config -import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.utils.HardLimits +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.insulin.Insulin import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Rule diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt index a3d4033636..1fd363c373 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt @@ -1,14 +1,16 @@ package info.nightscout.ui.defaultProfile -import info.nightscout.androidaps.data.PureProfile +import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.Round +import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONObject -import java.util.* +import java.util.Locale +import java.util.TimeZone +import java.util.TreeMap import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt index af3bf2b95c..9d0f0ea1fb 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt @@ -1,14 +1,15 @@ package info.nightscout.ui.defaultProfile import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.data.PureProfile +import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.interfaces.profile.PureProfile import info.nightscout.shared.utils.DateUtil import org.json.JSONArray import org.json.JSONObject -import java.util.* +import java.util.Locale +import java.util.TimeZone import javax.inject.Inject import javax.inject.Singleton From c31bfc7c23fa86d3fe8b176a0ac3d826bf5f8527 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 16:55:18 +0100 Subject: [PATCH 40/42] move profiles to interfaces --- .../configBuilder/ConfigBuilderPlugin.kt | 2 +- .../plugins/configBuilder/PluginStore.kt | 2 +- .../configBuilder/ProfileFunctionImpl.kt | 8 ++++---- .../utils/wizard/QuickWizardEntry.kt | 11 +++++++++- .../androidaps/TestBaseWithProfile.kt | 5 +++-- .../androidaps/data/QuickWizardTest.kt | 12 ++++++++--- .../androidaps/TestBaseWithProfile.kt | 7 ++++--- .../automation/actions/ActionsTestBase.kt | 2 +- .../androidaps/di/CoreDataClassesModule.kt | 4 ++-- .../androidaps/interfaces/ActivePlugin.kt | 1 + .../androidaps/interfaces/Profile.kt | 3 +-- .../androidaps/interfaces/ProfileFunction.kt | 8 +------- .../profile/ProfileStoreObject.kt} | 20 ++++++++++--------- .../androidaps/TestBaseWithProfile.kt | 11 +++++----- .../androidaps/TestBaseWithProfile.kt | 5 +++-- .../interfaces/profile}/ProfileSource.kt | 3 +-- .../interfaces/profile/ProfileStore.kt | 15 ++++++++++++++ .../general/autotune/AutotuneFragment.kt | 7 ++++--- .../general/autotune/AutotunePlugin.kt | 4 ++-- .../general/autotune/data/ATProfile.kt | 5 +++-- .../plugins/profile/ProfilePlugin.kt | 13 ++++++------ .../androidaps/TestBaseWithProfile.kt | 5 +++-- .../SmsCommunicatorPluginTest.kt | 2 +- .../nightscout/androidaps/dana/DanaPump.kt | 15 +++++++------- .../androidaps/TestBaseWithProfile.kt | 5 +++-- .../androidaps/TestBaseWithProfile.kt | 5 +++-- .../androidaps/TestBaseWithProfile.kt | 5 +++-- .../androidaps/TestBaseWithProfile.kt | 5 +++-- 28 files changed, 114 insertions(+), 76 deletions(-) rename core/core-main/src/main/java/info/nightscout/{androidaps/interfaces/ProfileStore.kt => core/profile/ProfileStoreObject.kt} (81%) rename {core/core-main/src/main/java/info/nightscout/androidaps/interfaces => interfaces/src/main/java/info/nightscout/interfaces/profile}/ProfileSource.kt (91%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileStore.kt 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 0d9959f35d..15bb96ffa4 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 @@ -6,7 +6,6 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Sensitivity @@ -21,6 +20,7 @@ import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.interfaces.sync.NsClient import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppInitialized diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt index 54799844d5..eb0b3330f7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt @@ -4,7 +4,6 @@ import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.interfaces.Config @@ -13,6 +12,7 @@ import info.nightscout.interfaces.constraints.Safety import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.interfaces.sync.NsClient import info.nightscout.interfaces.sync.Sync import info.nightscout.rx.logging.AAPSLogger 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 67790fcef0..149e56f8c1 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 @@ -1,22 +1,22 @@ package info.nightscout.androidaps.plugins.configBuilder import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper -import info.nightscout.database.impl.transactions.InsertOrUpdateProfileSwitch import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.fromConstant import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.main.R import info.nightscout.database.entities.ProfileSwitch +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.InsertOrUpdateProfileSwitch import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt index 3ea31569ea..5e7a90f72c 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.utils.wizard import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R +import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop @@ -34,6 +35,14 @@ class QuickWizardEntry @Inject constructor(private val injector: HasAndroidInjec @Inject lateinit var dateUtil: DateUtil @Inject lateinit var glucoseStatusProvider: GlucoseStatusProvider + // for mock + @OpenForTesting + class Time { + fun secondsFromMidnight(): Int = Profile.secondsFromMidnight() + + } + var time = Time() + lateinit var storage: JSONObject var position: Int = -1 @@ -96,7 +105,7 @@ class QuickWizardEntry @Inject constructor(private val injector: HasAndroidInjec return this } - fun isActive(): Boolean = profileFunction.secondsFromMidnight() >= validFrom() && profileFunction.secondsFromMidnight() <= validTo() && forDevice(DEVICE_PHONE) + fun isActive(): Boolean = time.secondsFromMidnight() >= validFrom() && time.secondsFromMidnight() <= validTo() && forDevice(DEVICE_PHONE) fun doCalc(profile: Profile, profileName: String, lastBG: GlucoseValue, _synchronized: Boolean): BolusWizard { val dbRecord = repository.getTemporaryTargetActiveAt(dateUtil.now()).blockingGet() diff --git a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 6e2012ecd1..c02f09ecf8 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -7,12 +7,13 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -172,6 +173,6 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } diff --git a/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt b/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt index 08d00db6eb..00674a1841 100644 --- a/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt @@ -6,9 +6,9 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.androidaps.utils.wizard.QuickWizardEntry +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.junit.Assert import org.junit.Before @@ -28,13 +28,19 @@ class QuickWizardTest : TestBase() { "\"useBG\":0,\"useCOB\":0,\"useBolusIOB\":1,\"useBasalIOB\":2,\"useTrend\":0,\"useSuperBolus\":0,\"useTemptarget\":0}" private var array: JSONArray = JSONArray("[$data1,$data2]") - val injector = HasAndroidInjector { + class MockedTime : QuickWizardEntry.Time() { + override fun secondsFromMidnight() = 0 + } + private val mockedTime = MockedTime() + + private val injector = HasAndroidInjector { AndroidInjector { if (it is QuickWizardEntry) { it.aapsLogger = aapsLogger it.sp = sp it.profileFunction = profileFunction it.loop = loop + it.time = mockedTime } } } @@ -43,7 +49,7 @@ class QuickWizardTest : TestBase() { @Before fun mock() { - `when`(profileFunction.secondsFromMidnight()).thenReturn(0) + `when`(sp.getString(R.string.key_quickwizard, "[]")).thenReturn("[]") quickWizard = QuickWizard(sp, injector) } diff --git a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 19b9e62b99..5f625e2741 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,15 +3,16 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -56,6 +57,6 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } \ No newline at end of file diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index 9b32804c91..1900ec73bd 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -9,7 +9,6 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.triggers.Trigger import info.nightscout.database.entities.OfflineEvent @@ -18,6 +17,7 @@ import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt b/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt index ea01e8ee27..a913c09a03 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/di/CoreDataClassesModule.kt @@ -3,9 +3,9 @@ package info.nightscout.androidaps.di import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData +import info.nightscout.core.profile.ProfileStoreObject @Module @Suppress("unused") @@ -15,5 +15,5 @@ abstract class CoreDataClassesModule { @ContributesAndroidInjector abstract fun apsResultInjector(): APSResult @ContributesAndroidInjector abstract fun autosensDataInjector(): AutosensData - @ContributesAndroidInjector abstract fun profileStoreInjector(): ProfileStore + @ContributesAndroidInjector abstract fun profileStoreInjector(): ProfileStoreObject } diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt index ff457dfa41..ab17476e41 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt @@ -5,6 +5,7 @@ import info.nightscout.interfaces.constraints.Safety import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.interfaces.sync.NsClient import info.nightscout.interfaces.sync.Sync diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt index d8ee302e25..8435ac7026 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt @@ -152,8 +152,7 @@ interface Profile { } fun milliSecFromMidnight(date: Long): Long { - val passed = DateTime(date).millisOfDay.toLong() - return passed + return DateTime(date).millisOfDay.toLong() } /* * Units conversion diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt index fe1109cf19..29d7dbef52 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.database.entities.ProfileSwitch import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.ProfileStore interface ProfileFunction { @@ -89,11 +90,4 @@ interface ProfileFunction { * @return true if profile switch is created */ fun createProfileSwitch(durationInMinutes: Int, percentage: Int, timeShiftInHours: Int): Boolean - - /* - * Midnight time conversion - * (here as well for easy mock) - */ - fun secondsFromMidnight(): Int = Profile.secondsFromMidnight() - fun secondsFromMidnight(date: Long): Int = Profile.secondsFromMidnight(date) } \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt b/core/core-main/src/main/java/info/nightscout/core/profile/ProfileStoreObject.kt similarity index 81% rename from core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt rename to core/core-main/src/main/java/info/nightscout/core/profile/ProfileStoreObject.kt index d5d940cf30..2c6b42118e 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileStore.kt +++ b/core/core-main/src/main/java/info/nightscout/core/profile/ProfileStoreObject.kt @@ -1,11 +1,13 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.core.profile import androidx.collection.ArrayMap import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.bus.RxBus @@ -16,7 +18,7 @@ import org.json.JSONException import org.json.JSONObject import javax.inject.Inject -class ProfileStore(val injector: HasAndroidInjector, val data: JSONObject, val dateUtil: DateUtil) { +class ProfileStoreObject(val injector: HasAndroidInjector, override val data: JSONObject, val dateUtil: DateUtil) : ProfileStore { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var activePlugin: ActivePlugin @@ -42,7 +44,7 @@ class ProfileStore(val injector: HasAndroidInjector, val data: JSONObject, val d return null } - fun getStartDate(): Long { + override fun getStartDate(): Long { val iso = JsonHelper.safeGetString(data, "startDate") ?: return 0 return try { dateUtil.fromISODateString(iso) @@ -51,15 +53,15 @@ class ProfileStore(val injector: HasAndroidInjector, val data: JSONObject, val d } } - fun getDefaultProfile(): PureProfile? = getDefaultProfileName()?.let { getSpecificProfile(it) } - fun getDefaultProfileJson(): JSONObject? = getDefaultProfileName()?.let { getSpecificProfileJson(it) } + override fun getDefaultProfile(): PureProfile? = getDefaultProfileName()?.let { getSpecificProfile(it) } + override fun getDefaultProfileJson(): JSONObject? = getDefaultProfileName()?.let { getSpecificProfileJson(it) } - fun getDefaultProfileName(): String? { + override fun getDefaultProfileName(): String? { val defaultProfileName = data.optString("defaultProfile") return if (defaultProfileName.isNotEmpty()) getStore()?.has(defaultProfileName)?.let { defaultProfileName } else null } - fun getProfileList(): ArrayList { + override fun getProfileList(): ArrayList { val ret = ArrayList() getStore()?.keys()?.let { keys -> while (keys.hasNext()) { @@ -71,7 +73,7 @@ class ProfileStore(val injector: HasAndroidInjector, val data: JSONObject, val d } @Synchronized - fun getSpecificProfile(profileName: String): PureProfile? { + override fun getSpecificProfile(profileName: String): PureProfile? { var profile: PureProfile? = null val units = JsonHelper.safeGetStringAllowNull(data, "units", storeUnits()) getStore()?.let { store -> @@ -96,7 +98,7 @@ class ProfileStore(val injector: HasAndroidInjector, val data: JSONObject, val d return null } - val allProfilesValid: Boolean + override val allProfilesValid: Boolean get() = getProfileList() .asSequence() .map { profileName -> getSpecificProfile(profileName.toString()) } diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 30c77bf184..eef46d8a41 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -7,12 +7,13 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP @@ -41,7 +42,7 @@ open class TestBaseWithProfile : TestBase() { val profileInjector = HasAndroidInjector { AndroidInjector { - if (it is ProfileStore) { + if (it is ProfileStoreObject) { it.aapsLogger = aapsLogger it.activePlugin = activePluginProvider it.config = config @@ -77,7 +78,7 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } fun getInvalidProfileStore1(): ProfileStore { @@ -86,7 +87,7 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(invalidProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } fun getInvalidProfileStore2(): ProfileStore { @@ -96,6 +97,6 @@ open class TestBaseWithProfile : TestBase() { store.put("invalid", JSONObject(invalidProfileJSON)) json.put("defaultProfile", TESTPROFILENAME + "invalid") json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 6e2012ecd1..c02f09ecf8 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -7,12 +7,13 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -172,6 +173,6 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt b/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileSource.kt similarity index 91% rename from core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt rename to interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileSource.kt index cd7b621c7d..618db557c5 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileSource.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileSource.kt @@ -1,7 +1,6 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces.profile import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.profile.PureProfile import org.json.JSONArray interface ProfileSource { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileStore.kt b/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileStore.kt new file mode 100644 index 0000000000..43174e6af6 --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/profile/ProfileStore.kt @@ -0,0 +1,15 @@ +package info.nightscout.interfaces.profile + +import org.json.JSONObject + +interface ProfileStore { + val data: JSONObject + + fun getStartDate(): Long + fun getDefaultProfile(): PureProfile? + fun getDefaultProfileJson(): JSONObject? + fun getDefaultProfileName(): String? + fun getProfileList(): ArrayList + fun getSpecificProfile(profileName: String): PureProfile? + val allProfilesValid: Boolean +} \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index 6912e3eb9f..bad815109a 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -24,14 +24,15 @@ import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R @@ -96,7 +97,7 @@ class AutotuneFragment : DaggerFragment() { if (autotunePlugin.lastNbDays.isEmpty()) autotunePlugin.lastNbDays = sp.getInt(R.string.key_autotune_default_tune_days, 5).toString() val defaultValue = sp.getInt(R.string.key_autotune_default_tune_days, 5).toDouble() - profileStore = activePlugin.activeProfileSource.profile ?: ProfileStore(injector, JSONObject(), dateUtil) + profileStore = activePlugin.activeProfileSource.profile ?: ProfileStoreObject(injector, JSONObject(), dateUtil) profileName = if (binding.profileList.text.toString() == rh.gs(R.string.active)) "" else binding.profileList.text.toString() profileFunction.getProfile()?.let { currentProfile -> profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?: currentProfile, LocalInsulin(""), injector) @@ -297,7 +298,7 @@ class AutotuneFragment : DaggerFragment() { @Synchronized private fun updateGui() { _binding ?: return - profileStore = activePlugin.activeProfileSource.profile ?: ProfileStore(injector, JSONObject(), dateUtil) + profileStore = activePlugin.activeProfileSource.profile ?: ProfileStoreObject(injector, JSONObject(), dateUtil) profileName = if (binding.profileList.text.toString() == rh.gs(R.string.active)) "" else binding.profileList.text.toString() profileFunction.getProfile()?.let { currentProfile -> profile = ATProfile(profileStore.getSpecificProfile(profileName)?.let { ProfileSealed.Pure(it) } ?: currentProfile, LocalInsulin(""), injector) diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index 3f796a26af..ef577a1e64 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -6,9 +6,9 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.BuildHelper @@ -325,7 +325,7 @@ class AutotunePlugin @Inject constructor( fun updateProfile(newProfile: ATProfile?) { if (newProfile == null) return val circadian = sp.getBoolean(R.string.key_autotune_circadian_ic_isf, false) - val profileStore = activePlugin.activeProfileSource.profile ?: ProfileStore(injector, JSONObject(), dateUtil) + val profileStore = activePlugin.activeProfileSource.profile ?: ProfileStoreObject(injector, JSONObject(), dateUtil) val profileList: ArrayList = profileStore.getProfileList() var indexLocalProfile = -1 for (p in profileList.indices) diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index 2ab6cf945f..bd24b36cf0 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -6,13 +6,14 @@ import info.nightscout.androidaps.extensions.blockValueBySeconds import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.main.R +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.data.Block import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus @@ -177,7 +178,7 @@ class ATProfile(profile: Profile, var localInsulin: LocalInsulin, val injector: json.put("defaultProfile", profilename) json.put("store", store) json.put("startDate", dateUtil.toISOAsUTC(dateUtil.now())) - profileStore = ProfileStore(injector, json, dateUtil) + profileStore = ProfileStoreObject(injector, json, dateUtil) } catch (e: JSONException) { } return profileStore diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index c49635672c..1a2ad4d0a2 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -12,8 +12,6 @@ import info.nightscout.androidaps.extensions.blockFromJsonArray import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileSource -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DecimalFormatter @@ -21,6 +19,7 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit @@ -28,6 +27,8 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.ProfileSource +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R @@ -72,7 +73,7 @@ class ProfilePlugin @Inject constructor( aapsLogger, rh, injector ), ProfileSource { - private var rawProfile: ProfileStore? = null + private var rawProfile: ProfileStoreObject? = null private val defaultArray = "[{\"time\":\"00:00\",\"timeAsSeconds\":0,\"value\":0}]" @@ -388,7 +389,7 @@ class ProfilePlugin @Inject constructor( isEdited = false } - fun createProfileStore(): ProfileStore { + fun createProfileStore(): ProfileStoreObject { val json = JSONObject() val store = JSONObject() @@ -417,7 +418,7 @@ class ProfilePlugin @Inject constructor( aapsLogger.error("Unhandled exception", e) } - return ProfileStore(injector, json, dateUtil) + return ProfileStoreObject(injector, json, dateUtil) } override val profile: ProfileStore? @@ -453,7 +454,7 @@ class ProfilePlugin @Inject constructor( ?: return Result.failure(workDataOf("Error" to "missing input data")) xDripBroadcast.sendProfile(profileJson) if (sp.getBoolean(R.string.key_ns_receive_profile_store, true) || config.NSCLIENT) { - val store = ProfileStore(injector, profileJson, dateUtil) + val store = ProfileStoreObject(injector, profileJson, dateUtil) val createdAt = store.getStartDate() val lastLocalChange = sp.getLong(R.string.key_local_profile_last_change, 0) aapsLogger.debug(LTag.PROFILE, "Received profileStore: createdAt: $createdAt Local last modification: $lastLocalChange") diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 6e2012ecd1..c02f09ecf8 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -7,12 +7,13 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -172,6 +173,6 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } 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 6f9dd15f6f..f792b94d68 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 @@ -10,7 +10,6 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.ProfileSource import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore @@ -27,6 +26,7 @@ import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt index 9e359cca39..81965fc034 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt @@ -1,18 +1,19 @@ package info.nightscout.androidaps.dana import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.shared.utils.T +import info.nightscout.core.profile.ProfileStoreObject +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.ProfileStore +import info.nightscout.interfaces.pump.defs.PumpType +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import org.joda.time.DateTime import org.joda.time.DateTimeZone import org.json.JSONArray @@ -380,7 +381,7 @@ class DanaPump @Inject constructor( } catch (e: Exception) { return null } - return ProfileStore(injector, json, dateUtil) + return ProfileStoreObject(injector, json, dateUtil) } return null } diff --git a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 9231da44ec..01315c2b72 100644 --- a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -6,11 +6,12 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -58,6 +59,6 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 6a8937c4af..c166eb31dc 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -7,10 +7,11 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -152,6 +153,6 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 27d702dd8a..2d798bb73f 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -6,11 +6,12 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -54,6 +55,6 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } diff --git a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 6e2012ecd1..c02f09ecf8 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -7,12 +7,13 @@ import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.ProfileStore import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -172,6 +173,6 @@ open class TestBaseWithProfile : TestBase() { store.put(TESTPROFILENAME, JSONObject(validProfileJSON)) json.put("defaultProfile", TESTPROFILENAME) json.put("store", store) - return ProfileStore(profileInjector, json, dateUtil) + return ProfileStoreObject(profileInjector, json, dateUtil) } } From 73f876a45da78a5b5246b66207f2aa11e3e886be Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 19:27:04 +0100 Subject: [PATCH 41/42] move to interfaces --- .../activities/MyPreferenceFragment.kt | 3 +- .../nightscout/androidaps/di/AppModule.kt | 4 +- .../androidaps/dialogs/InsulinDialog.kt | 3 +- .../androidaps/dialogs/ProfileSwitchDialog.kt | 9 +- .../androidaps/dialogs/TempBasalDialog.kt | 2 +- .../androidaps/dialogs/TempTargetDialog.kt | 12 +- .../androidaps/dialogs/WizardDialog.kt | 4 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 6 +- .../openAPSAMA/DetermineBasalAdapterAMAJS.kt | 2 +- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 5 +- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 2 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 5 +- .../DetermineBasalAdapterSMBDynamicISFJS.kt | 3 +- .../OpenAPSSMBDynamicISFPlugin.kt | 10 +- .../configBuilder/ConfigBuilderPlugin.kt | 4 +- .../plugins/configBuilder/PluginStore.kt | 2 +- .../configBuilder/ProfileFunctionImpl.kt | 6 +- .../constraints/safety/SafetyPlugin.kt | 4 +- .../maintenance/MaintenanceFragment.kt | 2 +- .../general/overview/OverviewFragment.kt | 5 +- .../PersistentNotificationPlugin.kt | 3 +- .../wear/wearintegration/DataHandlerMobile.kt | 7 +- .../IobCobCalculatorPlugin.kt | 2 +- .../sensitivity/SensitivityAAPSPlugin.kt | 5 +- .../sensitivity/SensitivityOref1Plugin.kt | 5 +- .../SensitivityWeightedAveragePlugin.kt | 5 +- .../androidaps/plugins/source/DexcomPlugin.kt | 3 +- .../receivers/TimeDateOrTZChangeReceiver.kt | 2 +- .../androidaps/setupwizard/SWDefinition.kt | 2 +- .../elements/SWEditNumberWithUnits.kt | 7 +- .../utils/extensions/DoubleToSignedString.kt | 2 +- .../androidaps/utils/wizard/BolusWizard.kt | 6 +- .../utils/wizard/QuickWizardEntry.kt | 3 +- .../workflow/PrepareBgDataWorker.kt | 8 +- .../PrepareTemporaryTargetDataWorker.kt | 9 +- .../workflow/PrepareTreatmentsDataWorker.kt | 5 +- .../androidaps/TestBaseWithProfile.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +- .../interfaces/ConstraintsCheckerTest.kt | 6 +- .../configBuilder/ConfigBuilderPluginTest.kt | 4 +- .../constraints/safety/SafetyPluginTest.kt | 43 ++-- .../utils/wizard/BolusWizardTest.kt | 2 +- .../actions/ActionStartTempTarget.kt | 7 +- .../automation/elements/InputTime.kt | 7 +- .../automation/elements/InputTimeRange.kt | 7 +- .../automation/triggers/TriggerBg.kt | 10 +- .../automation/triggers/TriggerDelta.kt | 10 +- .../triggers/TriggerRecurringTime.kt | 8 +- .../triggers/TriggerTempTargetValue.kt | 12 +- .../automation/triggers/TriggerTimeRange.kt | 8 +- .../androidaps/TestBaseWithProfile.kt | 4 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +- .../automation/actions/ActionsTestBase.kt | 2 +- .../androidaps/data/ProfileSealed.kt | 111 ++++----- .../androidaps/dialogs/ProfileViewerDialog.kt | 22 +- .../BolusCalculatorResultExtension.kt | 3 +- .../extensions/ExtendedBolusExtension.kt | 10 +- .../extensions/GlucoseValueExtension.kt | 1 + .../extensions/ProfileSwitchExtension.kt | 8 +- .../extensions/TemporaryBasalExtension.kt | 13 +- .../extensions/TemporaryTargetExtension.kt | 3 +- .../androidaps/interfaces/ActivePlugin.kt | 1 + .../androidaps/interfaces/CommandQueue.kt | 6 +- .../androidaps/interfaces/Constraints.kt | 1 + .../DetermineBasalAdapterInterface.kt | 1 + .../androidaps/interfaces/IobCobCalculator.kt | 1 + .../nightscout/androidaps/interfaces/Loop.kt | 1 + .../androidaps/interfaces/Profile.kt | 212 ------------------ .../androidaps/interfaces/ProfileFunction.kt | 1 + .../graphExtensions/GlucoseValueDataPoint.kt | 3 +- .../graphExtensions/TherapyEventDataPoint.kt | 4 +- .../common/bolusInfo/TemporaryBasalStorage.kt | 4 +- .../androidaps/utils/DecimalFormatter.kt | 2 +- .../androidaps/utils/DefaultValueHelper.kt | 9 +- .../textValidator/DefaultEditTextValidator.kt | 35 ++- .../ValidatingEditTextPreference.kt | 6 +- .../validators/BgRangeValidator.kt | 3 +- .../androidaps/utils/ui/BasalProfileGraph.kt | 2 +- .../androidaps/utils/ui/IcProfileGraph.kt | 2 +- .../androidaps/utils/ui/IsfProfileGraph.kt | 3 +- .../utils/ui/TargetBgProfileGraph.kt | 7 +- .../userEntry/UserEntryPresentationHelper.kt | 3 +- .../core/profile/ProfileExtension.kt | 80 +++++++ .../core/profile/ProfileStoreObject.kt | 4 +- .../core/pumpExtensions/PumpStateExtension.kt | 4 +- .../androidaps/TestBaseWithProfile.kt | 9 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +- .../nightscout/androidaps/data/ProfileTest.kt | 25 ++- .../bolusInfo/TemporaryBasalStorageTest.kt | 2 +- .../implementation/HardLimitsImpl.kt | 36 +-- .../constraints/ConstraintsImpl.kt | 2 +- .../implementation/di/ImplementationModule.kt | 15 +- .../pump/PumpSyncImplementation.kt | 2 +- .../queue/CommandQueueImplementation.kt | 6 +- .../queue/commands/CommandSetProfile.kt | 2 +- .../commands/CommandTempBasalAbsolute.kt | 7 +- .../queue/commands/CommandTempBasalPercent.kt | 7 +- .../implementation/stats/DexcomTirImpl.kt | 10 +- .../implementation/stats/TirCalculatorImpl.kt | 15 +- .../androidaps/TestBaseWithProfile.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +- .../queue/CommandQueueImplementationTest.kt | 2 +- .../implementation/queue/QueueThreadTest.kt | 2 +- .../pump/insight/LocalInsightPlugin.java | 8 +- .../activities/InsightPairingActivity.java | 4 +- .../nightscout/interfaces/profile/Profile.kt | 138 ++++++++++++ .../info/nightscout/interfaces/pump}/Pump.kt | 11 +- .../nightscout/interfaces/pump}/PumpSync.kt | 16 +- .../nightscout/interfaces/utils/HardLimits.kt | 47 ++++ .../configBuilder/RunningConfiguration.kt | 2 +- .../general/autotune/AutotuneFragment.kt | 3 +- .../plugins/general/autotune/AutotuneIob.kt | 5 +- .../general/autotune/AutotunePlugin.kt | 4 +- .../general/autotune/data/ATProfile.kt | 6 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 7 +- .../xdripStatusline/StatusLinePlugin.kt | 3 +- .../plugins/insulin/InsulinLyumjevPlugin.kt | 2 +- .../plugins/insulin/InsulinOrefBasePlugin.kt | 2 +- .../insulin/InsulinOrefFreePeakPlugin.kt | 2 +- .../insulin/InsulinOrefRapidActingPlugin.kt | 2 +- .../InsulinOrefUltraRapidActingPlugin.kt | 2 +- .../plugins/profile/ProfileFragment.kt | 5 +- .../plugins/profile/ProfilePlugin.kt | 7 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 6 +- .../extensions/DeviceStatusExtension.kt | 2 +- .../EffectiveProfileSwitchExtension.kt | 2 +- .../extensions/ExtendedBolusExtension.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 6 +- .../extensions/TemporaryBasalExtension.kt | 2 +- .../extensions/TemporaryTargetExtension.kt | 4 +- .../EffectiveProfileSwitchExtension.kt | 2 +- .../extensions/ProfileSwitchExtension.kt | 4 +- .../sync/tidepool/elements/BasalElement.kt | 2 +- .../tidepool/elements/BloodGlucoseElement.kt | 3 +- .../sync/tidepool/elements/ProfileElement.kt | 2 +- .../androidaps/TestBaseWithProfile.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +- .../insulin/InsulinLyumjevPluginTest.kt | 2 +- .../insulin/InsulinOrefBasePluginTest.kt | 2 +- .../insulin/InsulinOrefFreePeakPluginTest.kt | 2 +- .../InsulinOrefRapidActingPluginTest.kt | 2 +- .../InsulinOrefUltraRapidActingPluginTest.kt | 2 +- .../pump/virtual/VirtualPumpPluginUTest.kt | 2 +- .../plugins/pump/combo/ComboPlugin.java | 6 +- .../plugins/pump/combo/ComboPluginTest.kt | 2 +- .../androidaps/dana/DanaFragment.kt | 2 +- .../nightscout/androidaps/dana/DanaPump.kt | 4 +- .../dana/activities/DanaHistoryActivity.kt | 3 +- .../androidaps/TestBaseWithProfile.kt | 4 +- .../danaRKorean/DanaRKoreanPlugin.kt | 6 +- .../services/DanaRKoreanExecutionService.java | 4 +- .../androidaps/danaRv2/DanaRv2Plugin.java | 4 +- .../services/DanaRv2ExecutionService.java | 6 +- .../androidaps/danar/AbstractDanaRPlugin.java | 6 +- .../androidaps/danar/DanaRPlugin.java | 4 +- .../androidaps/danar/comm/MessageBase.kt | 8 +- .../AbstractDanaRExecutionService.java | 4 +- .../danar/services/DanaRExecutionService.java | 4 +- .../androidaps/TestBaseWithProfile.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +- .../plugins/pump/danaR/DanaRPluginTest.kt | 2 +- .../plugins/pump/danaR/comm/DanaRTestBase.kt | 8 +- .../pump/danaRKorean/DanaRKoreanPluginTest.kt | 2 +- .../plugins/pump/danaRv2/DanaRv2PluginTest.kt | 2 +- .../androidaps/danars/DanaRSPlugin.kt | 6 +- .../comm/DanaRSPacketAPSHistoryEvents.kt | 8 +- .../comm/DanaRSPacketBolusSet24CIRCFArray.kt | 3 +- .../danars/comm/DanaRSPacketHistory.kt | 4 +- .../danars/comm/DanaRSPacketNotifyAlarm.kt | 4 +- .../androidaps/danars/services/BLEComm.kt | 10 +- .../danars/services/DanaRSService.kt | 4 +- .../androidaps/TestBaseWithProfile.kt | 4 +- .../androidaps/danars/DanaRSPluginTest.kt | 2 +- .../comm/DanaRsPacketApsHistoryEventsTest.kt | 5 +- .../DanaRsPacketBolusSetStepBolusStartTest.kt | 2 +- .../comm/DanaRsPacketNotifyAlarmTest.kt | 2 +- ...naRsPacketNotifyDeliveryRateDisplayTest.kt | 4 +- .../androidaps/diaconn/DiaconnG8Fragment.kt | 2 +- .../androidaps/diaconn/DiaconnG8Plugin.kt | 6 +- .../androidaps/diaconn/DiaconnG8Pump.kt | 10 +- .../packet/BigLogInquireResponsePacket.kt | 12 +- .../diaconn/service/DiaconnG8Service.kt | 4 +- .../plugins/pump/eopatch/EopatchPumpPlugin.kt | 6 +- .../pump/eopatch/alarm/AlarmManager.kt | 2 +- .../pump/eopatch/ble/PatchManager.java | 10 +- .../pump/eopatch/ble/PatchManagerImpl.java | 6 +- .../ble/task/InternalSuspendedTask.java | 4 +- .../pump/eopatch/ble/task/PauseBasalTask.java | 4 +- .../pump/eopatch/ble/task/StopBasalTask.java | 4 +- .../ui/viewmodel/EopatchOverviewViewModel.kt | 10 +- .../pump/eopatch/vo/NormalBasalManager.kt | 4 +- .../pump/medtronic/MedtronicFragment.kt | 2 +- .../pump/medtronic/MedtronicPumpPlugin.kt | 8 +- .../medtronic/data/MedtronicHistoryData.kt | 6 +- .../info/nightscout/androidaps/TestBase.kt | 2 +- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 6 +- .../pump/omnipod/dash/history/data/Record.kt | 2 +- .../dash/history/database/Converters.kt | 2 +- .../action/DashInsertCannulaViewModel.kt | 2 +- .../pump/omnipod/dash/util/Functions.kt | 5 +- .../pump/omnipod/dash/util/FunctionsTest.kt | 4 +- .../omnipod/eros/OmnipodErosPumpPlugin.java | 6 +- .../eros/manager/AapsOmnipodErosManager.java | 4 +- .../eros/ui/ErosPodHistoryActivity.java | 6 +- .../omnipod/eros/OmnipodErosPumpPluginTest.kt | 4 +- .../AapsOmnipodErosManagerTest.java | 2 +- .../plugins/pump/common/PumpPluginAbstract.kt | 8 +- .../pump/common/di/PumpCommonModule.kt | 2 +- .../plugins/pump/common/sync/PumpDbEntry.kt | 2 +- .../pump/common/sync/PumpSyncStorage.kt | 2 +- .../plugins/pump/common/utils/ProfileUtil.kt | 6 +- .../TreatmentsProfileSwitchFragment.kt | 6 +- .../ui/defaultProfile/DefaultProfile.kt | 20 +- .../ui/defaultProfile/DefaultProfileDPV.kt | 6 +- .../ui/dialogs/CalibrationDialog.kt | 4 +- .../info/nightscout/ui/dialogs/CarbsDialog.kt | 3 +- .../info/nightscout/ui/dialogs/CareDialog.kt | 8 +- .../nightscout/ui/dialogs/WizardInfoDialog.kt | 4 +- .../java/info/nightscout/ui/widget/Widget.kt | 5 +- .../androidaps/TestBaseWithProfile.kt | 2 +- .../nightscout/androidaps/TestPumpPlugin.kt | 6 +- 221 files changed, 971 insertions(+), 771 deletions(-) delete mode 100644 core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt create mode 100644 core/core-main/src/main/java/info/nightscout/core/profile/ProfileExtension.kt rename core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt => implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt (76%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/profile/Profile.kt rename {core/core-main/src/main/java/info/nightscout/androidaps/interfaces => interfaces/src/main/java/info/nightscout/interfaces/pump}/Pump.kt (96%) rename {core/core-main/src/main/java/info/nightscout/androidaps/interfaces => interfaces/src/main/java/info/nightscout/interfaces/pump}/PumpSync.kt (96%) create mode 100644 interfaces/src/main/java/info/nightscout/interfaces/utils/HardLimits.kt 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 b50279df35..be0c389c45 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -23,7 +23,6 @@ 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.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugin.general.openhumans.OpenHumansUploader import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin @@ -56,8 +55,10 @@ 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.core.profile.toCurrentUnits import info.nightscout.interfaces.Config import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.general.autotune.AutotunePlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.general.xdripStatusline.StatusLinePlugin 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 af89d8eca5..c061af79f2 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppModule.kt @@ -15,7 +15,6 @@ import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.interfaces.stats.DexcomTirCalculator @@ -28,7 +27,6 @@ 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.utils.HardLimits import info.nightscout.androidaps.utils.androidNotification.NotificationHolderImpl import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.androidaps.utils.buildHelper.ConfigImpl @@ -58,11 +56,13 @@ import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.autotune.Autotune import info.nightscout.interfaces.maintenance.ImportExportPrefs import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.interfaces.storage.FileStorage import info.nightscout.interfaces.storage.Storage import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.interfaces.ui.IconsProvider +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.general.autotune.AutotunePlugin import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.sync.nsclient.DataSyncSelectorImplementation diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index 36e10be75a..ccb5ca7e61 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -14,7 +14,6 @@ import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DecimalFormatter @@ -24,6 +23,7 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.toSignedString import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.core.profile.toMgdl import info.nightscout.core.pumpExtensions.insertBolusTransaction import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action @@ -35,6 +35,7 @@ import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.ui.ActivityNames diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt index cda87b566e..76247624be 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt @@ -11,25 +11,26 @@ import android.widget.ArrayAdapter import com.google.common.base.Joiner import info.nightscout.androidaps.R import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogProfileswitchBinding import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.core.profile.toMgdl import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index 779eb8a0fe..4f3e3b6e39 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -13,7 +13,6 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog @@ -23,6 +22,7 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.ui.ActivityNames diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index 244625183b..b96fb82424 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -9,13 +9,8 @@ import android.widget.ArrayAdapter import com.google.common.base.Joiner import com.google.common.collect.Lists import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper -import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogTemptargetBinding import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DefaultValueHelper @@ -23,12 +18,19 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.core.profile.toCurrentUnitsString +import info.nightscout.core.profile.toMgdl import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.database.impl.transactions.CancelCurrentTemporaryTargetIfAnyTransaction +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.interfaces.ResourceHelper diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index c61990bc68..9a2bee2930 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -26,7 +26,6 @@ import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.ToastUtils @@ -35,11 +34,14 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BO import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.round +import info.nightscout.core.profile.toMgdl +import info.nightscout.core.profile.toUnitsString import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers 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 c015aa4a30..4edc518e93 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 @@ -26,9 +26,7 @@ import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.Loop.LastRun -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopSetLastRunGui import info.nightscout.androidaps.plugins.aps.loop.events.EventLoopUpdateGui @@ -36,7 +34,6 @@ import info.nightscout.androidaps.plugins.aps.loop.events.EventNewOpenLoopNotifi import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.receivers.ReceiverStatusStore -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.buildDeviceStatus import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.OfflineEvent @@ -54,10 +51,13 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.ui.ActivityNames +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.configBuilder.RunningConfiguration import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.AapsSchedulers diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt index a3e2380f62..7182964b34 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt @@ -8,7 +8,6 @@ import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.APSResult @@ -18,6 +17,7 @@ import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData +import info.nightscout.interfaces.profile.Profile import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.sharedPreferences.SP diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt index acfd94599e..592c2fe9ed 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAPlugin.kt @@ -10,7 +10,6 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.OpenAPSFragment import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui @@ -18,15 +17,17 @@ import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index c6b152bbc1..0fa6f92983 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -9,7 +9,6 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.APSResult @@ -19,6 +18,7 @@ import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData +import info.nightscout.interfaces.profile.Profile import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.SafeParse diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index 36b0777cf3..784ef4cf24 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -12,7 +12,6 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.aps.OpenAPSFragment import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateGui @@ -20,8 +19,8 @@ import info.nightscout.androidaps.plugins.aps.events.EventOpenAPSUpdateResultGui import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler +import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.aps.SMBDefaults @@ -29,6 +28,8 @@ import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt index 6bf251e708..007c969883 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/DetermineBasalAdapterSMBDynamicISFJS.kt @@ -9,18 +9,19 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.stats.TddCalculator import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.aps.openAPSSMB.DetermineBasalResultSMB import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus +import info.nightscout.core.profile.toMgdl import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.Round import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt index 995ecdffca..2b58e004fa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt @@ -4,23 +4,23 @@ import android.content.Context import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.BuildHelper import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.DetermineBasalAdapterInterface import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.BuildHelper +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.DateUtil import javax.inject.Inject import javax.inject.Singleton 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 15bb96ffa4..8f42e3e4df 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 @@ -6,8 +6,6 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui @@ -21,6 +19,8 @@ import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.profile.ProfileSource +import info.nightscout.interfaces.pump.Pump +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.sync.NsClient import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventAppInitialized diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt index eb0b3330f7..d4f05982cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/PluginStore.kt @@ -4,7 +4,6 @@ import info.nightscout.androidaps.interfaces.APS import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.BgSource import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.interfaces.Config import info.nightscout.interfaces.Overview @@ -13,6 +12,7 @@ import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.profile.ProfileSource +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.sync.NsClient import info.nightscout.interfaces.sync.Sync import info.nightscout.rx.logging.AAPSLogger 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 149e56f8c1..a09d1bb413 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 @@ -2,11 +2,9 @@ package info.nightscout.androidaps.plugins.configBuilder import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged +import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.extensions.fromConstant import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.main.R import info.nightscout.database.entities.ProfileSwitch @@ -16,7 +14,9 @@ import info.nightscout.database.impl.transactions.InsertOrUpdateProfileSwitch import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt index a742ff3ed2..771bf8c230 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt @@ -11,14 +11,12 @@ import info.nightscout.androidaps.extensions.storeString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile 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.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.constraints.Constraint @@ -27,7 +25,9 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index c0675bc702..d2fcb899e6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -16,7 +16,6 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.insight.database.InsightDatabase import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.maintenance.activities.LogSettingActivity import info.nightscout.androidaps.plugins.general.overview.OverviewData @@ -30,6 +29,7 @@ import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.maintenance.ImportExportPrefs +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus 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 de3ce9b3c2..a5bbeba151 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 @@ -48,7 +48,6 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.logging.UserEntryLogger @@ -74,6 +73,9 @@ import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.automation.AutomationPlugin import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.toSignedUnitsString +import info.nightscout.core.profile.toTargetRangeString +import info.nightscout.core.profile.toUnits import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.interfaces.end @@ -84,6 +86,7 @@ import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.constraints.bgQualityCheck.BgQualityCheckPlugin diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index 1917e67088..6e3e986393 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -13,17 +13,18 @@ import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.extensions.valueToUnitsString import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.round +import info.nightscout.core.profile.toSignedUnitsString import info.nightscout.interfaces.Constants import info.nightscout.interfaces.NotificationHolder import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.ui.IconsProvider import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus 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 24485ea475..c829b5f68d 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 @@ -15,7 +15,6 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.logging.UserEntryLogger @@ -25,13 +24,15 @@ import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.androidaps.utils.wizard.QuickWizardEntry import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.round +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toMgdl +import info.nightscout.core.profile.toTargetRangeString import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TemporaryBasal @@ -49,8 +50,10 @@ import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.sync.nsclient.data.ProcessedDeviceStatusData import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index d7d0efa5f2..f06afc3710 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -13,7 +13,6 @@ import info.nightscout.androidaps.extensions.iobCalc import info.nightscout.androidaps.extensions.toTemporaryBasal import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData @@ -37,6 +36,7 @@ import info.nightscout.interfaces.iob.MealData import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt index 8992a77d47..ab6f045d3e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt @@ -3,17 +3,18 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.extensions.isPSEvent5minBack import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.plugins.utils.Percentile import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt index 811c4d6128..328e89013a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt @@ -3,18 +3,19 @@ package info.nightscout.androidaps.plugins.sensitivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.extensions.isPSEvent5minBack import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants import info.nightscout.interfaces.aps.SMBDefaults import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.plugins.utils.Percentile import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt index 58b3450fd3..708fb9f59a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -4,17 +4,18 @@ import androidx.collection.LongSparseArray import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.androidaps.extensions.isPSEvent5minBack import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.Sensitivity.SensitivityType import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.utils.extensions.isPSEvent5minBack +import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.sync.nsclient.extensions.isTherapyEventEvent5minBack import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag 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 0c1a7996e8..787c687a65 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 @@ -11,11 +11,11 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.BgSource -import info.nightscout.androidaps.interfaces.Profile 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.core.profile.unit import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry.Action @@ -28,6 +28,7 @@ import info.nightscout.interfaces.Config import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.source.BGSourceFragment import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/app/src/main/java/info/nightscout/androidaps/receivers/TimeDateOrTZChangeReceiver.kt b/app/src/main/java/info/nightscout/androidaps/receivers/TimeDateOrTZChangeReceiver.kt index bceeef2eea..cf9f5cdf83 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/TimeDateOrTZChangeReceiver.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/TimeDateOrTZChangeReceiver.kt @@ -5,7 +5,7 @@ import android.content.Intent import com.google.gson.Gson import dagger.android.DaggerBroadcastReceiver import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Pump +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.utils.TimeChangeType import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.BundleLogger 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 6b2c504f9b..ba39419230 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -35,7 +35,6 @@ import info.nightscout.androidaps.setupwizard.elements.SWPreference import info.nightscout.androidaps.setupwizard.elements.SWRadioButton import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.utils.CryptoUtil -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.isRunningTest import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.Config @@ -43,6 +42,7 @@ import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.Constants import info.nightscout.interfaces.maintenance.ImportExportPrefs import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.profile.ProfileFragment import info.nightscout.plugins.profile.ProfilePlugin import info.nightscout.plugins.sync.nsShared.events.EventNSClientStatus diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt index 249617102f..70bcec7e22 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt @@ -7,12 +7,13 @@ import android.view.View import android.widget.LinearLayout import android.widget.TextView import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.setupwizard.SWNumberValidator -import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.ui.NumberPicker +import info.nightscout.core.profile.toCurrentUnits +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile +import info.nightscout.shared.SafeParse import java.text.DecimalFormat import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/utils/extensions/DoubleToSignedString.kt b/app/src/main/java/info/nightscout/androidaps/utils/extensions/DoubleToSignedString.kt index bbad911a7c..1298115a00 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/extensions/DoubleToSignedString.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/extensions/DoubleToSignedString.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.utils.extensions -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.interfaces.pump.Pump fun Double.toSignedString(pump: Pump): String { val formatted = DecimalFormatter.toPumpSupportedBolus(this, pump) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index 4d2566a139..68d20dcaa9 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -13,14 +13,14 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.iob.round +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toMgdl import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.TemporaryTarget @@ -34,7 +34,9 @@ import info.nightscout.interfaces.CarbTimer import info.nightscout.interfaces.Config import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.ui.ActivityNames diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt index 5e7a90f72c..b7147cd474 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt @@ -6,14 +6,15 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.extensions.valueToUnits import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.core.iob.round +import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.GlucoseValue import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.JsonHelper.safeGetInt import info.nightscout.interfaces.utils.JsonHelper.safeGetString import info.nightscout.rx.logging.AAPSLogger diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt index 4a9e1146dc..5a5427b0da 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareBgDataWorker.kt @@ -5,10 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository -import info.nightscout.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DataPointWithLabelInterface @@ -16,9 +13,12 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Gluco import info.nightscout.androidaps.plugins.general.overview.graphExtensions.PointsWithLabelGraphSeries import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DefaultValueHelper +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.database.impl.AppRepository +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.Round import info.nightscout.shared.interfaces.ResourceHelper -import java.util.ArrayList import javax.inject.Inject class PrepareBgDataWorker( diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt index eada8b4423..1f48c5306d 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTemporaryTargetDataWorker.kt @@ -8,17 +8,18 @@ import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.ValueWrapper import info.nightscout.androidaps.extensions.target import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile 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.iob.iobCobCalculator.events.EventIobCalculationProgress import info.nightscout.androidaps.receivers.DataWorkerStorage +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.profile.Profile import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject import kotlin.math.max diff --git a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt index ed3829557a..307dd774cb 100644 --- a/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/workflow/PrepareTreatmentsDataWorker.kt @@ -5,9 +5,7 @@ import androidx.work.Worker import androidx.work.WorkerParameters import androidx.work.workDataOf import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.general.overview.graphExtensions.BolusDataPoint @@ -21,9 +19,12 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventIobCa import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.Translator +import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.TherapyEvent +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.Round import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c02f09ecf8..7f76f71a53 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,10 +4,10 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.EffectiveProfileSwitch diff --git a/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 7829779b22..7262510558 100644 --- a/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/app/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType 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 25181580dd..0c80960576 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.common.bolusInfo.TemporaryBasalSt import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.source.GlimpPlugin -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.database.impl.AppRepository @@ -34,7 +33,9 @@ import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert @@ -63,6 +64,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { @Mock lateinit var insightDatabaseDao: InsightDatabaseDao @Mock lateinit var ruffyScripter: RuffyScripter @Mock lateinit var buildHelper: BuildHelper + @Mock lateinit var hardLimits: HardLimits private lateinit var danaPump: DanaPump private lateinit var insightDbHelper: InsightDbHelper @@ -76,7 +78,6 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { private lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin private lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin private lateinit var openAPSSMBDynamicISFPlugin: OpenAPSSMBDynamicISFPlugin - private lateinit var hardLimits: HardLimits private val injector = HasAndroidInjector { AndroidInjector { @@ -131,7 +132,6 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { insightDbHelper = InsightDbHelper(insightDatabaseDao) danaPump = DanaPump(aapsLogger, sp, dateUtil, injector) - hardLimits = HardLimits(aapsLogger, rxBus, sp, rh, context, repository) objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, rh, activePlugin, sp, config) comboPlugin = ComboPlugin(injector, aapsLogger, rxBus, rh, profileFunction, sp, commandQueue, pumpSync, dateUtil, ruffyScripter) danaRPlugin = DanaRPlugin(injector, aapsLogger, aapsSchedulers, rxBus, context, rh, constraintChecker, activePlugin, sp, commandQueue, danaPump, dateUtil, fabricPrivacy, pumpSync) diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt index 62079d1ca3..86c9c174c8 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt @@ -4,10 +4,10 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.logging.UserEntryLogger +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP 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 104488dc83..d8b4cc425e 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 @@ -11,12 +11,12 @@ import info.nightscout.androidaps.plugins.aps.openAPSSMB.OpenAPSSMBPlugin import info.nightscout.androidaps.plugins.aps.openAPSSMBDynamicISF.OpenAPSSMBDynamicISFPlugin import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.source.GlimpPlugin -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Constants import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.pump.defs.PumpDescription +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert @@ -38,8 +38,8 @@ class SafetyPluginTest : TestBaseWithProfile() { @Mock lateinit var virtualPumpPlugin: VirtualPumpPlugin @Mock lateinit var glimpPlugin: GlimpPlugin @Mock lateinit var repository: AppRepository + @Mock lateinit var hardLimits: HardLimits - private lateinit var hardLimits: HardLimits private lateinit var safetyPlugin: SafetyPlugin val injector = HasAndroidInjector { AndroidInjector { } } @@ -69,11 +69,12 @@ class SafetyPluginTest : TestBaseWithProfile() { `when`(activePlugin.activePump).thenReturn(virtualPumpPlugin) `when`(virtualPumpPlugin.pumpDescription).thenReturn(pumpDescription) - hardLimits = HardLimits(aapsLogger, rxBus, sp, rh, context, repository) `when`(config.APS).thenReturn(true) - safetyPlugin = SafetyPlugin(injector, aapsLogger, rh, sp, rxBus, constraintChecker, openAPSAMAPlugin, openAPSSMBPlugin, openAPSSMBDynamicISFPlugin, sensitivityOref1Plugin, activePlugin, - hardLimits, buildHelper, - iobCobCalculator, config, dateUtil) + safetyPlugin = SafetyPlugin( + injector, aapsLogger, rh, sp, rxBus, constraintChecker, openAPSAMAPlugin, openAPSSMBPlugin, openAPSSMBDynamicISFPlugin, sensitivityOref1Plugin, activePlugin, + hardLimits, buildHelper, + iobCobCalculator, config, dateUtil + ) } @Test fun pumpDescriptionShouldLimitLoopInvocation() { @@ -135,12 +136,14 @@ class SafetyPluginTest : TestBaseWithProfile() { val c = Constraint(Constants.REALLYHIGHBASALRATE) safetyPlugin.applyBasalConstraints(c, validProfile) Assert.assertEquals(1.0, c.value(), 0.01) - Assert.assertEquals(""" + Assert.assertEquals( + """ Safety: Limiting max basal rate to 1.00 U/h because of max value in preferences Safety: Limiting max basal rate to 4.00 U/h because of max basal multiplier Safety: Limiting max basal rate to 3.00 U/h because of max daily basal multiplier Safety: Limiting max basal rate to 2.00 U/h because of hard limit - """.trimIndent(), c.getReasons(aapsLogger)) + """.trimIndent(), c.getReasons(aapsLogger) + ) Assert.assertEquals("Safety: Limiting max basal rate to 1.00 U/h because of max value in preferences", c.getMostLimitedReasons(aapsLogger)) } @@ -149,10 +152,12 @@ class SafetyPluginTest : TestBaseWithProfile() { val d = Constraint(-0.5) safetyPlugin.applyBasalConstraints(d, validProfile) Assert.assertEquals(0.0, d.value(), 0.01) - Assert.assertEquals(""" + Assert.assertEquals( + """ Safety: Limiting max basal rate to 0.00 U/h because of it must be positive value Safety: Increasing max basal value because setting is lower than your max basal in profile - """.trimIndent(), d.getReasons(aapsLogger)) + """.trimIndent(), d.getReasons(aapsLogger) + ) } @Test fun percentBasalRateShouldBeLimited() { @@ -164,7 +169,8 @@ class SafetyPluginTest : TestBaseWithProfile() { val i = Constraint(Constants.REALLYHIGHPERCENTBASALRATE) safetyPlugin.applyBasalPercentConstraints(i, validProfile) Assert.assertEquals(100, i.value()) - Assert.assertEquals(""" + Assert.assertEquals( + """ Safety: Percent rate 1111111% recalculated to 11111.11 U/h with current basal 1.00 U/h Safety: Limiting max basal rate to 1.00 U/h because of max value in preferences Safety: Limiting max basal rate to 4.00 U/h because of max basal multiplier @@ -172,7 +178,8 @@ class SafetyPluginTest : TestBaseWithProfile() { Safety: Limiting max basal rate to 2.00 U/h because of hard limit Safety: Limiting max percent rate to 100% because of pump limit Safety: Limiting max basal rate to 500.00 U/h because of pump limit - """.trimIndent(), i.getReasons(aapsLogger)) + """.trimIndent(), i.getReasons(aapsLogger) + ) Assert.assertEquals("Safety: Limiting max percent rate to 100% because of pump limit", i.getMostLimitedReasons(aapsLogger)) } @@ -181,12 +188,14 @@ class SafetyPluginTest : TestBaseWithProfile() { val i = Constraint(-22) safetyPlugin.applyBasalPercentConstraints(i, validProfile) Assert.assertEquals(0, i.value()) - Assert.assertEquals(""" + Assert.assertEquals( + """ Safety: Percent rate -22% recalculated to -0.22 U/h with current basal 1.00 U/h Safety: Limiting max basal rate to 0.00 U/h because of it must be positive value Safety: Increasing max basal value because setting is lower than your max basal in profile Safety: Limiting max percent rate to 0% because of pump limit - """.trimIndent(), i.getReasons(aapsLogger)) + """.trimIndent(), i.getReasons(aapsLogger) + ) Assert.assertEquals("Safety: Limiting max percent rate to 0% because of pump limit", i.getMostLimitedReasons(aapsLogger)) } @@ -196,10 +205,12 @@ class SafetyPluginTest : TestBaseWithProfile() { var d = Constraint(Constants.REALLYHIGHBOLUS) d = safetyPlugin.applyBolusConstraints(d) Assert.assertEquals(3.0, d.value(), 0.01) - Assert.assertEquals(""" + Assert.assertEquals( + """ Safety: Limiting bolus to 3.0 U because of max value in preferences Safety: Limiting bolus to 5.0 U because of hard limit - """.trimIndent(), d.getReasons(aapsLogger)) + """.trimIndent(), d.getReasons(aapsLogger) + ) Assert.assertEquals("Safety: Limiting bolus to 3.0 U because of max value in preferences", d.getMostLimitedReasons(aapsLogger)) } 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 f3482a95a3..8415a14be6 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 @@ -9,13 +9,13 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.iob.IobTotal +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.plugins.pump.virtual.VirtualPumpPlugin import info.nightscout.rx.bus.RxBus diff --git a/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt b/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt index a391b07170..b901ae1f91 100644 --- a/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt +++ b/automation/src/main/java/info/nightscout/automation/actions/ActionStartTempTarget.kt @@ -4,11 +4,8 @@ import android.widget.LinearLayout import androidx.annotation.DrawableRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.extensions.friendlyDescription import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.R @@ -18,12 +15,16 @@ import info.nightscout.automation.elements.InputTempTarget import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.triggers.TriggerTempTarget +import info.nightscout.core.profile.toMgdl import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.JsonHelper.safeGetDouble diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt b/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt index 851d71b4ab..3afe0cc273 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputTime.kt @@ -11,11 +11,12 @@ import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.automation.R +import info.nightscout.core.profile.secondsFromMidnight +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.automation.R import java.util.Calendar class InputTime(private val rh: ResourceHelper, private val dateUtil: DateUtil) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt b/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt index 016fa92a05..585f9036b1 100644 --- a/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt +++ b/automation/src/main/java/info/nightscout/automation/elements/InputTimeRange.kt @@ -12,11 +12,12 @@ import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.FragmentManager import com.google.android.material.timepicker.MaterialTimePicker import com.google.android.material.timepicker.TimeFormat -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.automation.R +import info.nightscout.core.profile.secondsFromMidnight +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.automation.R import java.util.Calendar class InputTimeRange(private val rh: ResourceHelper, private val dateUtil: DateUtil) : Element() { diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt index 6b18739c2e..dc56e2c18b 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerBg.kt @@ -3,18 +3,18 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputBg import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel +import info.nightscout.core.profile.toMgdl +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.logging.LTag - import org.json.JSONObject class TriggerBg(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt index 9b3ab2402e..f7d75769f6 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerDelta.kt @@ -3,10 +3,6 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputDelta @@ -14,8 +10,12 @@ import info.nightscout.automation.elements.InputDelta.DeltaType import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel +import info.nightscout.core.profile.toMgdl +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.logging.LTag - import org.json.JSONObject import java.text.DecimalFormat diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt index 97206e1b9a..170598ec8a 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerRecurringTime.kt @@ -3,16 +3,16 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.utils.JsonHelper -import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.automation.R import info.nightscout.automation.elements.InputTime import info.nightscout.automation.elements.InputWeekDay import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel +import info.nightscout.core.profile.secondsFromMidnight +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.JsonHelper +import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.rx.logging.LTag - import org.json.JSONObject import java.util.Calendar import java.util.Objects diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt index de161f96ab..9459564f2e 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTempTargetValue.kt @@ -3,19 +3,19 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.Constants -import info.nightscout.database.impl.ValueWrapper -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.automation.R import info.nightscout.automation.elements.Comparator import info.nightscout.automation.elements.InputBg import info.nightscout.automation.elements.LabelWithElement import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel +import info.nightscout.core.profile.toMgdl +import info.nightscout.database.impl.ValueWrapper +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.logging.LTag - import org.json.JSONObject class TriggerTempTargetValue(injector: HasAndroidInjector) : Trigger(injector) { diff --git a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt index 92506c3ce1..d8638df250 100644 --- a/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt +++ b/automation/src/main/java/info/nightscout/automation/triggers/TriggerTimeRange.kt @@ -3,15 +3,15 @@ package info.nightscout.automation.triggers import android.widget.LinearLayout import com.google.common.base.Optional import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.utils.JsonHelper.safeGetInt -import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.automation.R import info.nightscout.automation.elements.InputTimeRange import info.nightscout.automation.elements.LayoutBuilder import info.nightscout.automation.elements.StaticLabel +import info.nightscout.core.profile.secondsFromMidnight +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.JsonHelper.safeGetInt +import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.rx.logging.LTag - import org.json.JSONObject // Trigger for time range ( from 10:00AM till 13:00PM ) diff --git a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 5f625e2741..e6428b4bee 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,15 +3,15 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 8b70132d3f..f906d1b5ff 100644 --- a/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/automation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -2,13 +2,13 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt index 1900ec73bd..dee897a5ad 100644 --- a/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/automation/actions/ActionsTestBase.kt @@ -8,7 +8,6 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.automation.triggers.Trigger import info.nightscout.database.entities.OfflineEvent @@ -17,6 +16,7 @@ import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.rx.logging.AAPSLogger diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt b/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt index 1e0e2f4d11..1701cb47db 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/data/ProfileSealed.kt @@ -6,14 +6,10 @@ import info.nightscout.androidaps.extensions.lowTargetBlockValueBySeconds import info.nightscout.androidaps.extensions.shiftBlock import info.nightscout.androidaps.extensions.shiftTargetBlock import info.nightscout.androidaps.extensions.targetBlockValueBySeconds -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Profile.Companion.secondsFromMidnight -import info.nightscout.androidaps.interfaces.Profile.Companion.toMgdl -import info.nightscout.androidaps.interfaces.Profile.ProfileValue -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.core.main.R +import info.nightscout.core.profile.secondsFromMidnight +import info.nightscout.core.profile.toMgdl import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.ProfileSwitch import info.nightscout.database.entities.data.Block @@ -23,7 +19,11 @@ import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.profile.Profile.ProfileValue import info.nightscout.interfaces.profile.PureProfile +import info.nightscout.interfaces.pump.Pump +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil @@ -161,14 +161,14 @@ sealed class ProfileSealed( break } for (isf in isfBlocks) - if (!hardLimits.isInRange(toMgdl(isf.amount * 100.0 / percentage, units), HardLimits.MIN_ISF, HardLimits.MAX_ISF)) { + if (!hardLimits.isInRange(Profile.toMgdl(isf.amount * 100.0 / percentage, units), HardLimits.MIN_ISF, HardLimits.MAX_ISF)) { validityCheck.isValid = false validityCheck.reasons.add(rh.gs(R.string.value_out_of_hard_limits, rh.gs(R.string.profile_sensitivity_value), isf.amount * 100.0 / percentage)) break } for (target in targetBlocks) { if (!hardLimits.isInRange( - toMgdl(target.lowTarget, units), + Profile.toMgdl(target.lowTarget, units), HardLimits.VERY_HARD_LIMIT_MIN_BG[0], HardLimits.VERY_HARD_LIMIT_MIN_BG[1] ) @@ -178,7 +178,7 @@ sealed class ProfileSealed( break } if (!hardLimits.isInRange( - toMgdl(target.highTarget, units), + Profile.toMgdl(target.highTarget, units), HardLimits.VERY_HARD_LIMIT_MAX_BG[0], HardLimits.VERY_HARD_LIMIT_MAX_BG[1] ) @@ -214,11 +214,11 @@ sealed class ProfileSealed( override fun isEqual(profile: Profile): Boolean { for (hour in 0..23) { val seconds = T.hours(hour.toLong()).secs().toInt() - if (getBasalTimeFromMidnight(seconds) != profile.getBasalTimeFromMidnight(seconds)) return false - if (getIsfMgdlTimeFromMidnight(seconds) != profile.getIsfMgdlTimeFromMidnight(seconds)) return false - if (getIcTimeFromMidnight(seconds) != profile.getIcTimeFromMidnight(seconds)) return false - if (getTargetLowMgdlTimeFromMidnight(seconds) != profile.getTargetLowMgdlTimeFromMidnight(seconds)) return false - if (getTargetHighMgdlTimeFromMidnight(seconds) != profile.getTargetHighMgdlTimeFromMidnight(seconds)) return false + if (getBasalTimeFromMidnight(seconds) != profile.getBasalTimeFromMidnight(seconds)) return false + if (getIsfMgdlTimeFromMidnight(seconds) != profile.getIsfMgdlTimeFromMidnight(seconds)) return false + if (getIcTimeFromMidnight(seconds) != profile.getIcTimeFromMidnight(seconds)) return false + if (getTargetLowMgdlTimeFromMidnight(seconds) != profile.getTargetLowMgdlTimeFromMidnight(seconds)) return false + if (getTargetHighMgdlTimeFromMidnight(seconds) != profile.getTargetHighMgdlTimeFromMidnight(seconds)) return false } if (dia != profile.dia) return false if ((profile is EPS) && profileName != profile.value.originalProfileName) return false // handle profile name change too @@ -228,29 +228,33 @@ sealed class ProfileSealed( override val percentage: Int get() = pct - override fun getBasal(): Double = basalBlocks.blockValueBySeconds(secondsFromMidnight(), percentage / 100.0, timeshift) - override fun getBasal(timestamp: Long): Double = basalBlocks.blockValueBySeconds(secondsFromMidnight(timestamp), percentage / 100.0, timeshift) - override fun getIc(): Double = icBlocks.blockValueBySeconds(secondsFromMidnight(), 100.0 / percentage, timeshift) - override fun getIc(timestamp: Long): Double = icBlocks.blockValueBySeconds(secondsFromMidnight(timestamp), 100.0 / percentage, timeshift) - override fun getIsfMgdl(): Double = toMgdl(isfBlocks.blockValueBySeconds(secondsFromMidnight(), 100.0 / percentage, timeshift), units) - override fun getIsfMgdl(timestamp: Long): Double = toMgdl(isfBlocks.blockValueBySeconds(secondsFromMidnight(timestamp), 100.0 / percentage, timeshift), units) - override fun getTargetMgdl(): Double = toMgdl(targetBlocks.targetBlockValueBySeconds(secondsFromMidnight(), timeshift), units) - override fun getTargetLowMgdl(): Double = toMgdl(targetBlocks.lowTargetBlockValueBySeconds(secondsFromMidnight(), timeshift), units) - override fun getTargetLowMgdl(timestamp: Long): Double = toMgdl(targetBlocks.lowTargetBlockValueBySeconds(secondsFromMidnight(timestamp), timeshift), units) - override fun getTargetHighMgdl(): Double = toMgdl(targetBlocks.highTargetBlockValueBySeconds(secondsFromMidnight(), timeshift), units) - override fun getTargetHighMgdl(timestamp: Long): Double = toMgdl(targetBlocks.highTargetBlockValueBySeconds(secondsFromMidnight(timestamp), timeshift), units) + override fun getBasal(): Double = basalBlocks.blockValueBySeconds(Profile.secondsFromMidnight(), percentage / 100.0, timeshift) + override fun getBasal(timestamp: Long): Double = basalBlocks.blockValueBySeconds(Profile.secondsFromMidnight(timestamp), percentage / 100.0, timeshift) + override fun getIc(): Double = icBlocks.blockValueBySeconds(Profile.secondsFromMidnight(), 100.0 / percentage, timeshift) + override fun getIc(timestamp: Long): Double = icBlocks.blockValueBySeconds(Profile.secondsFromMidnight(timestamp), 100.0 / percentage, timeshift) + override fun getIsfMgdl(): Double = Profile.toMgdl(isfBlocks.blockValueBySeconds(Profile.secondsFromMidnight(), 100.0 / percentage, timeshift), units) + override fun getIsfMgdl(timestamp: Long): Double = Profile.toMgdl(isfBlocks.blockValueBySeconds(Profile.secondsFromMidnight(timestamp), 100.0 / percentage, timeshift), units) + override fun getTargetMgdl(): Double = Profile.toMgdl(targetBlocks.targetBlockValueBySeconds(Profile.secondsFromMidnight(), timeshift), units) + override fun getTargetLowMgdl(): Double = Profile.toMgdl(targetBlocks.lowTargetBlockValueBySeconds(Profile.secondsFromMidnight(), timeshift), units) + override fun getTargetLowMgdl(timestamp: Long): Double = Profile.toMgdl(targetBlocks.lowTargetBlockValueBySeconds(Profile.secondsFromMidnight(timestamp), timeshift), units) + override fun getTargetHighMgdl(): Double = Profile.toMgdl(targetBlocks.highTargetBlockValueBySeconds(Profile.secondsFromMidnight(), timeshift), units) + override fun getTargetHighMgdl(timestamp: Long): Double = Profile.toMgdl(targetBlocks.highTargetBlockValueBySeconds(Profile.secondsFromMidnight(timestamp), timeshift), units) override fun getBasalTimeFromMidnight(timeAsSeconds: Int): Double = basalBlocks.blockValueBySeconds(timeAsSeconds, percentage / 100.0, timeshift) override fun getIcTimeFromMidnight(timeAsSeconds: Int): Double = icBlocks.blockValueBySeconds(timeAsSeconds, 100.0 / percentage, timeshift) fun getIsfTimeFromMidnight(timeAsSeconds: Int): Double = isfBlocks.blockValueBySeconds(timeAsSeconds, 100.0 / percentage, timeshift) - override fun getIsfMgdlTimeFromMidnight(timeAsSeconds: Int): Double = toMgdl(isfBlocks.blockValueBySeconds(timeAsSeconds, 100.0 / percentage, timeshift), units) - override fun getTargetLowMgdlTimeFromMidnight(timeAsSeconds: Int): Double = toMgdl(targetBlocks.lowTargetBlockValueBySeconds(timeAsSeconds, timeshift), units) + override fun getIsfMgdlTimeFromMidnight(timeAsSeconds: Int): Double = Profile.toMgdl(isfBlocks.blockValueBySeconds(timeAsSeconds, 100.0 / percentage, timeshift), units) + override fun getTargetLowMgdlTimeFromMidnight(timeAsSeconds: Int): Double = Profile.toMgdl(targetBlocks.lowTargetBlockValueBySeconds(timeAsSeconds, timeshift), units) private fun getTargetLowTimeFromMidnight(timeAsSeconds: Int): Double = targetBlocks.lowTargetBlockValueBySeconds(timeAsSeconds, timeshift) private fun getTargetHighTimeFromMidnight(timeAsSeconds: Int): Double = targetBlocks.highTargetBlockValueBySeconds(timeAsSeconds, timeshift) - override fun getTargetHighMgdlTimeFromMidnight(timeAsSeconds: Int): Double = toMgdl(targetBlocks.highTargetBlockValueBySeconds(timeAsSeconds, timeshift), units) + override fun getTargetHighMgdlTimeFromMidnight(timeAsSeconds: Int): Double = Profile.toMgdl(targetBlocks.highTargetBlockValueBySeconds(timeAsSeconds, timeshift), units) override fun getIcList(rh: ResourceHelper, dateUtil: DateUtil): String = getValuesList(icBlocks, 100.0 / percentage, DecimalFormat("0.0"), rh.gs(R.string.profile_carbs_per_unit), dateUtil) - override fun getIsfList(rh: ResourceHelper, dateUtil: DateUtil): String = getValuesList(isfBlocks, 100.0 / percentage, DecimalFormat("0.0"), units.asText + rh.gs(R.string.profile_per_unit), dateUtil) - override fun getBasalList(rh: ResourceHelper, dateUtil: DateUtil): String = getValuesList(basalBlocks, percentage / 100.0, DecimalFormat("0.00"), rh.gs(R.string.profile_ins_units_per_hour), dateUtil) + override fun getIsfList(rh: ResourceHelper, dateUtil: DateUtil): String = + getValuesList(isfBlocks, 100.0 / percentage, DecimalFormat("0.0"), units.asText + rh.gs(R.string.profile_per_unit), dateUtil) + + override fun getBasalList(rh: ResourceHelper, dateUtil: DateUtil): String = + getValuesList(basalBlocks, percentage / 100.0, DecimalFormat("0.00"), rh.gs(R.string.profile_ins_units_per_hour), dateUtil) + override fun getTargetList(rh: ResourceHelper, dateUtil: DateUtil): String = getTargetValuesList(targetBlocks, DecimalFormat("0.0"), units.asText, dateUtil) override fun convertToNonCustomizedProfile(dateUtil: DateUtil): PureProfile = @@ -278,10 +282,11 @@ sealed class ProfileSealed( val sens = JSONArray() var elapsedHours = 0L isfBlocks.forEach { - sens.put(JSONObject() - .put("time", DecimalFormat("00").format(elapsedHours) + ":00") - .put("timeAsSeconds", T.hours(elapsedHours).secs()) - .put("value", getIsfTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) + sens.put( + JSONObject() + .put("time", DecimalFormat("00").format(elapsedHours) + ":00") + .put("timeAsSeconds", T.hours(elapsedHours).secs()) + .put("value", getIsfTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) ) elapsedHours += T.msecs(it.duration).hours() } @@ -289,10 +294,11 @@ sealed class ProfileSealed( val carbratio = JSONArray() elapsedHours = 0L icBlocks.forEach { - carbratio.put(JSONObject() - .put("time", DecimalFormat("00").format(elapsedHours) + ":00") - .put("timeAsSeconds", T.hours(elapsedHours).secs()) - .put("value", getIcTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) + carbratio.put( + JSONObject() + .put("time", DecimalFormat("00").format(elapsedHours) + ":00") + .put("timeAsSeconds", T.hours(elapsedHours).secs()) + .put("value", getIcTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) ) elapsedHours += T.msecs(it.duration).hours() } @@ -300,10 +306,11 @@ sealed class ProfileSealed( val basal = JSONArray() elapsedHours = 0L basalBlocks.forEach { - basal.put(JSONObject() - .put("time", DecimalFormat("00").format(elapsedHours) + ":00") - .put("timeAsSeconds", T.hours(elapsedHours).secs()) - .put("value", getBasalTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) + basal.put( + JSONObject() + .put("time", DecimalFormat("00").format(elapsedHours) + ":00") + .put("timeAsSeconds", T.hours(elapsedHours).secs()) + .put("value", getBasalTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) ) elapsedHours += T.msecs(it.duration).hours() } @@ -312,15 +319,17 @@ sealed class ProfileSealed( val targetHigh = JSONArray() elapsedHours = 0L targetBlocks.forEach { - targetLow.put(JSONObject() - .put("time", DecimalFormat("00").format(elapsedHours) + ":00") - .put("timeAsSeconds", T.hours(elapsedHours).secs()) - .put("value", getTargetLowTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) + targetLow.put( + JSONObject() + .put("time", DecimalFormat("00").format(elapsedHours) + ":00") + .put("timeAsSeconds", T.hours(elapsedHours).secs()) + .put("value", getTargetLowTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) ) - targetHigh.put(JSONObject() - .put("time", DecimalFormat("00").format(elapsedHours) + ":00") - .put("timeAsSeconds", T.hours(elapsedHours).secs()) - .put("value", getTargetHighTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) + targetHigh.put( + JSONObject() + .put("time", DecimalFormat("00").format(elapsedHours) + ":00") + .put("timeAsSeconds", T.hours(elapsedHours).secs()) + .put("value", getTargetHighTimeFromMidnight(T.hours(elapsedHours).secs().toInt())) ) elapsedHours += T.msecs(it.duration).hours() } @@ -351,7 +360,7 @@ sealed class ProfileSealed( val ret = Array(shifted.size) { ProfileValue(0, 0.0) } var elapsed = 0 for (index in shifted.indices) { - ret[index] = ProfileValue(elapsed, toMgdl(shifted[index].amount, units)) + ret[index] = ProfileValue(elapsed, Profile.toMgdl(shifted[index].amount, units)) elapsed += T.msecs(shifted[index].duration).secs().toInt() } return ret diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt index b4f4ea79b1..4d41ee73af 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/dialogs/ProfileViewerDialog.kt @@ -9,24 +9,26 @@ import android.view.Window import android.view.WindowManager import dagger.android.HasAndroidInjector import dagger.android.support.DaggerDialogFragment +import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.getCustomizedName +import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.core.main.R import info.nightscout.core.main.databinding.DialogProfileviewerBinding -import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toUnitsString import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.ValueWrapper -import info.nightscout.shared.extensions.toVisibility -import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.extensions.getCustomizedName -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.extensions.toVisibility +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import java.text.DecimalFormat import javax.inject.Inject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt index 3703192377..2c3949aa3e 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/BolusCalculatorResultExtension.kt @@ -2,9 +2,10 @@ package info.nightscout.androidaps.extensions import com.google.gson.Gson import com.google.gson.JsonSyntaxException -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.database.entities.BolusCalculatorResult +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.DateUtil import org.json.JSONObject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt index a1582d04ae..eefc4c13e9 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ExtendedBolusExtension.kt @@ -1,14 +1,14 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal +import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.iob.IobTotal +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import kotlin.math.ceil @@ -24,13 +24,13 @@ val ExtendedBolus.plannedRemainingMinutes: Int get() = max(round((end - System.currentTimeMillis()) / 1000.0 / 60).toInt(), 0) fun ExtendedBolus.toStringFull(dateUtil: DateUtil): String = - "E " + to2Decimal(rate) + "U/h @" + dateUtil.timeString(timestamp) + + "E " + DecimalFormatter.to2Decimal(rate) + "U/h @" + dateUtil.timeString(timestamp) + " " + getPassedDurationToTimeInMinutes(dateUtil.now()) + "/" + T.msecs(duration).mins() + "min" fun ExtendedBolus.toStringMedium(dateUtil: DateUtil): String = - to2Decimal(rate) + "U/h " + getPassedDurationToTimeInMinutes(dateUtil.now()) + "/" + T.msecs(duration).mins() + "'" + DecimalFormatter.to2Decimal(rate) + "U/h " + getPassedDurationToTimeInMinutes(dateUtil.now()) + "/" + T.msecs(duration).mins() + "'" -fun ExtendedBolus.toStringTotal(): String = "${to2Decimal(amount)}U ( ${to2Decimal(rate)} U/h )" +fun ExtendedBolus.toStringTotal(): String = "${DecimalFormatter.to2Decimal(amount)}U ( ${DecimalFormatter.to2Decimal(rate)} U/h )" fun ExtendedBolus.getPassedDurationToTimeInMinutes(time: Long): Int = ((min(time, end) - timestamp) / 60.0 / 1000).roundToInt() diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt index 97f62fa922..ec7e2d2bc2 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/GlucoseValueExtension.kt @@ -1,5 +1,6 @@ package info.nightscout.androidaps.extensions + import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.Constants diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt index 33f9243544..15f8dc1969 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/ProfileSwitchExtension.kt @@ -1,9 +1,7 @@ -package info.nightscout.androidaps.utils.extensions +package info.nightscout.androidaps.extensions import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.extensions.blockFromJsonArray -import info.nightscout.androidaps.extensions.targetBlockFromJsonArray -import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal +import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.database.entities.ProfileSwitch import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit @@ -29,7 +27,7 @@ fun List.isPSEvent5minBack(time: Long): Boolean { fun ProfileSwitch.getCustomizedName(): String { var name: String = profileName if (Constants.LOCAL_PROFILE == name) { - name = to2Decimal(ProfileSealed.PS(this).percentageBasalSum()) + "U " + name = DecimalFormatter.to2Decimal(ProfileSealed.PS(this).percentageBasalSum()) + "U " } if (timeshift != 0L || percentage != 100) { name += "($percentage%" diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt index a8b4e56c16..125839b5af 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryBasalExtension.kt @@ -1,14 +1,13 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult -import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal -import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal +import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.interfaces.end import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.iob.IobTotal +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import kotlin.math.ceil @@ -38,13 +37,13 @@ val TemporaryBasal.durationInMinutes fun TemporaryBasal.toStringFull(profile: Profile, dateUtil: DateUtil): String { return when { type == TemporaryBasal.Type.FAKE_EXTENDED -> { - to2Decimal(rate) + "U/h (" + to2Decimal(netExtendedRate(profile)) + "E) @" + + DecimalFormatter.to2Decimal(rate) + "U/h (" + DecimalFormatter.to2Decimal(netExtendedRate(profile)) + "E) @" + dateUtil.timeString(timestamp) + " " + getPassedDurationToTimeInMinutes(dateUtil.now()) + "/" + durationInMinutes + "'" } isAbsolute -> { - to2Decimal(rate) + "U/h @" + + DecimalFormatter.to2Decimal(rate) + "U/h @" + dateUtil.timeString(timestamp) + " " + getPassedDurationToTimeInMinutes(dateUtil.now()) + "/" + durationInMinutes + "'" } @@ -58,8 +57,8 @@ fun TemporaryBasal.toStringFull(profile: Profile, dateUtil: DateUtil): String { } fun TemporaryBasal.toStringShort(): String = - if (isAbsolute || type == TemporaryBasal.Type.FAKE_EXTENDED) to2Decimal(rate) + "U/h" - else "${to0Decimal(rate)}%" + if (isAbsolute || type == TemporaryBasal.Type.FAKE_EXTENDED) DecimalFormatter.to2Decimal(rate) + "U/h" + else "${DecimalFormatter.to0Decimal(rate)}%" fun TemporaryBasal.iobCalc(time: Long, profile: Profile, insulinInterface: Insulin): IobTotal { val result = IobTotal(time) diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt index 0ff7e6cdd8..0bc5b8d78e 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/extensions/TemporaryTargetExtension.kt @@ -1,11 +1,12 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.main.R +import info.nightscout.core.profile.toTargetRangeString import info.nightscout.database.entities.TemporaryTarget import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil import java.util.concurrent.TimeUnit diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt index ab17476e41..04b2f35a7e 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ActivePlugin.kt @@ -6,6 +6,7 @@ import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginType import info.nightscout.interfaces.profile.ProfileSource +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.sync.NsClient import info.nightscout.interfaces.sync.Sync diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt index 20cf7988e3..c9a1060d4a 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/CommandQueue.kt @@ -1,9 +1,11 @@ package info.nightscout.androidaps.interfaces import android.text.Spanned -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.CustomCommand interface CommandQueue { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt index ea0a4a1394..deddfeda8e 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Constraints.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.interfaces.Constants import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.profile.Profile /** * Constraints interface diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt index c9038b209c..3a65caa9a7 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/DetermineBasalAdapterInterface.kt @@ -4,6 +4,7 @@ import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData +import info.nightscout.interfaces.profile.Profile interface DetermineBasalAdapterInterface { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt index 0d9a3d41bc..558118c85b 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/IobCobCalculator.kt @@ -9,6 +9,7 @@ import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.TemporaryBasal import info.nightscout.interfaces.iob.IobTotal import info.nightscout.interfaces.iob.MealData +import info.nightscout.interfaces.profile.Profile import org.json.JSONArray interface IobCobCalculator { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt index 9e39f10357..94cd92b9b5 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Loop.kt @@ -3,6 +3,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.androidaps.plugins.aps.loop.APSResult import info.nightscout.database.entities.OfflineEvent import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.PumpEnactResult interface Loop { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt deleted file mode 100644 index 8435ac7026..0000000000 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Profile.kt +++ /dev/null @@ -1,212 +0,0 @@ -package info.nightscout.androidaps.interfaces - -import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal -import info.nightscout.androidaps.utils.DecimalFormatter.to1Decimal -import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.interfaces.Config -import info.nightscout.interfaces.Constants -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.interfaces.profile.PureProfile -import info.nightscout.interfaces.utils.Round -import info.nightscout.rx.bus.RxBus -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import org.joda.time.DateTime -import org.json.JSONObject - -interface Profile { - - class ValidityCheck(var isValid: Boolean = true, val reasons: ArrayList = arrayListOf()) - - fun isValid(from: String, pump: Pump, config: Config, rh: ResourceHelper, rxBus: RxBus, hardLimits: HardLimits, sendNotifications: Boolean): ValidityCheck - - /** - * Units used for ISF & target - */ - val units: GlucoseUnit - - //@Deprecated("Replace in favor of accessing InsulinProfile") - val dia: Double - - val percentage: Int - - /** - * Timeshift modifier of base profile in hours - */ - val timeshift: Int - - /** - * is equal to another profile? - */ - fun isEqual(profile: Profile): Boolean - - /** - * Basal value according to "now" - */ - fun getBasal(): Double - - /** - * Basal value according to timestamp - */ - fun getBasal(timestamp: Long): Double - - /** - * I:C value according to "now" - */ - fun getIc(): Double - - /** - * I:C value according to timestamp - */ - fun getIc(timestamp: Long): Double - - /** - * ISF value according to "now"" in MGDL - */ - fun getIsfMgdl(): Double - - /** - * ISF value according to timestamp in MGDL - */ - fun getIsfMgdl(timestamp: Long): Double - - /** - * Average target value according to "now" in MGDL - */ - fun getTargetMgdl(): Double - fun getTargetLowMgdl(): Double - fun getTargetLowMgdl(timestamp: Long): Double - fun getTargetHighMgdl(): Double - fun getTargetHighMgdl(timestamp: Long): Double - - /** - * Basal value according to elapsed seconds from midnight - */ - fun getBasalTimeFromMidnight(timeAsSeconds: Int): Double - - /** - * I:C value according to elapsed seconds from midnight - */ - fun getIcTimeFromMidnight(timeAsSeconds: Int): Double - - /** - * ISF value according to elapsed seconds from midnight - */ - fun getIsfMgdlTimeFromMidnight(timeAsSeconds: Int): Double - - /** - * Low target value according to elapsed seconds from midnight - */ - fun getTargetLowMgdlTimeFromMidnight(timeAsSeconds: Int): Double - - /** - * High target value according to elapsed seconds from midnight in MGDL - */ - fun getTargetHighMgdlTimeFromMidnight(timeAsSeconds: Int): Double - - fun getIcList(rh: ResourceHelper, dateUtil: DateUtil): String - fun getIsfList(rh: ResourceHelper, dateUtil: DateUtil): String - fun getBasalList(rh: ResourceHelper, dateUtil: DateUtil): String - fun getTargetList(rh: ResourceHelper, dateUtil: DateUtil): String - - fun convertToNonCustomizedProfile(dateUtil: DateUtil): PureProfile - fun toPureNsJson(dateUtil: DateUtil): JSONObject - fun getMaxDailyBasal(): Double - fun baseBasalSum(): Double - fun percentageBasalSum(): Double - - fun getBasalValues(): Array - fun getIcsValues(): Array - fun getIsfsMgdlValues(): Array - fun getSingleTargetsMgdl(): Array - - open class ProfileValue(var timeAsSeconds: Int, var value: Double) { - - override fun equals(other: Any?): Boolean { - if (other !is ProfileValue) { - return false - } - return timeAsSeconds == other.timeAsSeconds && Round.isSame(value, other.value) - } - - override fun hashCode(): Int { - var result = timeAsSeconds - result = 31 * result + value.hashCode() - return result - } - } - - companion object { - - /* - * Midnight time conversion - */ - fun secondsFromMidnight(): Int { - val passed = DateTime().millisOfDay.toLong() - return (passed / 1000).toInt() - } - - fun secondsFromMidnight(date: Long): Int { - val passed = DateTime(date).millisOfDay.toLong() - return (passed / 1000).toInt() - } - - fun milliSecFromMidnight(date: Long): Long { - return DateTime(date).millisOfDay.toLong() - } - /* - * Units conversion - */ - - fun fromMgdlToUnits(value: Double, units: GlucoseUnit): Double = - if (units == GlucoseUnit.MGDL) value else value * Constants.MGDL_TO_MMOLL - - fun fromMmolToUnits(value: Double, units: GlucoseUnit): Double = - if (units == GlucoseUnit.MMOL) value else value * Constants.MMOLL_TO_MGDL - - fun toUnits(valueInMgdl: Double, valueInMmol: Double, units: GlucoseUnit): Double = - if (units == GlucoseUnit.MGDL) valueInMgdl else valueInMmol - - fun toUnitsString(valueInMgdl: Double, valueInMmol: Double, units: GlucoseUnit): String = - if (units == GlucoseUnit.MGDL) to0Decimal(valueInMgdl) else to1Decimal(valueInMmol) - - fun toSignedUnitsString(valueInMgdl: Double, valueInMmol: Double, units: GlucoseUnit): String = - if (units == GlucoseUnit.MGDL) (if (valueInMgdl > 0) "+" else "") + to0Decimal(valueInMgdl) - else (if (valueInMmol > 0) "+" else "") + to1Decimal(valueInMmol) - - fun isMgdl(anyBg: Double) = anyBg >= 39 - fun isMmol(anyBg: Double) = anyBg < 39 - fun unit(anyBg: Double) = if (isMgdl(anyBg)) GlucoseUnit.MGDL else GlucoseUnit.MMOL - - fun toCurrentUnits(profileFunction: ProfileFunction, anyBg: Double): Double = - if (isMmol(anyBg)) fromMmolToUnits(anyBg, profileFunction.getUnits()) - else fromMgdlToUnits(anyBg, profileFunction.getUnits()) - - fun toCurrentUnits(units: GlucoseUnit, anyBg: Double): Double = - if (isMmol(anyBg)) fromMmolToUnits(anyBg, units) - else fromMgdlToUnits(anyBg, units) - - fun toCurrentUnitsString(profileFunction: ProfileFunction, anyBg: Double): String = - if (isMmol(anyBg)) toUnitsString(anyBg * Constants.MMOLL_TO_MGDL, anyBg, profileFunction.getUnits()) - else toUnitsString(anyBg, anyBg * Constants.MGDL_TO_MMOLL, profileFunction.getUnits()) - - fun toMgdl(value: Double): Double = - if (isMgdl(value)) value else value * Constants.MMOLL_TO_MGDL - - fun toMgdl(value: Double, units: GlucoseUnit): Double = - if (units == GlucoseUnit.MGDL) value else value * Constants.MMOLL_TO_MGDL - - fun toMmol(value: Double, units: GlucoseUnit): Double = - if (units == GlucoseUnit.MGDL) value * Constants.MGDL_TO_MMOLL else value - - // targets are stored in mg/dl but profile vary - fun toTargetRangeString(low: Double, high: Double, sourceUnits: GlucoseUnit, units: GlucoseUnit): String { - val lowMgdl = toMgdl(low, sourceUnits) - val highMgdl = toMgdl(high, sourceUnits) - val lowMmol = toMmol(low, sourceUnits) - val highMmol = toMmol(high, sourceUnits) - return if (low == high) toUnitsString(lowMgdl, lowMmol, units) else toUnitsString(lowMgdl, lowMmol, units) + " - " + toUnitsString(highMgdl, highMmol, units) - } - - } -} \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt index 29d7dbef52..49eac5acaf 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/ProfileFunction.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.interfaces import info.nightscout.database.entities.ProfileSwitch import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore interface ProfileFunction { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt index a5cef52fcd..4c96f1fd2f 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/GlucoseValueDataPoint.kt @@ -1,13 +1,14 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.core.main.R +import info.nightscout.core.profile.toCurrentUnitsString import info.nightscout.database.entities.GlucoseValue import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.interfaces.ResourceHelper class GlucoseValueDataPoint( diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt index 916cf8c9fb..dbd2e31de6 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/TherapyEventDataPoint.kt @@ -1,12 +1,14 @@ package info.nightscout.androidaps.plugins.general.overview.graphExtensions import android.content.Context -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.Translator import info.nightscout.core.main.R +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toUnits import info.nightscout.database.entities.TherapyEvent import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.interfaces.ResourceHelper class TherapyEventDataPoint( diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt index 3d38653bf9..45f9561110 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/plugins/pump/common/bolusInfo/TemporaryBasalStorage.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.common.bolusInfo import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt index 811888d85e..438e55f274 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/DecimalFormatter.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.utils import info.nightscout.core.main.R -import info.nightscout.androidaps.interfaces.Pump +import info.nightscout.interfaces.pump.Pump import info.nightscout.shared.interfaces.ResourceHelper import java.text.DecimalFormat diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt index b346feaffc..13b9922535 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt @@ -1,11 +1,12 @@ package info.nightscout.androidaps.utils -import info.nightscout.interfaces.Constants import info.nightscout.androidaps.annotations.OpenForTesting -import info.nightscout.core.main.R -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.core.main.R +import info.nightscout.core.profile.toCurrentUnits +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt index 16bbc77974..44ebd8a998 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/DefaultEditTextValidator.kt @@ -7,10 +7,37 @@ import android.text.TextWatcher import android.widget.EditText import com.google.android.material.textfield.TextInputLayout import dagger.android.HasAndroidInjector -import info.nightscout.core.main.R -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.textValidator.validators.* +import info.nightscout.androidaps.utils.textValidator.validators.AlphaNumericValidator +import info.nightscout.androidaps.utils.textValidator.validators.AlphaValidator +import info.nightscout.androidaps.utils.textValidator.validators.AndValidator +import info.nightscout.androidaps.utils.textValidator.validators.BgRangeValidator +import info.nightscout.androidaps.utils.textValidator.validators.CreditCardValidator +import info.nightscout.androidaps.utils.textValidator.validators.DateValidator +import info.nightscout.androidaps.utils.textValidator.validators.DomainValidator +import info.nightscout.androidaps.utils.textValidator.validators.DummyValidator +import info.nightscout.androidaps.utils.textValidator.validators.EmailValidator +import info.nightscout.androidaps.utils.textValidator.validators.EmptyValidator +import info.nightscout.androidaps.utils.textValidator.validators.FloatNumericRangeValidator +import info.nightscout.androidaps.utils.textValidator.validators.HttpsUrlValidator +import info.nightscout.androidaps.utils.textValidator.validators.IpAddressValidator +import info.nightscout.androidaps.utils.textValidator.validators.MinDigitLengthValidator +import info.nightscout.androidaps.utils.textValidator.validators.MultiPhoneValidator +import info.nightscout.androidaps.utils.textValidator.validators.MultiValidator +import info.nightscout.androidaps.utils.textValidator.validators.NotValidator +import info.nightscout.androidaps.utils.textValidator.validators.NumericRangeValidator +import info.nightscout.androidaps.utils.textValidator.validators.NumericValidator +import info.nightscout.androidaps.utils.textValidator.validators.OrValidator +import info.nightscout.androidaps.utils.textValidator.validators.PersonFullNameValidator +import info.nightscout.androidaps.utils.textValidator.validators.PersonNameValidator +import info.nightscout.androidaps.utils.textValidator.validators.PhoneValidator +import info.nightscout.androidaps.utils.textValidator.validators.PinStrengthValidator +import info.nightscout.androidaps.utils.textValidator.validators.RegexpValidator +import info.nightscout.androidaps.utils.textValidator.validators.Validator +import info.nightscout.androidaps.utils.textValidator.validators.WebUrlValidator +import info.nightscout.core.main.R +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.interfaces.profile.Profile import javax.inject.Inject @Suppress("SpellCheckingInspection") @@ -110,7 +137,7 @@ class DefaultEditTextValidator : EditTextValidator { defaultEmptyErrorString = context.getString(R.string.error_field_must_not_be_empty) setEmptyErrorString(emptyErrorStringDef) mValidator = AndValidator() - val toAdd: Validator = + val toAdd: Validator = when (testType) { EditTextValidator.TEST_NOCHECK -> DummyValidator() EditTextValidator.TEST_ALPHA -> AlphaValidator(if (TextUtils.isEmpty(testErrorString)) context.getString(R.string.error_only_standard_letters_are_allowed) else testErrorString) diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt index 354ad7daab..af7f37b0f1 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/ValidatingEditTextPreference.kt @@ -5,9 +5,11 @@ import android.util.AttributeSet import androidx.preference.EditTextPreference import androidx.preference.PreferenceViewHolder import dagger.android.HasAndroidInjector -import info.nightscout.core.main.R -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.core.main.R +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toMgdl +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.SafeParse import javax.inject.Inject diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt index 33915141f8..9a716193a6 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/textValidator/validators/BgRangeValidator.kt @@ -1,8 +1,9 @@ package info.nightscout.androidaps.utils.textValidator.validators import android.widget.EditText -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.interfaces.profile.Profile class BgRangeValidator(_customErrorMessage: String?, private val min: Int, private val max: Int, private val profileFunction: ProfileFunction) : Validator(_customErrorMessage) { diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt index 1517b19d39..a6072fec6c 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/BasalProfileGraph.kt @@ -7,7 +7,7 @@ import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries import info.nightscout.core.main.R -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.Round import java.text.NumberFormat import kotlin.math.max diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt index 4af96b9f65..e04eceb4ee 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IcProfileGraph.kt @@ -7,7 +7,7 @@ import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries import info.nightscout.core.main.R -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.Round import java.text.NumberFormat import kotlin.math.max diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt index 3906db112e..3dde0ec2fe 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/IsfProfileGraph.kt @@ -7,7 +7,8 @@ import com.jjoe64.graphview.GraphView import com.jjoe64.graphview.series.DataPoint import com.jjoe64.graphview.series.LineGraphSeries import info.nightscout.core.main.R -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.Round import java.text.NumberFormat import kotlin.math.max diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt index f2feee5ed9..55e90c4012 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/ui/TargetBgProfileGraph.kt @@ -4,11 +4,12 @@ import android.content.Context import android.util.AttributeSet import com.jjoe64.graphview.DefaultLabelFormatter import com.jjoe64.graphview.GraphView -import info.nightscout.core.main.R -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.general.overview.graphExtensions.AreaGraphSeries import info.nightscout.androidaps.plugins.general.overview.graphExtensions.DoubleDataPoint +import info.nightscout.core.main.R +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.Round import java.text.NumberFormat import kotlin.math.max diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt index b2f5da37e4..2de85ac78d 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt +++ b/core/core-main/src/main/java/info/nightscout/androidaps/utils/userEntry/UserEntryPresentationHelper.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps.utils.userEntry import android.text.Spanned import dagger.Reusable -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.Translator import info.nightscout.core.main.R +import info.nightscout.core.profile.toUnitsString import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.ColorGroup @@ -14,6 +14,7 @@ import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil diff --git a/core/core-main/src/main/java/info/nightscout/core/profile/ProfileExtension.kt b/core/core-main/src/main/java/info/nightscout/core/profile/ProfileExtension.kt new file mode 100644 index 0000000000..60d1157328 --- /dev/null +++ b/core/core-main/src/main/java/info/nightscout/core/profile/ProfileExtension.kt @@ -0,0 +1,80 @@ +package info.nightscout.core.profile + +import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile +import org.joda.time.DateTime + +/* + * Midnight time conversion + */ +fun Profile.Companion.secondsFromMidnight(): Int { + val passed = DateTime().millisOfDay.toLong() + return (passed / 1000).toInt() +} + +fun Profile.Companion.secondsFromMidnight(date: Long): Int { + val passed = DateTime(date).millisOfDay.toLong() + return (passed / 1000).toInt() +} + +fun Profile.Companion.milliSecFromMidnight(date: Long): Long { + return DateTime(date).millisOfDay.toLong() +} +/* + * Units conversion + */ + +fun Profile.Companion.fromMgdlToUnits(value: Double, units: GlucoseUnit): Double = + if (units == GlucoseUnit.MGDL) value else value * Constants.MGDL_TO_MMOLL + +fun Profile.Companion.fromMmolToUnits(value: Double, units: GlucoseUnit): Double = + if (units == GlucoseUnit.MMOL) value else value * Constants.MMOLL_TO_MGDL + +fun Profile.Companion.toUnits(valueInMgdl: Double, valueInMmol: Double, units: GlucoseUnit): Double = + if (units == GlucoseUnit.MGDL) valueInMgdl else valueInMmol + +fun Profile.Companion.toUnitsString(valueInMgdl: Double, valueInMmol: Double, units: GlucoseUnit): String = + if (units == GlucoseUnit.MGDL) DecimalFormatter.to0Decimal(valueInMgdl) else DecimalFormatter.to1Decimal(valueInMmol) + +fun Profile.Companion.toSignedUnitsString(valueInMgdl: Double, valueInMmol: Double, units: GlucoseUnit): String = + if (units == GlucoseUnit.MGDL) (if (valueInMgdl > 0) "+" else "") + DecimalFormatter.to0Decimal(valueInMgdl) + else (if (valueInMmol > 0) "+" else "") + DecimalFormatter.to1Decimal(valueInMmol) + +fun Profile.Companion.isMgdl(anyBg: Double) = anyBg >= 39 +fun Profile.Companion.isMmol(anyBg: Double) = anyBg < 39 +fun Profile.Companion.unit(anyBg: Double) = if (isMgdl(anyBg)) GlucoseUnit.MGDL else GlucoseUnit.MMOL + +fun Profile.Companion.toCurrentUnits(profileFunction: ProfileFunction, anyBg: Double): Double = + if (isMmol(anyBg)) fromMmolToUnits(anyBg, profileFunction.getUnits()) + else fromMgdlToUnits(anyBg, profileFunction.getUnits()) + +fun Profile.Companion.toCurrentUnits(units: GlucoseUnit, anyBg: Double): Double = + if (isMmol(anyBg)) fromMmolToUnits(anyBg, units) + else fromMgdlToUnits(anyBg, units) + +fun Profile.Companion.toCurrentUnitsString(profileFunction: ProfileFunction, anyBg: Double): String = + if (isMmol(anyBg)) toUnitsString(anyBg * Constants.MMOLL_TO_MGDL, anyBg, profileFunction.getUnits()) + else toUnitsString(anyBg, anyBg * Constants.MGDL_TO_MMOLL, profileFunction.getUnits()) + +fun Profile.Companion.toMgdl(value: Double): Double = + if (isMgdl(value)) value else value * Constants.MMOLL_TO_MGDL + +fun Profile.Companion.toMgdl(value: Double, units: GlucoseUnit): Double = + if (units == GlucoseUnit.MGDL) value else value * Constants.MMOLL_TO_MGDL + +fun Profile.Companion.toMmol(value: Double, units: GlucoseUnit): Double = + if (units == GlucoseUnit.MGDL) value * Constants.MGDL_TO_MMOLL else value + +// targets are stored in mg/dl but profile vary +fun Profile.Companion.toTargetRangeString(low: Double, high: Double, sourceUnits: GlucoseUnit, units: GlucoseUnit): String { + val lowMgdl = toMgdl(low, sourceUnits) + val highMgdl = toMgdl(high, sourceUnits) + val lowMmol = toMmol(low, sourceUnits) + val highMmol = toMmol(high, sourceUnits) + return if (low == high) toUnitsString(lowMgdl, lowMmol, units) + else toUnitsString(lowMgdl, lowMmol, units) + " - " + toUnitsString(highMgdl, highMmol, units) +} + diff --git a/core/core-main/src/main/java/info/nightscout/core/profile/ProfileStoreObject.kt b/core/core-main/src/main/java/info/nightscout/core/profile/ProfileStoreObject.kt index 2c6b42118e..d66ebcba86 100644 --- a/core/core-main/src/main/java/info/nightscout/core/profile/ProfileStoreObject.kt +++ b/core/core-main/src/main/java/info/nightscout/core/profile/ProfileStoreObject.kt @@ -3,12 +3,12 @@ package info.nightscout.core.profile import androidx.collection.ArrayMap import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.interfaces.Config import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.interfaces.profile.PureProfile +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpStateExtension.kt b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpStateExtension.kt index b4d6bce4bc..f82adc569b 100644 --- a/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpStateExtension.kt +++ b/core/core-main/src/main/java/info/nightscout/core/pumpExtensions/PumpStateExtension.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.extensions -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.utils.DecimalFormatter +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T import kotlin.math.ceil diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index eef46d8a41..ce9a00c156 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,16 +4,16 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP @@ -35,6 +35,7 @@ open class TestBaseWithProfile : TestBase() { @Mock lateinit var sp: SP @Mock lateinit var context: Context @Mock lateinit var repository: AppRepository + @Mock lateinit var hardLimits: HardLimits lateinit var testPumpPlugin: TestPumpPlugin @@ -48,7 +49,7 @@ open class TestBaseWithProfile : TestBase() { it.config = config it.rh = rh it.rxBus = rxBus - it.hardLimits = HardLimits(aapsLogger, rxBus, sp, rh, context, repository) + it.hardLimits = hardLimits } } } diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 7829779b22..7262510558 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt index c85e1fc21a..ef5d3a8899 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt @@ -4,19 +4,25 @@ import android.content.Context import dagger.android.AndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestPumpPlugin -import info.nightscout.core.main.R -import info.nightscout.database.impl.AppRepository +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.shared.utils.DateUtil -import info.nightscout.androidaps.utils.HardLimits -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.core.main.R +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toMgdl +import info.nightscout.core.profile.toMmol +import info.nightscout.core.profile.toTargetRangeString +import info.nightscout.core.profile.toUnits +import info.nightscout.core.profile.toUnitsString +import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.rx.TestAapsSchedulers 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.json.JSONObject import org.junit.Assert import org.junit.Before @@ -38,11 +44,11 @@ class ProfileTest : TestBase() { @Mock lateinit var config: Config @Mock lateinit var sp: SP @Mock lateinit var repository: AppRepository + @Mock lateinit var hardLimits: HardLimits private lateinit var rxBus: RxBus private lateinit var dateUtil: DateUtil private lateinit var testPumpPlugin: TestPumpPlugin - private lateinit var hardLimits: HardLimits private var okProfile = "{\"dia\":\"5\",\"carbratio\":[{\"time\":\"00:00\",\"value\":\"30\"}]," + "\"sens\":[{\"time\":\"00:00\",\"value\":\"6\"},{\"time\":\"2:00\",\"value\":\"6.2\"}],\"timezone\":\"UTC\",\"basal\":[{\"time\":\"00:00\",\"value\":\"0.1\"}],\"target_low\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"target_high\":[{\"time\":\"00:00\",\"value\":\"5\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" @@ -64,7 +70,6 @@ class ProfileTest : TestBase() { testPumpPlugin = TestPumpPlugin { AndroidInjector { } } dateUtil = DateUtil(context) rxBus = RxBus(TestAapsSchedulers(), aapsLogger) - hardLimits = HardLimits(aapsLogger, rxBus, sp, rh, context, repository) `when`(activePluginProvider.activePump).thenReturn(testPumpPlugin) `when`(rh.gs(R.string.profile_per_unit)).thenReturn("/U") `when`(rh.gs(R.string.profile_carbs_per_unit)).thenReturn("g/U") diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt index d54568e4ae..dbec87ad2a 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/pump/bolusInfo/TemporaryBasalStorageTest.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.pump.bolusInfo import info.nightscout.androidaps.TestBase -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage +import info.nightscout.interfaces.pump.PumpSync import org.junit.Assert.assertEquals import org.junit.Assert.assertNull import org.junit.Before diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt b/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt similarity index 76% rename from core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt rename to implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt index de39a4ef78..f1641ef0e5 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt +++ b/implementation/src/main/java/info/nightscout/implementation/HardLimitsImpl.kt @@ -1,13 +1,15 @@ -package info.nightscout.androidaps.utils +package info.nightscout.implementation import android.content.Context import info.nightscout.androidaps.annotations.OpenForTesting +import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.core.main.R import info.nightscout.database.impl.AppRepository import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction -import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.kotlin.plusAssign @@ -18,14 +20,14 @@ import kotlin.math.min @OpenForTesting @Singleton -class HardLimits @Inject constructor( +class HardLimitsImpl @Inject constructor( private val aapsLogger: AAPSLogger, private val rxBus: RxBus, private val sp: SP, private val rh: ResourceHelper, private val context: Context, private val repository: AppRepository -) { +) : HardLimits { private val disposable = CompositeDisposable() @@ -70,26 +72,26 @@ class HardLimits @Inject constructor( rh.gs(R.string.key_adult) -> ADULT rh.gs(R.string.key_resistantadult) -> RESISTANT_ADULT rh.gs(R.string.key_pregnant) -> PREGNANT - else -> ADULT + else -> ADULT } - fun maxBolus(): Double = MAX_BOLUS[loadAge()] - fun maxIobAMA(): Double = MAX_IOB_AMA[loadAge()] - fun maxIobSMB(): Double = MAX_IOB_SMB[loadAge()] - fun maxBasal(): Double = MAX_BASAL[loadAge()] - fun minDia(): Double = MIN_DIA[loadAge()] - fun maxDia(): Double = MAX_DIA[loadAge()] - fun minIC(): Double = MIN_IC[loadAge()] - fun maxIC(): Double = MAX_IC[loadAge()] + override fun maxBolus(): Double = MAX_BOLUS[loadAge()] + override fun maxIobAMA(): Double = MAX_IOB_AMA[loadAge()] + override fun maxIobSMB(): Double = MAX_IOB_SMB[loadAge()] + override fun maxBasal(): Double = MAX_BASAL[loadAge()] + override fun minDia(): Double = MIN_DIA[loadAge()] + override fun maxDia(): Double = MAX_DIA[loadAge()] + override fun minIC(): Double = MIN_IC[loadAge()] + override fun maxIC(): Double = MAX_IC[loadAge()] // safety checks - fun checkHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Boolean = - value == verifyHardLimits(value, valueName, lowLimit, highLimit) + override fun checkHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Boolean = + value == verifyHardLimits(value, valueName, lowLimit, highLimit) - fun isInRange(value: Double, lowLimit: Double, highLimit: Double): Boolean = + override fun isInRange(value: Double, lowLimit: Double, highLimit: Double): Boolean = value in lowLimit..highLimit - fun verifyHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Double { + override fun verifyHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Double { var newValue = value if (newValue < lowLimit || newValue > highLimit) { newValue = max(newValue, lowLimit) diff --git a/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt b/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt index f1f7e5a011..5fdd617c2e 100644 --- a/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/constraints/ConstraintsImpl.kt @@ -2,8 +2,8 @@ package info.nightscout.implementation.constraints import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.profile.Profile import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt index 1ebf7218dd..e6cf6101c2 100644 --- a/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt +++ b/implementation/src/main/java/info/nightscout/implementation/di/ImplementationModule.kt @@ -4,7 +4,14 @@ import android.content.Context import dagger.Module import dagger.Provides import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.database.impl.AppRepository +import info.nightscout.implementation.HardLimitsImpl +import info.nightscout.implementation.resources.ResourceHelperImpl +import info.nightscout.interfaces.utils.HardLimits +import info.nightscout.rx.bus.RxBus +import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Singleton @Module( @@ -15,8 +22,14 @@ import javax.inject.Singleton @Suppress("unused") open class ImplementationModule { + @Provides @Singleton fun provideResources(context: Context, fabricPrivacy: FabricPrivacy): ResourceHelper = - info.nightscout.implementation.resources.ResourceHelperImpl(context, fabricPrivacy) + ResourceHelperImpl(context, fabricPrivacy) + + @Provides + @Singleton + fun provideHardLimits(aapsLogger: AAPSLogger, rxBus: RxBus, sp: SP, rh: ResourceHelper, context: Context, repository: AppRepository): HardLimits = + HardLimitsImpl(aapsLogger, rxBus, sp, rh, context, repository) } \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt index 1afa3c168b..4d71325c0a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/pump/PumpSyncImplementation.kt @@ -2,7 +2,6 @@ package info.nightscout.implementation.pump import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.core.main.R @@ -38,6 +37,7 @@ import info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransact import info.nightscout.database.impl.transactions.SyncTemporaryBasalWithTempIdTransaction import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.VirtualPump import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.bus.RxBus diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt index 6ed3b595ec..c6e5a7d41f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/CommandQueueImplementation.kt @@ -10,18 +10,16 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.dialogs.BolusProgressDialog +import info.nightscout.androidaps.extensions.getCustomizedName import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBolusProgressIfRunning import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.queue.commands.Command.CommandType -import info.nightscout.androidaps.utils.extensions.getCustomizedName import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.pumpExtensions.insertCarbsTransaction import info.nightscout.database.entities.EffectiveProfileSwitch @@ -52,8 +50,10 @@ import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.CustomCommand import info.nightscout.interfaces.ui.ActivityNames diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt index 6e5f8618fb..d7164e8c8c 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandSetProfile.kt @@ -4,12 +4,12 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.queue.commands.Command import info.nightscout.database.impl.ValueWrapper import info.nightscout.implementation.R import info.nightscout.interfaces.Config import info.nightscout.interfaces.plugin.PluginBase +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.smsCommunicator.SmsCommunicator import info.nightscout.rx.logging.LTag diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt index f9d3077b1f..fa1bcf0b22 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalAbsolute.kt @@ -2,13 +2,12 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.implementation.R +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.LTag - import javax.inject.Inject class CommandTempBasalAbsolute( diff --git a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt index 0d7d287ca6..cf01966ccc 100644 --- a/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt +++ b/implementation/src/main/java/info/nightscout/implementation/queue/commands/CommandTempBasalPercent.kt @@ -2,13 +2,12 @@ package info.nightscout.implementation.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.interfaces.queue.Callback import info.nightscout.androidaps.queue.commands.Command import info.nightscout.implementation.R +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.logging.LTag - import javax.inject.Inject class CommandTempBasalPercent( diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt index 314c9e63fc..7e2e15fa7a 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/DexcomTirImpl.kt @@ -6,13 +6,15 @@ import android.graphics.Typeface import android.view.Gravity import android.widget.TableRow import android.widget.TextView -import info.nightscout.interfaces.Constants -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.DexcomTIR +import info.nightscout.core.profile.toCurrentUnitsString +import info.nightscout.core.profile.toUnitsString import info.nightscout.implementation.R -import java.util.* +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.Profile +import info.nightscout.shared.interfaces.ResourceHelper +import java.util.Calendar import kotlin.math.pow import kotlin.math.roundToInt import kotlin.math.sqrt diff --git a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt b/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt index 9c62357b90..7958695c4f 100644 --- a/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt +++ b/implementation/src/main/java/info/nightscout/implementation/stats/TirCalculatorImpl.kt @@ -8,17 +8,18 @@ import android.view.Gravity import android.view.ViewGroup import android.widget.TableLayout import android.widget.TextView -import info.nightscout.interfaces.Constants -import info.nightscout.database.impl.AppRepository -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.interfaces.stats.TIR import info.nightscout.androidaps.interfaces.stats.TirCalculator -import info.nightscout.shared.utils.DateUtil -import info.nightscout.interfaces.utils.MidnightTime -import info.nightscout.shared.utils.T +import info.nightscout.core.profile.toCurrentUnitsString +import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.R +import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.utils.MidnightTime +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c02f09ecf8..7f76f71a53 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,10 +4,10 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.EffectiveProfileSwitch diff --git a/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 7829779b22..7262510558 100644 --- a/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/implementation/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt index 532b7dee34..593c8397ae 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/CommandQueueImplementationTest.kt @@ -10,7 +10,6 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.queue.commands.Command import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.Bolus @@ -27,6 +26,7 @@ import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.Config import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.queue.CustomCommand import info.nightscout.interfaces.ui.ActivityNames diff --git a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt index 0ee309ab82..eab716d753 100644 --- a/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt +++ b/implementation/src/test/java/info/nightscout/implementation/queue/QueueThreadTest.kt @@ -8,7 +8,6 @@ import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.queue.commands.Command import info.nightscout.database.impl.AppRepository import info.nightscout.implementation.R @@ -16,6 +15,7 @@ import info.nightscout.implementation.queue.commands.CommandTempBasalAbsolute import info.nightscout.interfaces.AndroidPermission import info.nightscout.interfaces.BuildHelper import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.shared.sharedPreferences.SP diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 1d96b532f0..ed44fd4789 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -39,12 +39,8 @@ import info.nightscout.androidaps.insight.database.InsightPumpID; import info.nightscout.androidaps.insight.database.InsightPumpID.EventType; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; -import info.nightscout.androidaps.interfaces.Pump; import info.nightscout.androidaps.interfaces.PumpPluginBase; -import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.androidaps.interfaces.PumpSync.PumpState.TemporaryBasal; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.pump.insight.app_layer.Service; @@ -118,9 +114,13 @@ import info.nightscout.interfaces.constraints.Constraint; import info.nightscout.interfaces.notifications.Notification; import info.nightscout.interfaces.plugin.PluginDescription; import info.nightscout.interfaces.plugin.PluginType; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.interfaces.pump.Insight; +import info.nightscout.interfaces.pump.Pump; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; +import info.nightscout.interfaces.pump.PumpSync.PumpState.TemporaryBasal; import info.nightscout.interfaces.pump.defs.ManufacturerType; import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.interfaces.pump.defs.PumpType; diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightPairingActivity.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightPairingActivity.java index fda0450c1f..b72bfc3589 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightPairingActivity.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/activities/InsightPairingActivity.java @@ -1,6 +1,5 @@ package info.nightscout.androidaps.plugins.pump.insight.activities; -import info.nightscout.androidaps.extensions.BluetoothAdapterExtensionKt; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothManager; @@ -34,13 +33,14 @@ import java.util.List; import javax.inject.Inject; import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; +import info.nightscout.androidaps.extensions.BluetoothAdapterExtensionKt; import info.nightscout.androidaps.extensions.IntentExtensionKt; import info.nightscout.androidaps.insight.R; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.pump.common.ble.BlePreCheck; import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService; import info.nightscout.androidaps.plugins.pump.insight.descriptors.InsightState; import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator; +import info.nightscout.interfaces.pump.PumpSync; public class InsightPairingActivity extends NoSplashAppCompatActivity implements InsightConnectionService.StateCallback, View.OnClickListener, InsightConnectionService.ExceptionCallback { diff --git a/interfaces/src/main/java/info/nightscout/interfaces/profile/Profile.kt b/interfaces/src/main/java/info/nightscout/interfaces/profile/Profile.kt new file mode 100644 index 0000000000..2c380a0158 --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/profile/Profile.kt @@ -0,0 +1,138 @@ +package info.nightscout.interfaces.profile + +import info.nightscout.interfaces.Config +import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.pump.Pump +import info.nightscout.interfaces.utils.HardLimits +import info.nightscout.interfaces.utils.Round +import info.nightscout.rx.bus.RxBus +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import org.json.JSONObject + +interface Profile { + + class ValidityCheck(var isValid: Boolean = true, val reasons: ArrayList = arrayListOf()) + + fun isValid(from: String, pump: Pump, config: Config, rh: ResourceHelper, rxBus: RxBus, hardLimits: HardLimits, sendNotifications: Boolean): ValidityCheck + + /** + * Units used for ISF & target + */ + val units: GlucoseUnit + + //@Deprecated("Replace in favor of accessing InsulinProfile") + val dia: Double + + val percentage: Int + + /** + * Timeshift modifier of base profile in hours + */ + val timeshift: Int + + /** + * is equal to another profile? + */ + fun isEqual(profile: Profile): Boolean + + /** + * Basal value according to "now" + */ + fun getBasal(): Double + + /** + * Basal value according to timestamp + */ + fun getBasal(timestamp: Long): Double + + /** + * I:C value according to "now" + */ + fun getIc(): Double + + /** + * I:C value according to timestamp + */ + fun getIc(timestamp: Long): Double + + /** + * ISF value according to "now"" in MGDL + */ + fun getIsfMgdl(): Double + + /** + * ISF value according to timestamp in MGDL + */ + fun getIsfMgdl(timestamp: Long): Double + + /** + * Average target value according to "now" in MGDL + */ + fun getTargetMgdl(): Double + fun getTargetLowMgdl(): Double + fun getTargetLowMgdl(timestamp: Long): Double + fun getTargetHighMgdl(): Double + fun getTargetHighMgdl(timestamp: Long): Double + + /** + * Basal value according to elapsed seconds from midnight + */ + fun getBasalTimeFromMidnight(timeAsSeconds: Int): Double + + /** + * I:C value according to elapsed seconds from midnight + */ + fun getIcTimeFromMidnight(timeAsSeconds: Int): Double + + /** + * ISF value according to elapsed seconds from midnight + */ + fun getIsfMgdlTimeFromMidnight(timeAsSeconds: Int): Double + + /** + * Low target value according to elapsed seconds from midnight + */ + fun getTargetLowMgdlTimeFromMidnight(timeAsSeconds: Int): Double + + /** + * High target value according to elapsed seconds from midnight in MGDL + */ + fun getTargetHighMgdlTimeFromMidnight(timeAsSeconds: Int): Double + + fun getIcList(rh: ResourceHelper, dateUtil: DateUtil): String + fun getIsfList(rh: ResourceHelper, dateUtil: DateUtil): String + fun getBasalList(rh: ResourceHelper, dateUtil: DateUtil): String + fun getTargetList(rh: ResourceHelper, dateUtil: DateUtil): String + + fun convertToNonCustomizedProfile(dateUtil: DateUtil): PureProfile + fun toPureNsJson(dateUtil: DateUtil): JSONObject + fun getMaxDailyBasal(): Double + fun baseBasalSum(): Double + fun percentageBasalSum(): Double + + fun getBasalValues(): Array + fun getIcsValues(): Array + fun getIsfsMgdlValues(): Array + fun getSingleTargetsMgdl(): Array + + open class ProfileValue(var timeAsSeconds: Int, var value: Double) { + + override fun equals(other: Any?): Boolean { + if (other !is ProfileValue) { + return false + } + return timeAsSeconds == other.timeAsSeconds && Round.isSame(value, other.value) + } + + override fun hashCode(): Int { + var result = timeAsSeconds + result = 31 * result + value.hashCode() + return result + } + } + + companion object { + + } +} \ No newline at end of file diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/Pump.kt similarity index 96% rename from core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/Pump.kt index 8a669ca254..7ab5ecebf6 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/Pump.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/Pump.kt @@ -1,7 +1,6 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces.pump -import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.pump.defs.ManufacturerType @@ -13,7 +12,7 @@ import org.json.JSONObject /** * This interface defines the communication from AAPS-core to pump drivers. - * Pump drivers communicate data changes back to AAPS-core using [info.nightscout.androidaps.interfaces.PumpSync]. + * Pump drivers communicate data changes back to AAPS-core using [info.nightscout.interfaces.pump.PumpSync]. * * Created by mike on 04.06.2016. */ @@ -202,7 +201,7 @@ interface Pump { /** * Pump model * - * If new model is covered by driver, model and it's capabilities must be added to [info.nightscout.androidaps.plugins.pump.common.defs.PumpType] + * If new model is covered by driver, model and it's capabilities must be added to [info.nightscout.interfaces.pump.defs.PumpType] * * @return PumpType */ @@ -258,7 +257,7 @@ interface Pump { /** * Executes a custom queued command - * See [CommandQueue.customCommand] for queuing a custom command. + * See [info.nightscout.interfaces.queue.CustomCommand] for queuing a custom command. * * @param customCommand the custom command to be executed * @return PumpEnactResult that represents the command execution result diff --git a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt b/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpSync.kt similarity index 96% rename from core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt rename to interfaces/src/main/java/info/nightscout/interfaces/pump/PumpSync.kt index 4d5d7907a3..a0b5b23c36 100644 --- a/core/core-main/src/main/java/info/nightscout/androidaps/interfaces/PumpSync.kt +++ b/interfaces/src/main/java/info/nightscout/interfaces/pump/PumpSync.kt @@ -1,7 +1,7 @@ -package info.nightscout.androidaps.interfaces +package info.nightscout.interfaces.pump -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.defs.PumpType /** @@ -268,7 +268,7 @@ interface PumpSync { * if db record already has endPumpId assigned by [syncStopTemporaryBasalWithPumpId] other updates * are ignored * - * see [info.nightscout.androidaps.database.transactions.SyncPumpTemporaryBasalTransaction] + * see [info.nightscout.database.impl.transactions.SyncPumpTemporaryBasalTransaction] * * @param timestamp timestamp of event from pump history * @param rate TBR rate in U/h or % (value of 100% is equal to no TBR) @@ -298,7 +298,7 @@ interface PumpSync { * endPumpId is stored to running record * If db record doesn't exist data is ignored and false returned * - * see [info.nightscout.androidaps.database.transactions.SyncPumpCancelTemporaryBasalIfAnyTransaction] + * see [info.nightscout.database.impl.transactions.SyncPumpCancelTemporaryBasalIfAnyTransaction] * * @param timestamp timestamp of event from pump history * @param endPumpId pump id of ending event from history @@ -332,7 +332,7 @@ interface PumpSync { * @param pumpSerial pump serial number * @return true if new record is created * - * see [info.nightscout.androidaps.database.transactions.InsertTemporaryBasalWithTempIdTransaction] + * see [info.nightscout.database.impl.transactions.InsertTemporaryBasalWithTempIdTransaction] **/ fun addTemporaryBasalWithTempId(timestamp: Long, rate: Double, duration: Long, isAbsolute: Boolean, tempId: Long, type: TemporaryBasalType, pumpType: PumpType, pumpSerial: String): Boolean @@ -424,7 +424,7 @@ interface PumpSync { * If db record doesn't exist, new record is created. * isValid field is preserved * - * see [info.nightscout.androidaps.database.transactions.SyncPumpExtendedBolusTransaction] + * see [info.nightscout.database.impl.transactions.SyncPumpExtendedBolusTransaction] * * @param timestamp timestamp of event from pump history * @param amount EB total amount in U @@ -452,7 +452,7 @@ interface PumpSync { * endPumpId is stored to running record * If db record doesn't exist data is ignored and false returned * - * see [info.nightscout.androidaps.database.transactions.SyncPumpCancelExtendedBolusIfAnyTransaction] + * see [info.nightscout.database.impl.transactions.SyncPumpCancelExtendedBolusIfAnyTransaction] * * @param timestamp timestamp of event from pump history * @param endPumpId pump id of ending event from history @@ -477,7 +477,7 @@ interface PumpSync { * isValid field is preserved * If db record doesn't exist, new record is created. * - * see [info.nightscout.androidaps.database.transactions.SyncPumpTotalDailyDoseTransaction] + * see [info.nightscout.database.impl.transactions.SyncPumpTotalDailyDoseTransaction] * * @param timestamp timestamp of event from pump history * @param bolusAmount bolus part diff --git a/interfaces/src/main/java/info/nightscout/interfaces/utils/HardLimits.kt b/interfaces/src/main/java/info/nightscout/interfaces/utils/HardLimits.kt new file mode 100644 index 0000000000..b957d08f9d --- /dev/null +++ b/interfaces/src/main/java/info/nightscout/interfaces/utils/HardLimits.kt @@ -0,0 +1,47 @@ +package info.nightscout.interfaces.utils + +interface HardLimits { + companion object { + + // Very Hard Limits Ranges + // First value is the Lowest and second value is the Highest a Limit can define + val VERY_HARD_LIMIT_MIN_BG = doubleArrayOf(80.0, 180.0) + val VERY_HARD_LIMIT_MAX_BG = doubleArrayOf(90.0, 200.0) + val VERY_HARD_LIMIT_TARGET_BG = doubleArrayOf(80.0, 200.0) + + // Very Hard Limits Ranges for Temp Targets + val VERY_HARD_LIMIT_TEMP_MIN_BG = intArrayOf(72, 180) + val VERY_HARD_LIMIT_TEMP_MAX_BG = intArrayOf(72, 270) + val VERY_HARD_LIMIT_TEMP_TARGET_BG = intArrayOf(72, 200) + val MIN_DIA = doubleArrayOf(5.0, 5.0, 5.0, 5.0, 5.0) + val MAX_DIA = doubleArrayOf(9.0, 9.0, 9.0, 9.0, 10.0) + val MIN_IC = doubleArrayOf(2.0, 2.0, 2.0, 2.0, 0.3) + val MAX_IC = doubleArrayOf(100.0, 100.0, 100.0, 100.0, 100.0) + const val MIN_ISF = 2.0 // mgdl + const val MAX_ISF = 1000.0 // mgdl + val MAX_IOB_AMA = doubleArrayOf(3.0, 5.0, 7.0, 12.0, 25.0) + val MAX_IOB_SMB = doubleArrayOf(7.0, 13.0, 22.0, 30.0, 70.0) + val MAX_BASAL = doubleArrayOf(2.0, 5.0, 10.0, 12.0, 25.0) + + //LGS Hard limits + //No IOB at all + const val MAX_IOB_LGS = 0.0 + } + + fun maxBolus(): Double + fun maxIobAMA(): Double + fun maxIobSMB(): Double + fun maxBasal(): Double + fun minDia(): Double + fun maxDia(): Double + fun minIC(): Double + fun maxIC(): Double + + // safety checks + fun checkHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Boolean + + fun isInRange(value: Double, lowLimit: Double, highLimit: Double): Boolean + + fun verifyHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Double + +} \ No newline at end of file diff --git a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt index d63acfd0d6..3313a5ed2b 100644 --- a/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt +++ b/plugins/src/main/java/info/nightscout/plugins/configBuilder/RunningConfiguration.kt @@ -1,7 +1,6 @@ package info.nightscout.plugins.configBuilder import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Sensitivity import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.core.main.R @@ -10,6 +9,7 @@ import info.nightscout.interfaces.ConfigBuilder import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.sync.NsClient import info.nightscout.plugins.sync.nsShared.events.EventNSClientNewLog diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt index bad815109a..6d2cbc2b51 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneFragment.kt @@ -22,16 +22,17 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.alertDialogs.OKDialog.showConfirmation import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject +import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.interfaces.utils.Round diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt index cfc929c823..a3fa051a41 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotuneIob.kt @@ -3,9 +3,9 @@ package info.nightscout.plugins.general.autotune import info.nightscout.androidaps.extensions.durationInMinutes import info.nightscout.androidaps.extensions.toJson import info.nightscout.androidaps.extensions.toTemporaryBasal -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.core.iob.round +import info.nightscout.core.profile.milliSecFromMidnight import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.Carbs import info.nightscout.database.entities.ExtendedBolus @@ -17,6 +17,7 @@ import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Constants import info.nightscout.interfaces.iob.Iob import info.nightscout.interfaces.iob.IobTotal +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.Round import info.nightscout.plugins.R import info.nightscout.plugins.general.autotune.data.ATProfile @@ -248,7 +249,7 @@ open class AutotuneIob @Inject constructor( getCalculationToTimeTreatments(time, localInsulin).round() // Add specific calculation for Autotune (reference localInsulin for Peak/dia) - fun Bolus.iobCalc(time: Long, localInsulin: LocalInsulin): Iob { + private fun Bolus.iobCalc(time: Long, localInsulin: LocalInsulin): Iob { if (!isValid || type == Bolus.Type.PRIMING ) return Iob() return localInsulin.iobCalcForTreatment(this, time) } diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt index ef577a1e64..aa2a88d82d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/AutotunePlugin.kt @@ -3,11 +3,10 @@ package info.nightscout.plugins.general.autotune import android.view.View import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit @@ -17,6 +16,7 @@ import info.nightscout.interfaces.insulin.Insulin import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.interfaces.utils.MidnightTime import info.nightscout.plugins.R diff --git a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt index bd24b36cf0..e31f73f07f 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/autotune/data/ATProfile.kt @@ -3,16 +3,18 @@ package info.nightscout.plugins.general.autotune.data import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.extensions.blockValueBySeconds +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.main.R import info.nightscout.core.profile.ProfileStoreObject +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.secondsFromMidnight import info.nightscout.database.entities.data.Block import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.Round 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 edb9100927..dff5adfdac 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 @@ -19,9 +19,7 @@ import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification @@ -31,6 +29,9 @@ import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.round +import info.nightscout.core.profile.toCurrentUnits +import info.nightscout.core.profile.toMgdl +import info.nightscout.core.profile.toUnitsString import info.nightscout.database.entities.OfflineEvent import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action @@ -49,7 +50,9 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.smsCommunicator.Sms import info.nightscout.interfaces.smsCommunicator.SmsCommunicator diff --git a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt index b8b441de59..df31c42eb1 100644 --- a/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -8,14 +8,15 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.extensions.toStringShort import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.iob.round +import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.R import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt index 059169e2e1..cf35817824 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinLyumjevPlugin.kt @@ -2,9 +2,9 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.Config import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt index 5300a7e885..144e744760 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefBasePlugin.kt @@ -3,7 +3,6 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.database.entities.Bolus import info.nightscout.database.entities.embedments.InsulinConfiguration import info.nightscout.interfaces.Config @@ -13,6 +12,7 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt index 903d6143ab..8712ed9b70 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPlugin.kt @@ -4,9 +4,9 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.extensions.putInt import info.nightscout.androidaps.extensions.storeInt import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.Config import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt index fdbd18f2db..d2d7cb4cba 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPlugin.kt @@ -2,9 +2,9 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.Config import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt index 740d21eae6..d2c9cf1dbf 100644 --- a/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPlugin.kt @@ -2,9 +2,9 @@ package info.nightscout.plugins.insulin import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.Config import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt index cd17c2fd8d..b4ad2ce3f8 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfileFragment.kt @@ -12,19 +12,20 @@ import com.google.android.material.tabs.TabLayout import dagger.android.support.DaggerFragment import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.ui.ActivityNames +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.plugins.databinding.ProfileFragmentBinding import info.nightscout.plugins.ui.TimeListEdit diff --git a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt index 1a2ad4d0a2..18fb8a515c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/profile/ProfilePlugin.kt @@ -9,17 +9,16 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.data.ProfileSealed import info.nightscout.androidaps.extensions.blockFromJsonArray +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.receivers.DataWorkerStorage import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.profile.ProfileStoreObject +import info.nightscout.core.profile.toMgdl import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit @@ -27,9 +26,11 @@ import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginBase import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileSource import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.interfaces.profile.PureProfile +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt index 3048694003..b69576ffed 100644 --- a/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/plugins/src/main/java/info/nightscout/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -11,19 +11,19 @@ import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpPluginBase -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.VirtualPump import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt index 3650f605e4..ef7ca96b17 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/DeviceStatusExtension.kt @@ -4,10 +4,10 @@ import android.os.Build 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.receivers.ReceiverStatusStore import info.nightscout.core.iob.json import info.nightscout.database.entities.DeviceStatus +import info.nightscout.interfaces.pump.Pump 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/EffectiveProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt index d4f0702c3b..a425516909 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/EffectiveProfileSwitchExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.GlucoseUnit diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt index 72803e5e17..d114bfa013 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ExtendedBolusExtension.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.extensions.toTemporaryBasal -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.database.entities.ExtendedBolus import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt index 03efb14c17..d6742dd030 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/ProfileSwitchExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.fromConstant +import info.nightscout.androidaps.extensions.getCustomizedName +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.utils.extensions.fromConstant -import info.nightscout.androidaps.utils.extensions.getCustomizedName -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.database.entities.ProfileSwitch import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.interfaces.utils.JsonHelper diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt index 25e6c352d3..e9e36b708c 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryBasalExtension.kt @@ -1,10 +1,10 @@ package info.nightscout.plugins.sync.nsclient.extensions import info.nightscout.androidaps.extensions.convertedToAbsolute -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.database.entities.TemporaryBasal import info.nightscout.database.entities.TemporaryBasal.Type.Companion.fromString import info.nightscout.database.entities.embedments.InterfaceIDs +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt index 6034f4d930..32c2139919 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclient/extensions/TemporaryTargetExtension.kt @@ -1,9 +1,11 @@ package info.nightscout.plugins.sync.nsclient.extensions -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toMgdl import info.nightscout.database.entities.TemporaryTarget import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.JsonHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.shared.utils.T diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt index 28c5db62d5..372819492d 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/EffectiveProfileSwitchExtension.kt @@ -1,7 +1,7 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.database.entities.EffectiveProfileSwitch import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.plugins.sync.nsclient.extensions.fromConstant diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt index 2be54849db..4e4f6d5279 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/nsclientV3/extensions/ProfileSwitchExtension.kt @@ -1,9 +1,9 @@ package info.nightscout.plugins.sync.nsclientV3.extensions import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.fromConstant +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.utils.extensions.fromConstant -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.database.entities.ProfileSwitch import info.nightscout.database.entities.embedments.InterfaceIDs import info.nightscout.sdk.localmodel.treatment.NSProfileSwitch diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt index b8788db10f..0f4fba4d62 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BasalElement.kt @@ -2,8 +2,8 @@ package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.extensions.convertedToAbsolute -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.database.entities.TemporaryBasal +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.utils.DateUtil import java.util.UUID diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt index 8ff50b4757..f5b71fe307 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/BloodGlucoseElement.kt @@ -1,8 +1,9 @@ package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.core.profile.toMgdl import info.nightscout.database.entities.TherapyEvent +import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.sync.nsclient.extensions.toMainUnit import info.nightscout.shared.utils.DateUtil import java.util.LinkedList diff --git a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt index 5bb9a5b151..1cbd5196d6 100644 --- a/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt +++ b/plugins/src/main/java/info/nightscout/plugins/sync/tidepool/elements/ProfileElement.kt @@ -2,8 +2,8 @@ package info.nightscout.plugins.sync.tidepool.elements import com.google.gson.annotations.Expose import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.database.entities.EffectiveProfileSwitch +import info.nightscout.interfaces.profile.Profile import info.nightscout.plugins.sync.tidepool.comm.TidepoolUploader import info.nightscout.shared.utils.DateUtil import java.util.UUID diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c02f09ecf8..7f76f71a53 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,10 +4,10 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.EffectiveProfileSwitch diff --git a/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 7829779b22..7262510558 100644 --- a/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/plugins/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt index 04ea3c601f..24733b6d1a 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinLyumjevPluginTest.kt @@ -3,9 +3,9 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.Config import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt index 712a324645..5de54b5ab1 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefBasePluginTest.kt @@ -3,11 +3,11 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.database.entities.Bolus import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt index b637b05f7b..e152836e10 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefFreePeakPluginTest.kt @@ -4,9 +4,9 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.Config import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt index 19821a2fc5..e2dae7c718 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefRapidActingPluginTest.kt @@ -3,9 +3,9 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.Config import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt index 7ca00cd442..adb34b1a60 100644 --- a/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/insulin/InsulinOrefUltraRapidActingPluginTest.kt @@ -3,9 +3,9 @@ package info.nightscout.plugins.insulin import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.HardLimits import info.nightscout.interfaces.Config import info.nightscout.interfaces.insulin.Insulin +import info.nightscout.interfaces.utils.HardLimits import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt index d2a3b94414..52e32bf728 100644 --- a/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt +++ b/plugins/src/test/java/info/nightscout/plugins/pump/virtual/VirtualPumpPluginUTest.kt @@ -5,9 +5,9 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Config +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.plugins.R import info.nightscout.rx.bus.RxBus diff --git a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 8fdc98efea..4ab39258e2 100644 --- a/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/pump/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -25,11 +25,8 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; -import info.nightscout.androidaps.interfaces.Pump; import info.nightscout.androidaps.interfaces.PumpPluginBase; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.pump.combo.events.EventComboPumpUpdateGUI; @@ -50,8 +47,11 @@ import info.nightscout.interfaces.constraints.Constraint; import info.nightscout.interfaces.notifications.Notification; import info.nightscout.interfaces.plugin.PluginDescription; import info.nightscout.interfaces.plugin.PluginType; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.Pump; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.defs.ManufacturerType; import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.interfaces.pump.defs.PumpType; diff --git a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt index 4aaafda1e6..1ed35f96cf 100644 --- a/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt +++ b/pump/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt @@ -7,11 +7,11 @@ import info.nightscout.androidaps.combo.R import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.RuffyScripter import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt index f407361604..0b742be32b 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt @@ -18,7 +18,6 @@ import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.alertDialogs.OKDialog @@ -26,6 +25,7 @@ import info.nightscout.androidaps.utils.userEntry.UserEntryMapper.Action import info.nightscout.androidaps.utils.userEntry.UserEntryMapper.Sources import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.pump.Dana +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt index 81965fc034..5a437bab4a 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/DanaPump.kt @@ -1,12 +1,12 @@ package info.nightscout.androidaps.dana import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt index c4d9a8dc29..934178aacf 100644 --- a/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt +++ b/pump/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt @@ -18,11 +18,12 @@ import info.nightscout.androidaps.dana.databinding.DanarHistoryItemBinding import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.core.profile.toUnitsString import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.rx.AapsSchedulers diff --git a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 01315c2b72..a21705c778 100644 --- a/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/dana/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,14 +3,14 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index 0de5d14033..96648a6732 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -15,13 +15,13 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.pump.PumpSync.TemporaryBasalType import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.utils.Round import info.nightscout.rx.AapsSchedulers diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java index ca98c27fb0..c0f4e68047 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRKorean/services/DanaRKoreanExecutionService.java @@ -41,14 +41,14 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.interfaces.Constants; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventInitializationChanged; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index dd79780492..628e54b924 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -20,14 +20,14 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.androidaps.interfaces.Profile; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage; import info.nightscout.core.fabric.FabricPrivacy; import info.nightscout.interfaces.constraints.Constraint; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.utils.Round; import info.nightscout.rx.AapsSchedulers; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java index d7311d4bd5..5c6a6736b3 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danaRv2/services/DanaRv2ExecutionService.java @@ -53,15 +53,15 @@ import info.nightscout.androidaps.dialogs.BolusProgressDialog; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; -import info.nightscout.androidaps.interfaces.Pump; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.interfaces.Constants; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.profile.Profile; +import info.nightscout.interfaces.pump.Pump; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.interfaces.ui.ActivityNames; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index 655e5573a4..85a25603e3 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -16,10 +16,7 @@ import info.nightscout.androidaps.extensions.PumpStateExtensionKt; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.androidaps.interfaces.Profile; -import info.nightscout.androidaps.interfaces.Pump; import info.nightscout.androidaps.interfaces.PumpPluginBase; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.utils.DecimalFormatter; @@ -27,8 +24,11 @@ import info.nightscout.interfaces.constraints.Constraint; import info.nightscout.interfaces.notifications.Notification; import info.nightscout.interfaces.plugin.PluginDescription; import info.nightscout.interfaces.plugin.PluginType; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.Dana; +import info.nightscout.interfaces.pump.Pump; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.defs.ManufacturerType; import info.nightscout.interfaces.pump.defs.PumpDescription; import info.nightscout.interfaces.utils.Round; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index dc03bb6aa0..537681ceff 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -19,12 +19,12 @@ import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.Constraints; -import info.nightscout.androidaps.interfaces.Profile; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.core.fabric.FabricPrivacy; import info.nightscout.interfaces.constraints.Constraint; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.utils.Round; import info.nightscout.rx.AapsSchedulers; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt index 0475485fe9..5b06a7e2d7 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/comm/MessageBase.kt @@ -9,17 +9,17 @@ import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.comm.MessageOriginalNames.getName import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.androidaps.utils.CRC.getCrc16 -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil import org.joda.time.DateTime import org.joda.time.IllegalInstantException import java.nio.charset.StandardCharsets diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java index e318218720..acd88f4884 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java @@ -42,13 +42,13 @@ import info.nightscout.androidaps.danar.comm.MsgPCCommStop; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; -import info.nightscout.androidaps.interfaces.Profile; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.utils.ToastUtils; import info.nightscout.core.fabric.FabricPrivacy; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventAppExit; diff --git a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java index f31c154d06..f5b84790e2 100644 --- a/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java +++ b/pump/danar/src/main/java/info/nightscout/androidaps/danar/services/DanaRExecutionService.java @@ -47,14 +47,14 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.dialogs.BolusProgressDialog; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.interfaces.Constants; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.queue.Callback; import info.nightscout.rx.bus.RxBus; diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c166eb31dc..2449a74ece 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,10 +4,10 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.interfaces.Config diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 687981b742..188b00af02 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt index 987c8c2c19..455e2589f3 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/DanaRPluginTest.kt @@ -8,10 +8,10 @@ import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.Constants import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt index 1965551c0c..4161765c37 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaR/comm/DanaRTestBase.kt @@ -12,15 +12,15 @@ import info.nightscout.androidaps.danar.DanaRPlugin import info.nightscout.androidaps.danar.comm.MessageBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.interfaces.ConfigBuilder import info.nightscout.androidaps.interfaces.Constraints 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.bolusInfo.DetailedBolusInfoStorage -import info.nightscout.shared.utils.DateUtil +import info.nightscout.interfaces.ConfigBuilder +import info.nightscout.interfaces.pump.PumpSync 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.Before import org.mockito.ArgumentMatchers import org.mockito.Mock diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt index 62af1423b6..bbfcd78acb 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRKorean/DanaRKoreanPluginTest.kt @@ -8,10 +8,10 @@ import info.nightscout.androidaps.danaRKorean.DanaRKoreanPlugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.interfaces.Constants import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before diff --git a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt index 9d2ea27f0a..b96a51caf8 100644 --- a/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt +++ b/pump/danar/src/test/java/info/nightscout/androidaps/plugins/pump/danaRv2/DanaRv2PluginTest.kt @@ -8,12 +8,12 @@ import info.nightscout.androidaps.danaRv2.DanaRv2Plugin import info.nightscout.androidaps.danar.R import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.interfaces.Constants import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.shared.sharedPreferences.SP import org.junit.Before import org.junit.Test diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index 4a11212c12..579497f341 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -18,11 +18,8 @@ import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpPluginBase -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage @@ -34,9 +31,12 @@ import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.Dana import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt index f844000096..6303fad958 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketAPSHistoryEvents.kt @@ -4,16 +4,16 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.T import org.joda.time.DateTime import org.joda.time.DateTimeZone import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt index 528c1cfb31..29d8427ad6 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketBolusSet24CIRCFArray.kt @@ -3,8 +3,9 @@ package info.nightscout.androidaps.danars.comm import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.encryption.BleEncryption +import info.nightscout.core.profile.fromMgdlToUnits import info.nightscout.interfaces.GlucoseUnit -import info.nightscout.androidaps.interfaces.Profile +import info.nightscout.interfaces.profile.Profile import info.nightscout.rx.logging.LTag import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt index 027955337d..4c47477fb2 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketHistory.kt @@ -5,11 +5,11 @@ import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.dana.comm.RecordTypes import info.nightscout.androidaps.dana.database.DanaHistoryRecord import info.nightscout.androidaps.dana.database.DanaHistoryRecordDao -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventDanaRSyncStatus import info.nightscout.rx.logging.LTag +import info.nightscout.shared.utils.T import org.joda.time.DateTime import java.util.Calendar import java.util.GregorianCalendar diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyAlarm.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyAlarm.kt index eee8ba10ae..5cbf132187 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyAlarm.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/comm/DanaRSPacketNotifyAlarm.kt @@ -4,12 +4,12 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dana.DanaPump import info.nightscout.androidaps.danars.R import info.nightscout.androidaps.danars.encryption.BleEncryption -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper import javax.inject.Inject class DanaRSPacketNotifyAlarm( diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt index 42ebdf60d6..1f0d5a758b 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/BLEComm.kt @@ -33,18 +33,18 @@ import info.nightscout.androidaps.danars.events.EventDanaRSPairingSuccess import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.waitMillis -import info.nightscout.androidaps.interfaces.PumpSync -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.interfaces.notifications.Notification -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpSync 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 java.util.UUID import java.util.concurrent.ScheduledFuture import javax.inject.Inject diff --git a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt index 3f7679c154..d27da919f8 100644 --- a/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt +++ b/pump/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt @@ -60,15 +60,15 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.queue.commands.Command import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constants import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index 2d798bb73f..38b8ac51a5 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -3,14 +3,14 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.utils.DefaultValueHelper -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.interfaces.Config +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.ProfileStore import info.nightscout.rx.bus.RxBus import info.nightscout.shared.interfaces.ResourceHelper diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt index f8ecf62623..ee4ba8dac1 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/DanaRSPluginTest.kt @@ -4,12 +4,12 @@ import android.content.Context import dagger.android.AndroidInjector import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.interfaces.Constants import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.pump.PumpSync import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketApsHistoryEventsTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketApsHistoryEventsTest.kt index 4c0b6c4dd0..52d2787c96 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketApsHistoryEventsTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketApsHistoryEventsTest.kt @@ -5,13 +5,14 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.DanaRSTestBase import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage +import info.nightscout.interfaces.pump.PumpSync import org.junit.Assert import org.junit.Test import org.mockito.Mock -import java.util.* +import java.util.Calendar +import java.util.GregorianCalendar class DanaRsPacketApsHistoryEventsTest : DanaRSTestBase() { diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt index 9def3f4307..b701360855 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketBolusSetStepBolusStartTest.kt @@ -7,10 +7,10 @@ import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.danars.DanaRSTestBase import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.pump.PumpSync import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketNotifyAlarmTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketNotifyAlarmTest.kt index fabe947464..34829cddaa 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketNotifyAlarmTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketNotifyAlarmTest.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.danars.comm import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.danars.DanaRSTestBase -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.PumpSync import org.junit.Assert import org.junit.Test import org.mockito.Mock diff --git a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketNotifyDeliveryRateDisplayTest.kt b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketNotifyDeliveryRateDisplayTest.kt index 176520b296..1b93481e28 100644 --- a/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketNotifyDeliveryRateDisplayTest.kt +++ b/pump/danars/src/test/java/info/nightscout/androidaps/danars/comm/DanaRsPacketNotifyDeliveryRateDisplayTest.kt @@ -7,11 +7,11 @@ import info.nightscout.androidaps.danars.DanaRSPlugin import info.nightscout.androidaps.danars.DanaRSTestBase import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.rx.events.EventOverviewBolusProgress import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt index 6f68542f21..1f6627d1c1 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt @@ -16,9 +16,9 @@ import info.nightscout.androidaps.diaconn.events.EventDiaconnG8NewStatus import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.utils.WarnColors import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index e81abac241..e92abc56aa 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -16,11 +16,8 @@ import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpPluginBase -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage @@ -32,9 +29,12 @@ import info.nightscout.interfaces.constraints.Constraint import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.Diaconn +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.pump.defs.ManufacturerType diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt index b4a5b8a923..bd82ee2759 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt @@ -1,13 +1,13 @@ package info.nightscout.androidaps.diaconn -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.rx.events.EventOverviewBolusProgress -import info.nightscout.shared.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.rx.events.EventOverviewBolusProgress import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import javax.inject.Inject import javax.inject.Singleton import kotlin.math.max diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt index b3ccc3a82a..58002742cd 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/BigLogInquireResponsePacket.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.diaconn.packet import android.content.Context import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.diaconn.DiaconnG8Pump import info.nightscout.androidaps.diaconn.R import info.nightscout.androidaps.diaconn.api.ApiResponse @@ -40,18 +39,19 @@ import info.nightscout.androidaps.diaconn.pumplog.LOG_TB_START_V3 import info.nightscout.androidaps.diaconn.pumplog.LOG_TB_STOP_V3 import info.nightscout.androidaps.diaconn.pumplog.PumplogUtil import info.nightscout.androidaps.events.EventPumpStatusChanged -import info.nightscout.shared.extensions.safeGetPackageInfo import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.interfaces.pump.defs.PumpDescription -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalStorage +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType -import info.nightscout.shared.utils.T import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.LTag +import info.nightscout.shared.extensions.safeGetPackageInfo +import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.utils.T import org.apache.commons.lang3.time.DateUtils import org.joda.time.DateTime import retrofit2.Call diff --git a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index a459bdeb53..41aed8c4f7 100644 --- a/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/pump/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -50,16 +50,16 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage import info.nightscout.androidaps.queue.commands.Command import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.Constants import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.ui.ActivityNames diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt index b512cc0884..81e5b51e58 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/EopatchPumpPlugin.kt @@ -5,10 +5,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpPluginBase -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager @@ -21,8 +18,11 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.pump.defs.ManufacturerType diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt index ae422e51c9..c1d60ca9f0 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/alarm/AlarmManager.kt @@ -4,7 +4,6 @@ import android.content.Context import android.content.Intent import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.pump.eopatch.EONotification import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus @@ -23,6 +22,7 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ui.AlarmHelperActivity import info.nightscout.androidaps.plugins.pump.eopatch.vo.Alarms import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java index c9b870d70a..66540edcd1 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManager.java @@ -8,14 +8,10 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; import info.nightscout.androidaps.interfaces.ProfileFunction; -import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.interfaces.ResourceHelper; -import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.plugins.pump.eopatch.R; import info.nightscout.androidaps.plugins.pump.eopatch.RxAction; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; @@ -45,13 +41,17 @@ import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchLifecycleEvent; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal; -import info.nightscout.shared.utils.DateUtil; +import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.PumpSync; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.bus.RxBus; import info.nightscout.rx.events.EventCustomActionsChanged; import info.nightscout.rx.events.EventRefreshOverview; import info.nightscout.rx.logging.AAPSLogger; +import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.shared.sharedPreferences.SP; +import info.nightscout.shared.utils.DateUtil; import io.reactivex.rxjava3.core.Maybe; import io.reactivex.rxjava3.core.Observable; import io.reactivex.rxjava3.core.Single; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java index 2a50545bbb..5b23fea22b 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/PatchManagerImpl.java @@ -33,9 +33,6 @@ import javax.crypto.KeyAgreement; import javax.inject.Inject; import javax.inject.Singleton; -import info.nightscout.interfaces.pump.DetailedBolusInfo; -import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.plugins.pump.eopatch.EoPatchRxBus; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.ble.task.ActivateTask; @@ -93,6 +90,9 @@ import info.nightscout.androidaps.plugins.pump.eopatch.vo.NormalBasal; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; import info.nightscout.androidaps.plugins.pump.eopatch.vo.TempBasal; +import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.PumpSync; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.rx.AapsSchedulers; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java index 8bf552accb..a1c3c8c3c7 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/InternalSuspendedTask.java @@ -8,13 +8,13 @@ import javax.inject.Inject; import javax.inject.Singleton; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.logging.UserEntryLogger; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.GetInternalSuspendTime; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchInternalSuspendTimeResponse; -import info.nightscout.interfaces.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.androidaps.utils.userEntry.UserEntryMapper; +import info.nightscout.interfaces.pump.PumpSync; +import info.nightscout.interfaces.queue.Callback; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Observable; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java index 90cde768ca..cd8893019e 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/PauseBasalTask.java @@ -10,7 +10,6 @@ import javax.inject.Inject; import javax.inject.Singleton; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.logging.UserEntryLogger; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.AlarmCode; import info.nightscout.androidaps.plugins.pump.eopatch.alarm.IAlarmRegistry; @@ -18,9 +17,10 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalPause; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.PatchBooleanResponse; import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState; -import info.nightscout.interfaces.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.androidaps.utils.userEntry.UserEntryMapper; +import info.nightscout.interfaces.pump.PumpSync; +import info.nightscout.interfaces.queue.Callback; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Observable; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java index 6ef8cab40f..083f7fc636 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ble/task/StopBasalTask.java @@ -8,14 +8,14 @@ import javax.inject.Inject; import javax.inject.Singleton; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.logging.UserEntryLogger; import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager; import info.nightscout.androidaps.plugins.pump.eopatch.core.api.BasalStop; import info.nightscout.androidaps.plugins.pump.eopatch.core.response.BasalStopResponse; -import info.nightscout.interfaces.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.androidaps.utils.userEntry.UserEntryMapper; +import info.nightscout.interfaces.pump.PumpSync; +import info.nightscout.interfaces.queue.Callback; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; import io.reactivex.rxjava3.core.Observable; diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt index 26e8d27b61..15b1308e95 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/ui/viewmodel/EopatchOverviewViewModel.kt @@ -4,9 +4,6 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.Transformations import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.shared.interfaces.ResourceHelper -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.eopatch.R import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPatchManager import info.nightscout.androidaps.plugins.pump.eopatch.ble.IPreferenceManager @@ -18,11 +15,14 @@ import info.nightscout.androidaps.plugins.pump.eopatch.ui.event.UIEvent import info.nightscout.androidaps.plugins.pump.eopatch.vo.Alarms import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchConfig import info.nightscout.androidaps.plugins.pump.eopatch.vo.PatchState -import info.nightscout.shared.utils.DateUtil -import info.nightscout.shared.utils.T +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.utils.DateUtil +import info.nightscout.shared.utils.T import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.disposables.Disposable import java.util.Calendar diff --git a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/NormalBasalManager.kt b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/NormalBasalManager.kt index fe85271de9..4cab76e286 100644 --- a/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/NormalBasalManager.kt +++ b/pump/eopatch/src/main/java/info/nightscout/androidaps/plugins/pump/eopatch/vo/NormalBasalManager.kt @@ -1,10 +1,10 @@ package info.nightscout.androidaps.plugins.pump.eopatch.vo -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.pump.eopatch.CommonUtils import info.nightscout.androidaps.plugins.pump.eopatch.GsonHelper -import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys import info.nightscout.androidaps.plugins.pump.eopatch.code.BasalStatus +import info.nightscout.androidaps.plugins.pump.eopatch.code.SettingKeys +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.sharedPreferences.SP import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.subjects.BehaviorSubject diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index f747d48f85..8e830eaa84 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -12,7 +12,6 @@ import dagger.android.support.DaggerFragment import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.events.EventRileyLinkDeviceStatusChange import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice @@ -29,6 +28,7 @@ import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.core.fabric.FabricPrivacy +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.queue.Callback import info.nightscout.pump.core.defs.PumpDeviceState import info.nightscout.rx.AapsSchedulers diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index ccafc41165..2788116016 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -10,10 +10,6 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus @@ -56,8 +52,12 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.pump.PumpSync.TemporaryBasalType import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.pump.defs.ManufacturerType diff --git a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index eb034fb824..d00bd435a7 100644 --- a/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/pump/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -3,11 +3,8 @@ package info.nightscout.androidaps.plugins.pump.medtronic.data import com.google.gson.Gson import com.google.gson.GsonBuilder import dagger.android.HasAndroidInjector -import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntry import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryBolus import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryTBR @@ -31,6 +28,9 @@ import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpSta import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicConst import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil import info.nightscout.interfaces.notifications.Notification +import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.pump.core.utils.StringUtil import info.nightscout.rx.bus.RxBus import info.nightscout.rx.logging.AAPSLogger diff --git a/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt b/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt index 914b874bd9..3392cc7a7e 100644 --- a/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt +++ b/pump/medtronic/src/test/java/info/nightscout/androidaps/TestBase.kt @@ -3,13 +3,13 @@ package info.nightscout.androidaps import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntryType import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.pump.core.utils.ByteUtil import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.TestAapsSchedulers diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 72074e1868..e6096d5ea9 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -11,11 +11,8 @@ import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpPluginBase -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil @@ -54,8 +51,11 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.plugin.PluginDescription import info.nightscout.interfaces.plugin.PluginType +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.actions.CustomAction import info.nightscout.interfaces.pump.actions.CustomActionType import info.nightscout.interfaces.pump.defs.ManufacturerType diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt index 3e2f28ed39..7ccd408b1b 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/data/Record.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.androidaps.interfaces.Profile sealed class Record diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/Converters.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/Converters.kt index 5f90d9b7c8..7c984afab4 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/Converters.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/Converters.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database import androidx.room.TypeConverter import com.google.gson.GsonBuilder -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.BolusType import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.InitialResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.ResolvedResult +import info.nightscout.interfaces.profile.Profile class Converters { diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index d3223f513e..420f7abc04 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -4,7 +4,6 @@ import androidx.annotation.StringRes import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.action.InsertCannulaViewModel @@ -22,6 +21,7 @@ import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.notifications.Notification import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt index 59c5f28119..f601c63c51 100644 --- a/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt +++ b/pump/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/Functions.kt @@ -1,9 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.util -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram -import java.util.* +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.pump.defs.PumpType import kotlin.math.roundToInt fun mapProfileToBasalProgram(profile: Profile): BasalProgram { diff --git a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/FunctionsTest.kt b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/FunctionsTest.kt index 03dfebdbe0..1cd65f2d52 100644 --- a/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/FunctionsTest.kt +++ b/pump/omnipod-dash/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/util/FunctionsTest.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.util -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Profile.ProfileValue import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.profile.Profile.ProfileValue import org.junit.Assert import org.junit.Assert.assertEquals import org.junit.Test diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index c74d233ee9..10a1741c82 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -38,11 +38,8 @@ import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.CommandQueue; -import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.ProfileFunction; -import info.nightscout.androidaps.interfaces.Pump; import info.nightscout.androidaps.interfaces.PumpPluginBase; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; @@ -92,8 +89,11 @@ import info.nightscout.core.pumpExtensions.DetailedBolusInfoExtensionKt; import info.nightscout.interfaces.notifications.Notification; import info.nightscout.interfaces.plugin.PluginDescription; import info.nightscout.interfaces.plugin.PluginType; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.DetailedBolusInfo; +import info.nightscout.interfaces.pump.Pump; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.actions.CustomActionType; import info.nightscout.interfaces.pump.defs.ManufacturerType; import info.nightscout.interfaces.pump.defs.PumpDescription; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index a5adbaa938..bfd2576754 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -16,8 +16,6 @@ import javax.inject.Singleton; import dagger.android.HasAndroidInjector; import info.nightscout.androidaps.data.PumpEnactResultImpl; import info.nightscout.androidaps.extensions.PumpStateExtensionKt; -import info.nightscout.androidaps.interfaces.Profile; -import info.nightscout.androidaps.interfaces.PumpSync; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; @@ -69,8 +67,10 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil; import info.nightscout.core.pumpExtensions.DetailedBolusInfoExtensionKt; import info.nightscout.interfaces.notifications.Notification; +import info.nightscout.interfaces.profile.Profile; import info.nightscout.interfaces.pump.DetailedBolusInfo; import info.nightscout.interfaces.pump.PumpEnactResult; +import info.nightscout.interfaces.pump.PumpSync; import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.interfaces.ui.ActivityNames; import info.nightscout.pump.core.utils.ByteUtil; diff --git a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java index 1d6f816f83..9c6a6170cc 100644 --- a/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java +++ b/pump/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodHistoryActivity.java @@ -23,10 +23,7 @@ import java.util.List; import javax.inject.Inject; import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; -import info.nightscout.androidaps.interfaces.Profile; -import info.nightscout.shared.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup; -import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil; import info.nightscout.androidaps.plugins.pump.omnipod.eros.R; @@ -34,8 +31,11 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.PodHistor import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.ErosHistory; import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryRecordEntity; import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil; +import info.nightscout.interfaces.profile.Profile; +import info.nightscout.interfaces.pump.defs.PumpType; import info.nightscout.rx.logging.AAPSLogger; import info.nightscout.rx.logging.LTag; +import info.nightscout.shared.interfaces.ResourceHelper; public class ErosPodHistoryActivity extends NoSplashAppCompatActivity { diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt index f45c47b3f3..9361ab1fcd 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPluginTest.kt @@ -6,11 +6,11 @@ import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.data.PumpEnactResultImpl import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.defs.TempBasalPair import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpType import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.TestAapsSchedulers diff --git a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.java b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.java index 487c24861c..0083504166 100644 --- a/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.java +++ b/pump/omnipod-eros/src/test/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/communication/AapsOmnipodErosManagerTest.java @@ -10,10 +10,10 @@ import org.junit.Test; import java.util.List; -import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule; import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalScheduleEntry; import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager; +import info.nightscout.interfaces.profile.Profile; public class AapsOmnipodErosManagerTest { diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index bbe9267e45..25a7421f11 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -13,11 +13,7 @@ import info.nightscout.androidaps.extensions.toStringFull import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump import info.nightscout.androidaps.interfaces.PumpPluginBase -import info.nightscout.androidaps.interfaces.PumpSync -import info.nightscout.androidaps.interfaces.PumpSync.TemporaryBasalType import info.nightscout.androidaps.plugins.pump.common.data.PumpStatus import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState import info.nightscout.androidaps.plugins.pump.common.sync.PumpDbEntryCarbs @@ -26,8 +22,12 @@ import info.nightscout.androidaps.utils.DecimalFormatter.to0Decimal import info.nightscout.androidaps.utils.DecimalFormatter.to2Decimal import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.interfaces.plugin.PluginDescription +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync +import info.nightscout.interfaces.pump.PumpSync.TemporaryBasalType import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/di/PumpCommonModule.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/di/PumpCommonModule.kt index e18c7070f6..aec51092f8 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/di/PumpCommonModule.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/di/PumpCommonModule.kt @@ -2,8 +2,8 @@ package info.nightscout.androidaps.plugins.pump.common.di import dagger.Module import dagger.Provides -import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.plugins.pump.common.sync.PumpSyncStorage +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.logging.AAPSLogger import info.nightscout.shared.sharedPreferences.SP import javax.inject.Singleton diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt index 5212bd1567..fd720626b5 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpDbEntry.kt @@ -1,7 +1,7 @@ package info.nightscout.androidaps.plugins.pump.common.sync import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.PumpType // data class PumpDbEntry constructor(var temporaryId: Long, diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt index c6adc55e4d..cac90a3158 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/sync/PumpSyncStorage.kt @@ -3,7 +3,7 @@ package info.nightscout.androidaps.plugins.pump.common.sync import com.thoughtworks.xstream.XStream import com.thoughtworks.xstream.security.AnyTypePermission import info.nightscout.interfaces.pump.DetailedBolusInfo -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt index 5dbb5bef04..b4a1a14a7e 100644 --- a/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt +++ b/pump/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/utils/ProfileUtil.kt @@ -1,9 +1,9 @@ package info.nightscout.androidaps.plugins.pump.common.utils -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Profile.ProfileValue +import info.nightscout.interfaces.profile.Profile +import info.nightscout.interfaces.profile.Profile.ProfileValue import info.nightscout.interfaces.pump.defs.PumpType -import java.util.* +import java.util.Locale object ProfileUtil { diff --git a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt index 878f8187f3..9ec3f45056 100644 --- a/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/ui/src/main/java/info/nightscout/ui/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -17,21 +17,21 @@ import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import dagger.android.support.DaggerFragment import info.nightscout.androidaps.data.ProfileSealed -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InvalidateProfileSwitchTransaction import info.nightscout.androidaps.dialogs.ProfileViewerDialog import info.nightscout.androidaps.events.EventEffectiveProfileSwitchChanged import info.nightscout.androidaps.events.EventNewHistoryData +import info.nightscout.androidaps.extensions.getCustomizedName import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.utils.ActionModeHelper import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import info.nightscout.androidaps.utils.extensions.getCustomizedName import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InvalidateProfileSwitchTransaction import info.nightscout.interfaces.BuildHelper import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt index 1fd363c373..30015a6999 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfile.kt @@ -1,8 +1,10 @@ package info.nightscout.ui.defaultProfile -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.fromMmolToUnits import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.PureProfile import info.nightscout.interfaces.utils.Round import info.nightscout.shared.utils.DateUtil @@ -157,13 +159,13 @@ class DefaultProfile @Inject constructor(val dateUtil: DateUtil) { private fun singleValueArrayFromMmolToUnits(value: Double, sample: Array, units: GlucoseUnit): JSONArray { val array = JSONArray() - array.put(JSONObject().put("time", "00:00").put("value", Profile.fromMmolToUnits(value + sample[0],units)).put("timeAsSeconds", 0 * 3600)) - array.put(JSONObject().put("time", "06:00").put("value", Profile.fromMmolToUnits(value + sample[1],units)).put("timeAsSeconds", 6 * 3600)) - array.put(JSONObject().put("time", "09:00").put("value", Profile.fromMmolToUnits(value + sample[2],units)).put("timeAsSeconds", 9 * 3600)) - array.put(JSONObject().put("time", "11:00").put("value", Profile.fromMmolToUnits(value + sample[3],units)).put("timeAsSeconds", 11 * 3600)) - array.put(JSONObject().put("time", "14:00").put("value", Profile.fromMmolToUnits(value + sample[4],units)).put("timeAsSeconds", 14 * 3600)) - array.put(JSONObject().put("time", "16:00").put("value", Profile.fromMmolToUnits(value + sample[5],units)).put("timeAsSeconds", 16 * 3600)) - array.put(JSONObject().put("time", "19:00").put("value", Profile.fromMmolToUnits(value + sample[6],units)).put("timeAsSeconds", 19 * 3600)) + array.put(JSONObject().put("time", "00:00").put("value", Profile.fromMmolToUnits(value + sample[0], units)).put("timeAsSeconds", 0 * 3600)) + array.put(JSONObject().put("time", "06:00").put("value", Profile.fromMmolToUnits(value + sample[1], units)).put("timeAsSeconds", 6 * 3600)) + array.put(JSONObject().put("time", "09:00").put("value", Profile.fromMmolToUnits(value + sample[2], units)).put("timeAsSeconds", 9 * 3600)) + array.put(JSONObject().put("time", "11:00").put("value", Profile.fromMmolToUnits(value + sample[3], units)).put("timeAsSeconds", 11 * 3600)) + array.put(JSONObject().put("time", "14:00").put("value", Profile.fromMmolToUnits(value + sample[4], units)).put("timeAsSeconds", 14 * 3600)) + array.put(JSONObject().put("time", "16:00").put("value", Profile.fromMmolToUnits(value + sample[5], units)).put("timeAsSeconds", 16 * 3600)) + array.put(JSONObject().put("time", "19:00").put("value", Profile.fromMmolToUnits(value + sample[6], units)).put("timeAsSeconds", 19 * 3600)) return array } } \ No newline at end of file diff --git a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt index 9d0f0ea1fb..df77b8c459 100644 --- a/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt +++ b/ui/src/main/java/info/nightscout/ui/defaultProfile/DefaultProfileDPV.kt @@ -1,9 +1,11 @@ package info.nightscout.ui.defaultProfile import dagger.android.HasAndroidInjector -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson +import info.nightscout.androidaps.extensions.pureProfileFromJson +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.fromMmolToUnits import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.profile.PureProfile import info.nightscout.shared.utils.DateUtil import org.json.JSONArray diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt index dc9e12f41f..527641deb5 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CalibrationDialog.kt @@ -7,16 +7,18 @@ import android.view.ViewGroup import com.google.common.base.Joiner import dagger.android.HasAndroidInjector import info.nightscout.androidaps.dialogs.DialogFragmentWithDate -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.XDripBroadcast import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toCurrentUnitsString import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources import info.nightscout.database.entities.ValueWithUnit import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt index 891af79f93..dab7c3eaf6 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CarbsDialog.kt @@ -13,7 +13,6 @@ import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider @@ -23,6 +22,7 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck.Protection.BOLUS +import info.nightscout.core.profile.toMgdl import info.nightscout.database.entities.TemporaryTarget import info.nightscout.database.entities.UserEntry.Action import info.nightscout.database.entities.UserEntry.Sources @@ -33,6 +33,7 @@ import info.nightscout.interfaces.BolusTimer import info.nightscout.interfaces.CarbTimer import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.constraints.Constraint +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo import info.nightscout.interfaces.queue.Callback import info.nightscout.interfaces.ui.ActivityNames diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt index a64eccf599..5454e2cae3 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/CareDialog.kt @@ -10,21 +10,23 @@ import android.view.ViewGroup import androidx.annotation.StringRes import com.google.common.base.Joiner import dagger.android.HasAndroidInjector -import info.nightscout.database.impl.AppRepository -import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.androidaps.dialogs.DialogFragmentWithDate import info.nightscout.androidaps.extensions.fromConstant -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog +import info.nightscout.core.profile.fromMgdlToUnits +import info.nightscout.core.profile.toCurrentUnitsString import info.nightscout.database.entities.TherapyEvent import info.nightscout.database.entities.UserEntry import info.nightscout.database.entities.ValueWithUnit +import info.nightscout.database.impl.AppRepository +import info.nightscout.database.impl.transactions.InsertIfNewByTimestampTherapyEventTransaction import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.utils.HtmlHelper import info.nightscout.rx.logging.LTag import info.nightscout.shared.interfaces.ResourceHelper diff --git a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt index 93734121ab..24a9471216 100644 --- a/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt +++ b/ui/src/main/java/info/nightscout/ui/dialogs/WizardInfoDialog.kt @@ -9,10 +9,12 @@ import android.view.WindowManager import dagger.android.support.DaggerDialogFragment import info.nightscout.androidaps.extensions.bolusCalculatorResultFromJson import info.nightscout.androidaps.extensions.toJson -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.core.profile.toUnits +import info.nightscout.core.profile.toUnitsString import info.nightscout.database.entities.BolusCalculatorResult import info.nightscout.interfaces.Constants +import info.nightscout.interfaces.profile.Profile import info.nightscout.shared.interfaces.ResourceHelper import info.nightscout.shared.utils.DateUtil import info.nightscout.ui.R diff --git a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt index 32ecd1c3c1..aff7ef8b8a 100644 --- a/ui/src/main/java/info/nightscout/ui/widget/Widget.kt +++ b/ui/src/main/java/info/nightscout/ui/widget/Widget.kt @@ -20,16 +20,19 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Constraints import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.Loop -import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.interfaces.TrendCalculator import info.nightscout.androidaps.plugins.general.overview.OverviewData import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider +import info.nightscout.core.profile.toSignedUnitsString +import info.nightscout.core.profile.toTargetRangeString +import info.nightscout.core.profile.toUnits import info.nightscout.database.entities.interfaces.end import info.nightscout.interfaces.Config import info.nightscout.interfaces.Constants import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.aps.VariableSensitivityResult +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.ui.ActivityNames import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag diff --git a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index c02f09ecf8..7f76f71a53 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -4,10 +4,10 @@ import android.content.Context import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.ProfileSealed +import info.nightscout.androidaps.extensions.pureProfileFromJson import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.IobCobCalculator import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.extensions.pureProfileFromJson import info.nightscout.core.fabric.FabricPrivacy import info.nightscout.core.profile.ProfileStoreObject import info.nightscout.database.entities.EffectiveProfileSwitch diff --git a/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt b/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt index 7829779b22..7262510558 100644 --- a/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt +++ b/ui/src/test/java/info/nightscout/androidaps/TestPumpPlugin.kt @@ -2,11 +2,11 @@ package info.nightscout.androidaps import dagger.android.HasAndroidInjector import info.nightscout.androidaps.data.PumpEnactResultImpl -import info.nightscout.androidaps.interfaces.Profile -import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.androidaps.interfaces.PumpSync +import info.nightscout.interfaces.profile.Profile import info.nightscout.interfaces.pump.DetailedBolusInfo +import info.nightscout.interfaces.pump.Pump import info.nightscout.interfaces.pump.PumpEnactResult +import info.nightscout.interfaces.pump.PumpSync import info.nightscout.interfaces.pump.defs.ManufacturerType import info.nightscout.interfaces.pump.defs.PumpDescription import info.nightscout.interfaces.pump.defs.PumpType From 4aa128896af0c04746d31707977a15a37ba08ce6 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Nov 2022 20:37:02 +0100 Subject: [PATCH 42/42] fix tests --- .../nightscout/androidaps/HardLimitsMock.kt | 84 +++++++++++++++++++ .../interfaces/ConstraintsCheckerTest.kt | 4 +- .../constraints/safety/SafetyPluginTest.kt | 4 +- .../nightscout/androidaps/HardLimitsMock.kt | 84 +++++++++++++++++++ .../androidaps/TestBaseWithProfile.kt | 7 +- .../nightscout/androidaps/data/ProfileTest.kt | 6 +- 6 files changed, 181 insertions(+), 8 deletions(-) create mode 100644 app/src/test/java/info/nightscout/androidaps/HardLimitsMock.kt create mode 100644 core/core-main/src/test/java/info/nightscout/androidaps/HardLimitsMock.kt diff --git a/app/src/test/java/info/nightscout/androidaps/HardLimitsMock.kt b/app/src/test/java/info/nightscout/androidaps/HardLimitsMock.kt new file mode 100644 index 0000000000..db6fc5800a --- /dev/null +++ b/app/src/test/java/info/nightscout/androidaps/HardLimitsMock.kt @@ -0,0 +1,84 @@ +package info.nightscout.androidaps + +import info.nightscout.core.main.R +import info.nightscout.interfaces.utils.HardLimits +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.sharedPreferences.SP +import javax.inject.Inject +import kotlin.math.max +import kotlin.math.min + +class HardLimitsMock @Inject constructor( + private val sp: SP, + private val rh: ResourceHelper +) : HardLimits { + + companion object { + + private const val CHILD = 0 + private const val TEENAGE = 1 + private const val ADULT = 2 + private const val RESISTANT_ADULT = 3 + private const val PREGNANT = 4 + private val MAX_BOLUS = doubleArrayOf(5.0, 10.0, 17.0, 25.0, 60.0) + + // Very Hard Limits Ranges + // First value is the Lowest and second value is the Highest a Limit can define + val VERY_HARD_LIMIT_MIN_BG = doubleArrayOf(80.0, 180.0) + val VERY_HARD_LIMIT_MAX_BG = doubleArrayOf(90.0, 200.0) + val VERY_HARD_LIMIT_TARGET_BG = doubleArrayOf(80.0, 200.0) + + // Very Hard Limits Ranges for Temp Targets + val VERY_HARD_LIMIT_TEMP_MIN_BG = intArrayOf(72, 180) + val VERY_HARD_LIMIT_TEMP_MAX_BG = intArrayOf(72, 270) + val VERY_HARD_LIMIT_TEMP_TARGET_BG = intArrayOf(72, 200) + val MIN_DIA = doubleArrayOf(5.0, 5.0, 5.0, 5.0, 5.0) + val MAX_DIA = doubleArrayOf(9.0, 9.0, 9.0, 9.0, 10.0) + val MIN_IC = doubleArrayOf(2.0, 2.0, 2.0, 2.0, 0.3) + val MAX_IC = doubleArrayOf(100.0, 100.0, 100.0, 100.0, 100.0) + const val MIN_ISF = 2.0 // mgdl + const val MAX_ISF = 1000.0 // mgdl + val MAX_IOB_AMA = doubleArrayOf(3.0, 5.0, 7.0, 12.0, 25.0) + val MAX_IOB_SMB = doubleArrayOf(7.0, 13.0, 22.0, 30.0, 70.0) + val MAX_BASAL = doubleArrayOf(2.0, 5.0, 10.0, 12.0, 25.0) + + //LGS Hard limits + //No IOB at all + const val MAX_IOB_LGS = 0.0 + + } + + private fun loadAge(): Int = when (sp.getString(R.string.key_age, "")) { + rh.gs(R.string.key_child) -> CHILD + rh.gs(R.string.key_teenage) -> TEENAGE + rh.gs(R.string.key_adult) -> ADULT + rh.gs(R.string.key_resistantadult) -> RESISTANT_ADULT + rh.gs(R.string.key_pregnant) -> PREGNANT + else -> ADULT + } + + override fun maxBolus(): Double = MAX_BOLUS[loadAge()] + override fun maxIobAMA(): Double = MAX_IOB_AMA[loadAge()] + override fun maxIobSMB(): Double = MAX_IOB_SMB[loadAge()] + override fun maxBasal(): Double = MAX_BASAL[loadAge()] + override fun minDia(): Double = MIN_DIA[loadAge()] + override fun maxDia(): Double = MAX_DIA[loadAge()] + override fun minIC(): Double = MIN_IC[loadAge()] + override fun maxIC(): Double = MAX_IC[loadAge()] + + // safety checks + override fun checkHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Boolean = + value == verifyHardLimits(value, valueName, lowLimit, highLimit) + + override fun isInRange(value: Double, lowLimit: Double, highLimit: Double): Boolean = + value in lowLimit..highLimit + + override fun verifyHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Double { + var newValue = value + if (newValue < lowLimit || newValue > highLimit) { + newValue = max(newValue, lowLimit) + newValue = min(newValue, highLimit) + } + return newValue + } +} \ No newline at end of file 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 0c80960576..6899bf5912 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.interfaces import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector +import info.nightscout.androidaps.HardLimitsMock import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.dana.DanaPump @@ -64,8 +65,8 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { @Mock lateinit var insightDatabaseDao: InsightDatabaseDao @Mock lateinit var ruffyScripter: RuffyScripter @Mock lateinit var buildHelper: BuildHelper - @Mock lateinit var hardLimits: HardLimits + private lateinit var hardLimits: HardLimits private lateinit var danaPump: DanaPump private lateinit var insightDbHelper: InsightDbHelper private lateinit var constraintChecker: ConstraintsImpl @@ -130,6 +131,7 @@ class ConstraintsCheckerTest : TestBaseWithProfile() { val glucoseStatusProvider = GlucoseStatusProvider(aapsLogger = aapsLogger, iobCobCalculator = iobCobCalculator, dateUtil = dateUtil) + hardLimits = HardLimitsMock(sp, rh) insightDbHelper = InsightDbHelper(insightDatabaseDao) danaPump = DanaPump(aapsLogger, sp, dateUtil, injector) objectivesPlugin = ObjectivesPlugin(injector, aapsLogger, rh, activePlugin, sp, config) 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 d8b4cc425e..c06d39f562 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,6 +2,7 @@ package info.nightscout.androidaps.plugins.constraints.safety import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector +import info.nightscout.androidaps.HardLimitsMock import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.interfaces.ActivePlugin @@ -38,8 +39,8 @@ class SafetyPluginTest : TestBaseWithProfile() { @Mock lateinit var virtualPumpPlugin: VirtualPumpPlugin @Mock lateinit var glimpPlugin: GlimpPlugin @Mock lateinit var repository: AppRepository - @Mock lateinit var hardLimits: HardLimits + private lateinit var hardLimits: HardLimits private lateinit var safetyPlugin: SafetyPlugin val injector = HasAndroidInjector { AndroidInjector { } } @@ -70,6 +71,7 @@ class SafetyPluginTest : TestBaseWithProfile() { `when`(activePlugin.activePump).thenReturn(virtualPumpPlugin) `when`(virtualPumpPlugin.pumpDescription).thenReturn(pumpDescription) `when`(config.APS).thenReturn(true) + hardLimits = HardLimitsMock(sp, rh) safetyPlugin = SafetyPlugin( injector, aapsLogger, rh, sp, rxBus, constraintChecker, openAPSAMAPlugin, openAPSSMBPlugin, openAPSSMBDynamicISFPlugin, sensitivityOref1Plugin, activePlugin, hardLimits, buildHelper, diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/HardLimitsMock.kt b/core/core-main/src/test/java/info/nightscout/androidaps/HardLimitsMock.kt new file mode 100644 index 0000000000..db6fc5800a --- /dev/null +++ b/core/core-main/src/test/java/info/nightscout/androidaps/HardLimitsMock.kt @@ -0,0 +1,84 @@ +package info.nightscout.androidaps + +import info.nightscout.core.main.R +import info.nightscout.interfaces.utils.HardLimits +import info.nightscout.shared.interfaces.ResourceHelper +import info.nightscout.shared.sharedPreferences.SP +import javax.inject.Inject +import kotlin.math.max +import kotlin.math.min + +class HardLimitsMock @Inject constructor( + private val sp: SP, + private val rh: ResourceHelper +) : HardLimits { + + companion object { + + private const val CHILD = 0 + private const val TEENAGE = 1 + private const val ADULT = 2 + private const val RESISTANT_ADULT = 3 + private const val PREGNANT = 4 + private val MAX_BOLUS = doubleArrayOf(5.0, 10.0, 17.0, 25.0, 60.0) + + // Very Hard Limits Ranges + // First value is the Lowest and second value is the Highest a Limit can define + val VERY_HARD_LIMIT_MIN_BG = doubleArrayOf(80.0, 180.0) + val VERY_HARD_LIMIT_MAX_BG = doubleArrayOf(90.0, 200.0) + val VERY_HARD_LIMIT_TARGET_BG = doubleArrayOf(80.0, 200.0) + + // Very Hard Limits Ranges for Temp Targets + val VERY_HARD_LIMIT_TEMP_MIN_BG = intArrayOf(72, 180) + val VERY_HARD_LIMIT_TEMP_MAX_BG = intArrayOf(72, 270) + val VERY_HARD_LIMIT_TEMP_TARGET_BG = intArrayOf(72, 200) + val MIN_DIA = doubleArrayOf(5.0, 5.0, 5.0, 5.0, 5.0) + val MAX_DIA = doubleArrayOf(9.0, 9.0, 9.0, 9.0, 10.0) + val MIN_IC = doubleArrayOf(2.0, 2.0, 2.0, 2.0, 0.3) + val MAX_IC = doubleArrayOf(100.0, 100.0, 100.0, 100.0, 100.0) + const val MIN_ISF = 2.0 // mgdl + const val MAX_ISF = 1000.0 // mgdl + val MAX_IOB_AMA = doubleArrayOf(3.0, 5.0, 7.0, 12.0, 25.0) + val MAX_IOB_SMB = doubleArrayOf(7.0, 13.0, 22.0, 30.0, 70.0) + val MAX_BASAL = doubleArrayOf(2.0, 5.0, 10.0, 12.0, 25.0) + + //LGS Hard limits + //No IOB at all + const val MAX_IOB_LGS = 0.0 + + } + + private fun loadAge(): Int = when (sp.getString(R.string.key_age, "")) { + rh.gs(R.string.key_child) -> CHILD + rh.gs(R.string.key_teenage) -> TEENAGE + rh.gs(R.string.key_adult) -> ADULT + rh.gs(R.string.key_resistantadult) -> RESISTANT_ADULT + rh.gs(R.string.key_pregnant) -> PREGNANT + else -> ADULT + } + + override fun maxBolus(): Double = MAX_BOLUS[loadAge()] + override fun maxIobAMA(): Double = MAX_IOB_AMA[loadAge()] + override fun maxIobSMB(): Double = MAX_IOB_SMB[loadAge()] + override fun maxBasal(): Double = MAX_BASAL[loadAge()] + override fun minDia(): Double = MIN_DIA[loadAge()] + override fun maxDia(): Double = MAX_DIA[loadAge()] + override fun minIC(): Double = MIN_IC[loadAge()] + override fun maxIC(): Double = MAX_IC[loadAge()] + + // safety checks + override fun checkHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Boolean = + value == verifyHardLimits(value, valueName, lowLimit, highLimit) + + override fun isInRange(value: Double, lowLimit: Double, highLimit: Double): Boolean = + value in lowLimit..highLimit + + override fun verifyHardLimits(value: Double, valueName: Int, lowLimit: Double, highLimit: Double): Double { + var newValue = value + if (newValue < lowLimit || newValue > highLimit) { + newValue = max(newValue, lowLimit) + newValue = min(newValue, highLimit) + } + return newValue + } +} \ No newline at end of file diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt index ce9a00c156..7fba26ef5a 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/TestBaseWithProfile.kt @@ -21,7 +21,7 @@ import info.nightscout.shared.utils.DateUtil import org.json.JSONObject import org.junit.Before import org.mockito.Mock -import org.mockito.Mockito +import org.mockito.Mockito.`when` @Suppress("SpellCheckingInspection") open class TestBaseWithProfile : TestBase() { @@ -35,8 +35,8 @@ open class TestBaseWithProfile : TestBase() { @Mock lateinit var sp: SP @Mock lateinit var context: Context @Mock lateinit var repository: AppRepository - @Mock lateinit var hardLimits: HardLimits + private lateinit var hardLimits: HardLimits lateinit var testPumpPlugin: TestPumpPlugin val rxBus = RxBus(aapsSchedulers, aapsLogger) @@ -70,7 +70,8 @@ open class TestBaseWithProfile : TestBase() { "\"target_high\":[{\"time\":\"00:00\",\"value\":\"7\"}],\"startDate\":\"1970-01-01T00:00:00.000Z\",\"units\":\"mmol\"}" validProfile = ProfileSealed.Pure(pureProfileFromJson(JSONObject(validProfileJSON), dateUtil)!!) testPumpPlugin = TestPumpPlugin(profileInjector) - Mockito.`when`(activePluginProvider.activePump).thenReturn(testPumpPlugin) + `when`(activePluginProvider.activePump).thenReturn(testPumpPlugin) + hardLimits = HardLimitsMock(sp, rh) } fun getValidProfileStore(): ProfileStore { diff --git a/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt b/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt index ef5d3a8899..36dceb7c76 100644 --- a/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt +++ b/core/core-main/src/test/java/info/nightscout/androidaps/data/ProfileTest.kt @@ -2,6 +2,7 @@ package info.nightscout.androidaps.data import android.content.Context import dagger.android.AndroidInjector +import info.nightscout.androidaps.HardLimitsMock import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestPumpPlugin import info.nightscout.androidaps.extensions.pureProfileFromJson @@ -13,7 +14,6 @@ import info.nightscout.core.profile.toMmol import info.nightscout.core.profile.toTargetRangeString import info.nightscout.core.profile.toUnits import info.nightscout.core.profile.toUnitsString -import info.nightscout.database.impl.AppRepository import info.nightscout.interfaces.Config import info.nightscout.interfaces.GlucoseUnit import info.nightscout.interfaces.profile.Profile @@ -43,9 +43,8 @@ class ProfileTest : TestBase() { @Mock lateinit var context: Context @Mock lateinit var config: Config @Mock lateinit var sp: SP - @Mock lateinit var repository: AppRepository - @Mock lateinit var hardLimits: HardLimits + private lateinit var hardLimits: HardLimits private lateinit var rxBus: RxBus private lateinit var dateUtil: DateUtil private lateinit var testPumpPlugin: TestPumpPlugin @@ -70,6 +69,7 @@ class ProfileTest : TestBase() { testPumpPlugin = TestPumpPlugin { AndroidInjector { } } dateUtil = DateUtil(context) rxBus = RxBus(TestAapsSchedulers(), aapsLogger) + hardLimits = HardLimitsMock(sp, rh) `when`(activePluginProvider.activePump).thenReturn(testPumpPlugin) `when`(rh.gs(R.string.profile_per_unit)).thenReturn("/U") `when`(rh.gs(R.string.profile_carbs_per_unit)).thenReturn("g/U")