Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G7 cleanup #3220

Merged
merged 7 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/main/java/com/eveningoutpost/dexdrip/Home.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -2692,7 +2693,7 @@ private void updateCurrentBgInfoCommon(DexCollectionType collector, TextView not
// TODO this logic needed a rework even a year ago, now its a lot more confused with the additional complexity of native mode
if (Ob1G5CollectionService.isG5ActiveButUnknownState() && Calibration.latestValid(2).size() < 2) {
// TODO use format string
notificationText.setText(String.format(gs(R.string.state_not_currently_known), (Ob1G5StateMachine.usingG6() ? "G6" : "G5")));
notificationText.setText(String.format(gs(R.string.state_not_currently_known), (Ob1G5StateMachine.usingG6() ? (shortTxId() ? "G7" : "G6") : "G5")));
showUncalibratedSlope();
} else {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ public static boolean doGetData(Ob1G5CollectionService parent, RxBleConnection c
if (connection == null) return false;
// TODO switch modes depending on conditions as to whether we are using internal
final boolean use_g5_internal_alg = Pref.getBooleanDefaultFalse("ob1_g5_use_transmitter_alg");
UserError.Log.d(TAG, use_g5_internal_alg ? ("Requesting Glucose Data " + (usingG6() ? "G6" : "G5")) : "Requesting Sensor Data");
UserError.Log.d(TAG, use_g5_internal_alg ? ("Requesting Glucose Data " + (usingG6() ? (shortTxId() ? "G7" : "G6") : "G5")) : "Requesting Sensor Data");

if (!use_g5_internal_alg) {
parent.lastSensorStatus = null; // not applicable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.eveningoutpost.dexdrip.models;

import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId;
import static com.eveningoutpost.dexdrip.importedlibraries.dexcom.Dex_Constants.TREND_ARROW_VALUES.NOT_COMPUTABLE;
import static com.eveningoutpost.dexdrip.importedlibraries.dexcom.Dex_Constants.TREND_ARROW_VALUES.getTrend;
import static com.eveningoutpost.dexdrip.calibrations.PluggableCalibration.getCalibrationPluginFromPreferences;
Expand Down Expand Up @@ -1122,7 +1123,11 @@ public static synchronized BgReading bgReadingInsertFromG5(double calculated_val
bgr.calculated_value = calculated_value;
bgr.raw_data = SPECIAL_G5_PLACEHOLDER; // placeholder
if (Ob1G5CollectionService.usingG6()) {
bgr.appendSourceInfo("G6 Native");
if (shortTxId()) { // If using G7
bgr.appendSourceInfo("G7");
} else {
bgr.appendSourceInfo("G6 Native");
}
} else {
bgr.appendSourceInfo("G5 Native");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static void sendLocalBroadcast(final BgReading bgReading) {
UserError.Log.i("SENSOR QUEUE:", "Broadcast data");

String collectorName = DexCollectionType.getBestCollectorHardwareName();
if (collectorName.equals("G6 Native")) {
if (collectorName.equals("G6 Native") || collectorName.equals("G7")) {
collectorName += " / G5 Native"; // compatibility for older AAPS
}
bundle.putString(Intents.XDRIP_DATA_SOURCE_DESCRIPTION, collectorName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.eveningoutpost.dexdrip.utilitymodels;


import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
Expand Down Expand Up @@ -143,6 +145,9 @@ boolean alwaysSendBattery() {
@Override
String getDeviceName() {
if (Ob1G5StateMachine.usingG6()) {
if (shortTxId()) { // If using G7
return "G7 Device";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to "G7 Transmitter";

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

G7 transmitter and sensor are together. There is no reason to call it a transmitter any longer. It is valid to call it a device to avoid calling it a transmitter.

}
return "G6 Transmitter";
}
return "G5 Transmitter";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import com.eveningoutpost.dexdrip.cgm.webfollow.WebFollowService;
import com.eveningoutpost.dexdrip.cgm.carelinkfollow.CareLinkFollowService;

import static com.eveningoutpost.dexdrip.g5model.Ob1G5StateMachine.shortTxId;

import java.lang.reflect.Method;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -276,7 +278,7 @@ public static String getBestCollectorHardwareName() {
return "Network G4 and Classic xDrip";
case DexcomG5:
if (Ob1G5CollectionService.usingNativeMode()) {
return Ob1G5CollectionService.usingG6() ? "G6 Native" : "G5 Native";
return Ob1G5CollectionService.usingG6() ? (shortTxId() ? "G7" : "G6 Native") : "G5 Native";
}
return dct.name();
case LibreWifi:
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,8 @@
<string name="use_any_tag">Use any-tag optimized reading method</string>
<string name="low_level_value">Low level diagnostic/prototype value</string>
<string name="transmitter_id">ID of your Dexcom Transmitter, e.g. 12AB3</string>
<string name="advanced_g5_settings">Advanced G5 settings for rare situations</string>
<string name="g5_debug_settings">G5/G6/Dex1 Debug Settings</string>
<string name="advanced_g5_settings">Advanced Dexcom settings for rare situations</string>
<string name="g5_debug_settings">G5/G6/G7/Dex1 Debug Settings</string>
<string name="g5_scan_constantly">Some devices work better when scanning constantly, others do not. If reading is reliable when this setting is not selected, you should have improved battery life. Normally best to keep this disabled</string>
<string name="scan_for_g5_constantly">Scan for G5 constantly</string>
<string name="g5_force_ui_thread">This is crucial for some Android devices to properly connect, but can cause missed readings when other UI intensive activities are in use.</string>
Expand Down Expand Up @@ -1213,7 +1213,7 @@
<string name="summary_send_bridge_battery_to_nightscout">Send your bridge battery level to Nightscout. Uncheck if your battery sensor is broken.</string>
<string name="title_send_bridge_battery_to_nightscout">Upload bridge battery</string>
<string name="summary_send_dexcom_transmitter_battery_to_nightscout">Send Dexcom transmitter battery statistics to Nightscout. Includes all of the data shown on the Collector Status screen.</string>
<string name="title_send_dexcom_transmitter_battery_to_nightscout">Upload OB1G5/G6 transmitter battery</string>
<string name="title_send_dexcom_transmitter_battery_to_nightscout">Upload OB1G5/G6/G7/1 transmitter battery</string>
<string name="summary_send_treatments_to_nightscout">Send treatment data to Nightscout. Uncheck if your careportal is broken.</string>
<string name="title_send_treatments_to_nightscout">Upload treatments</string>
<string name="summary_warn_nightscout_failures">Display and sound a notification if Nightscout upload is failing.</string>
Expand Down Expand Up @@ -1381,14 +1381,14 @@
<string name="title_ob1_g5_fallback_to_xdrip">Fallback to xDrip</string>
<string name="summary_ob1_minimize_scanning">Use heuristics to minimize Bluetooth scanning + save power</string>
<string name="title_ob1_minimize_scanning">Minimize Scanning</string>
<string name="summary_using_g6">I am using a G6 or Dexcom 1 Sensor</string>
<string name="title_using_g6">G6/Dex1 Support</string>
<string name="summary_using_g6">I am using a G6, G7 or Dexcom 1 Sensor</string>
<string name="title_using_g6">G6/G7/Dex1 Support</string>
<string name="summary_ob1_g5_allow_resetbond">OB1 collector can unbond if it thinks the encryption has failed. If you get problems with it unpairing then disable this option. If you then totally lose connection, make sure this is enabled.</string>
<string name="title_ob1_g5_allow_resetbond">Allow OB1 unbonding</string>
<string name="summary_ob1_initiate_bonding_flag">OB1 collector can initiate bonding.</string>
<string name="title_ob1_initiate_bonding_flag">Allow OB1 initiate bonding</string>
<string name="title_old_g5_options">Old G5 Collector Settings</string>
<string name="title_g5g6_battery_options">G5/G6 battery options</string>
<string name="title_g5g6_battery_options">G5/G6/G7/1 battery options</string>
<string name="title_g5_battery_warning_level">Adjust battery warning level</string>
<string name="title_plugins_and_features">Plugins and Features</string>
<string name="title_color_heart_rate1">Heart rate monitor</string>
Expand All @@ -1400,8 +1400,8 @@
<string name="title_xdrip_plus_graph_display_settings">Graph Settings</string>
<string name="summary_show_basal_line">Show TBR information from external status</string>
<string name="title_show_basal_line">Show Basal TBR</string>
<string name="summary_show_g_prediction">Show G6 predictive glucose dots</string>
<string name="title_show_g_prediction">G6 Prediction</string>
<string name="summary_show_g_prediction">Show G6/G7 predictive glucose dots</string>
<string name="title_show_g_prediction">G6/G7 Prediction</string>
<string name="summary_show_smb_icons">Declutter graph with treatment icons for small boluses</string>
<string name="title_show_smb_icons">Show micro bolus icons</string>
<string name="summary_show_medtrum_secondary">Show alternate glucose dots</string>
Expand Down
Loading