From 3b5b945fea6573b32941b828c74e39a13d4d63ba Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 1 Mar 2021 12:42:42 +0100 Subject: [PATCH] TemporaryTarget -> room database --- .idea/codeStyles/Project.xml | 16 -- .../androidaps/db/DatabaseHelper.java | 228 +----------------- .../androidaps/dialogs/CarbsDialog.kt | 73 ++++-- .../androidaps/dialogs/CareDialog.kt | 6 +- .../androidaps/dialogs/InsulinDialog.kt | 32 ++- .../androidaps/dialogs/TempTargetDialog.kt | 66 +++-- .../androidaps/dialogs/WizardDialog.kt | 23 +- .../historyBrowser/TreatmentsPluginHistory.kt | 6 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 2 +- .../aps/openAPSAMA/OpenAPSAMAPlugin.kt | 18 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 16 +- .../constraints/safety/SafetyPlugin.kt | 2 +- .../general/actions/ActionsFragment.kt | 2 +- .../general/nsclient/NSClientPlugin.java | 45 +++- .../general/openhumans/OpenHumansUploader.kt | 18 +- .../general/overview/OverviewFragment.kt | 38 +-- .../general/overview/graphData/GraphData.kt | 28 ++- .../smsCommunicator/SmsCommunicatorPlugin.kt | 115 +++++---- .../general/wear/ActionStringHandler.kt | 60 +++-- .../iob/iobCobCalculator/IobCobOref1Thread.kt | 10 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 2 +- .../plugins/source/EversensePlugin.kt | 2 +- .../plugins/treatments/TreatmentsPlugin.java | 62 +---- .../events/EventTreatmentUpdateGui.kt | 5 + .../fragments/TreatmentsTempTargetFragment.kt | 143 ++++++----- .../androidaps/utils/stats/TddCalculator.kt | 11 +- .../androidaps/utils/wizard/BolusWizard.kt | 10 +- .../utils/wizard/QuickWizardEntry.kt | 10 +- .../layout/treatments_temptarget_fragment.xml | 39 ++- .../res/layout/treatments_temptarget_item.xml | 22 +- .../data/OverlappingIntervalsTest.kt | 23 +- .../androidaps/data/TempTargetTest.kt | 83 +++++++ .../interfaces/ConstraintsCheckerTest.kt | 6 +- .../SmsCommunicatorPluginTest.kt | 12 +- .../treatments/TreatmentsPluginTest.kt | 8 +- .../actions/ActionStartTempTarget.kt | 41 +++- .../actions/ActionStopTempTarget.kt | 26 +- .../automation/triggers/TriggerTempTarget.kt | 9 +- .../actions/ActionStartTempTargetTest.kt | 5 +- .../actions/ActionStopTempTargetTest.kt | 5 +- .../automation/actions/ActionsTestBase.kt | 6 +- .../triggers/TriggerTempTargetTest.kt | 10 +- .../automation/triggers/TriggerTestBase.kt | 5 +- .../nightscout/androidaps/db/DbRequest.java | 15 +- .../nightscout/androidaps/db/TempTarget.java | 199 --------------- .../dialogs/DialogFragmentWithDate.kt | 4 +- .../interfaces/TreatmentsInterface.java | 12 +- .../plugins/general/nsclient/NSUpload.java | 106 ++++---- .../nightscout/androidaps/utils/DateUtil.java | 8 +- .../androidaps/utils/FabricPrivacy.kt | 3 +- .../nightscout/androidaps/utils/JsonHelper.kt | 16 +- .../extensions/TemporaryTargetExtension.kt | 84 +++++++ .../androidaps/utils/DateUtilTest.kt | 4 +- .../danaRKorean/DanaRKoreanPlugin.java | 23 +- .../androidaps/danar/DanaRPlugin.java | 28 +-- .../androidaps/database/AppRepository.kt | 31 ++- .../database/daos/TemporaryTargetDao.kt | 15 +- .../database/entities/TemporaryTarget.kt | 6 +- ...lCurrentTemporaryTargetIfAnyTransaction.kt | 15 +- ...poraryTargetAndCancelCurrentTransaction.kt | 15 +- .../SyncTemporaryTargetTransaction.kt | 71 ++++++ .../pump/insight/LocalInsightPlugin.java | 16 +- .../medtronic/data/MedtronicHistoryData.java | 2 +- .../eros/manager/AapsOmnipodErosManager.java | 2 +- 64 files changed, 1051 insertions(+), 973 deletions(-) create mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/treatments/events/EventTreatmentUpdateGui.kt create mode 100644 app/src/test/java/info/nightscout/androidaps/data/TempTargetTest.kt delete mode 100644 core/src/main/java/info/nightscout/androidaps/db/TempTarget.java create mode 100644 core/src/main/java/info/nightscout/androidaps/utils/extensions/TemporaryTargetExtension.kt create mode 100644 database/src/main/java/info/nightscout/androidaps/database/transactions/SyncTemporaryTargetTransaction.kt diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 3542887fac..ff53f4004f 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -2,22 +2,6 @@