From 955ecc6d64f3b46049bd27412c6d109327463842 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 4 Jan 2018 21:33:18 +0100 Subject: [PATCH] set defaults for display range --- .../plugins/Overview/OverviewFragment.java | 12 ++++++++++-- .../plugins/SourceDexcomG5/BGSourceFragment.java | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index ccef69a17b..8e4ba0b332 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -940,8 +940,16 @@ public class OverviewFragment extends Fragment implements View.OnClickListener, return; } - final double lowLine = SP.getDouble("low_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units)); - final double highLine = SP.getDouble("high_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units)); + double lowLineSetting = SP.getDouble("low_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetLow, units)); + double highLineSetting = SP.getDouble("high_mark", Profile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units)); + + if (lowLineSetting < 1) + lowLineSetting = Profile.fromMgdlToUnits(76d, units); + if (highLineSetting < 1) + highLineSetting = Profile.fromMgdlToUnits(180d, units); + + final double lowLine = lowLineSetting; + final double highLine = highLineSetting; //Start with updating the BG as it is unaffected by loop. // **** BG value **** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SourceDexcomG5/BGSourceFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/SourceDexcomG5/BGSourceFragment.java index bd686ec96c..0b001b8b80 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SourceDexcomG5/BGSourceFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SourceDexcomG5/BGSourceFragment.java @@ -149,12 +149,13 @@ public class BGSourceFragment extends SubscriberFragment { builder.setMessage(MainApp.sResources.getString(R.string.removerecord) + "\n" + DateUtil.dateAndTimeString(bgReading.date) + "\n" + bgReading.valueToUnitsToString(profile.getUnits())); builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { - final String _id = bgReading._id; +/* final String _id = bgReading._id; if (NSUpload.isIdValid(_id)) { NSUpload.removeFoodFromNS(_id); } else { UploadQueue.removeID("dbAdd", _id); } +*/ bgReading.isValid = false; MainApp.getDbHelper().update(bgReading); updateGUI();