From 679fe5265b7481eb3e9a6a75b381cb6f30909777 Mon Sep 17 00:00:00 2001 From: Navid Date: Mon, 18 Dec 2023 12:11:05 -0500 Subject: [PATCH 1/5] No need to start a G7 --- app/src/main/java/com/eveningoutpost/dexdrip/Home.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/Home.java b/app/src/main/java/com/eveningoutpost/dexdrip/Home.java index b60b0f3e9e..1a3ef6196f 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/Home.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/Home.java @@ -2621,7 +2621,7 @@ private void updateCurrentBgInfoCommon(DexCollectionType collector, TextView not if (!isSensorActive) { // Define a variable (notConnectedToG6Yet) that is only true if Native G6 is chosen, but, transmitter days is unknown. boolean notConnectedToG6Yet = DexCollectionType.getDexCollectionType() == DexcomG5 && Pref.getBooleanDefaultFalse("ob1_g5_use_transmitter_alg") && Pref.getBooleanDefaultFalse("using_g6") && DexTimeKeeper.getTransmitterAgeInDays(getTransmitterID()) == -1; - if (notConnectedToG6Yet) { // Only if G6 has been selected and transmitter days is unknown. + if (notConnectedToG6Yet || getTransmitterID().length() < 6) { // Only if G6 has been selected and transmitter days is unknown, or if G7 has been selected. notificationText.setText(R.string.wait_to_connect); } else { // Only if G6 is not selected or G6 transmitter days is known. notificationText.setText(R.string.now_start_your_sensor); From b01a0fd25c2b05fef8c4c87dd6b8bca3f958a863 Mon Sep 17 00:00:00 2001 From: Navid Date: Sat, 23 Dec 2023 10:59:08 -0500 Subject: [PATCH 2/5] Use public shortTxId --- app/src/main/java/com/eveningoutpost/dexdrip/Home.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/Home.java b/app/src/main/java/com/eveningoutpost/dexdrip/Home.java index 1a3ef6196f..c51e539859 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/Home.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/Home.java @@ -1,6 +1,7 @@ package com.eveningoutpost.dexdrip; import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE; +import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId; import static com.eveningoutpost.dexdrip.models.JoH.msSince; import static com.eveningoutpost.dexdrip.models.JoH.quietratelimit; import static com.eveningoutpost.dexdrip.models.JoH.tsl; @@ -2621,7 +2622,7 @@ private void updateCurrentBgInfoCommon(DexCollectionType collector, TextView not if (!isSensorActive) { // Define a variable (notConnectedToG6Yet) that is only true if Native G6 is chosen, but, transmitter days is unknown. boolean notConnectedToG6Yet = DexCollectionType.getDexCollectionType() == DexcomG5 && Pref.getBooleanDefaultFalse("ob1_g5_use_transmitter_alg") && Pref.getBooleanDefaultFalse("using_g6") && DexTimeKeeper.getTransmitterAgeInDays(getTransmitterID()) == -1; - if (notConnectedToG6Yet || getTransmitterID().length() < 6) { // Only if G6 has been selected and transmitter days is unknown, or if G7 has been selected. + if (notConnectedToG6Yet || shortTxId()) { // Only if G6 has been selected and transmitter days is unknown, or if G7 has been selected. notificationText.setText(R.string.wait_to_connect); } else { // Only if G6 is not selected or G6 transmitter days is known. notificationText.setText(R.string.now_start_your_sensor); From 6a490afacbf5095d175c501b77b8666dc80f7631 Mon Sep 17 00:00:00 2001 From: Navid Date: Thu, 22 Feb 2024 14:45:36 -0500 Subject: [PATCH 3/5] Download treatments originated from xDrip as well --- .../dexdrip/utilitymodels/NightscoutTreatments.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutTreatments.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutTreatments.java index d392ac96bf..441354d209 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutTreatments.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutTreatments.java @@ -130,7 +130,7 @@ public static boolean processTreatmentResponse(final String response) throws Exc Treatments existing = Treatments.byuuid(nightscout_id); if (existing == null) existing = Treatments.byuuid(uuid); - if ((existing == null) && (!from_xdrip)) { + if (existing == null) { // check for close timestamp duplicates perhaps existing = Treatments.byTimestamp(timestamp, 60000); if (!((existing != null) && (JoH.roundDouble(existing.insulin, 2) == JoH.roundDouble(insulin, 2)) From 2aafe83d24673f4e0563c5dc7b08d954f610c229 Mon Sep 17 00:00:00 2001 From: Navid Date: Thu, 22 Feb 2024 18:08:28 -0500 Subject: [PATCH 4/5] Added switch to allow download even from xDrip --- .../utilitymodels/NightscoutTreatments.java | 5 +++- app/src/main/res/values/strings.xml | 2 ++ app/src/main/res/xml/pref_data_sync.xml | 23 ++++++++++++++----- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutTreatments.java b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutTreatments.java index 441354d209..643bfc08da 100644 --- a/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutTreatments.java +++ b/app/src/main/java/com/eveningoutpost/dexdrip/utilitymodels/NightscoutTreatments.java @@ -55,6 +55,9 @@ public static boolean processTreatmentResponse(final String response) throws Exc } catch (JSONException e) { // } + + boolean skip_from_xdrip = Pref.getBooleanDefaultFalse("cloud_storage_api_skip_download_from_xdrip"); + // extract blood test data if present try { if (!from_xdrip) { @@ -130,7 +133,7 @@ public static boolean processTreatmentResponse(final String response) throws Exc Treatments existing = Treatments.byuuid(nightscout_id); if (existing == null) existing = Treatments.byuuid(uuid); - if (existing == null) { + if ((existing == null) && !(from_xdrip && skip_from_xdrip)) { // check for close timestamp duplicates perhaps existing = Treatments.byTimestamp(timestamp, 60000); if (!((existing != null) && (JoH.roundDouble(existing.insulin, 2) == JoH.roundDouble(insulin, 2)) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 00219735a4..b20bc3b717 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1207,6 +1207,8 @@ Use mobile data Also try to download treatments from Nightscout Download treatments + Skip items from xDrip + Avoid downloading items uploaded by xDrip Calibrate using new blood glucose readings if the conditions appear right to do so without asking confirmation (experimental) Automatic Calibration Extra Options diff --git a/app/src/main/res/xml/pref_data_sync.xml b/app/src/main/res/xml/pref_data_sync.xml index b15198054d..711934a994 100644 --- a/app/src/main/res/xml/pref_data_sync.xml +++ b/app/src/main/res/xml/pref_data_sync.xml @@ -47,12 +47,23 @@ android:key="cloud_storage_api_base" android:title="@string/pref_title_api_url" /> - + + + + Date: Fri, 23 Feb 2024 12:58:55 -0500 Subject: [PATCH 5/5] nsfollow --- app/src/main/res/xml/pref_data_source.xml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/xml/pref_data_source.xml b/app/src/main/res/xml/pref_data_source.xml index 18e20cd92b..65d9f3c78d 100644 --- a/app/src/main/res/xml/pref_data_source.xml +++ b/app/src/main/res/xml/pref_data_source.xml @@ -192,11 +192,21 @@ android:singleLine="true" android:summary="@string/summary_nsfollow_url" android:title="@string/title_nsfollow_url" /> - + + + +