From bb76fa9d2029afbc281e1219ae2726703cb7b09a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 9 Jan 2017 19:54:23 +0100 Subject: [PATCH 1/4] need of 14 days run to enable AMA --- .../androidaps/plugins/Objectives/ObjectivesPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Objectives/ObjectivesPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Objectives/ObjectivesPlugin.java index f865165437..f802276c8e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Objectives/ObjectivesPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Objectives/ObjectivesPlugin.java @@ -177,7 +177,7 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface { MainApp.sResources.getString(R.string.objectives_6_objective), "", new Date(0), - 1, + 14, new Date(0))); } From 8a4678bb8f43e7b0d3ece10a3ac678ddfc479f93 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 9 Jan 2017 22:13:45 +0100 Subject: [PATCH 2/4] make now-line more visible --- .../androidaps/plugins/Overview/OverviewFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 7e996b8619..7fc607095d 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 @@ -816,8 +816,8 @@ public class OverviewFragment extends Fragment { // custom paint to make a dotted line Paint paint = new Paint(); paint.setStyle(Paint.Style.STROKE); - paint.setStrokeWidth(1); - paint.setPathEffect(new DashPathEffect(new float[]{4, 20}, 0)); + paint.setStrokeWidth(2); + paint.setPathEffect(new DashPathEffect(new float[]{10, 20}, 0)); paint.setColor(Color.WHITE); seriesNow.setCustomPaint(paint); From 97431e5b9474261300fafec178514e649fd1bcf7 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 9 Jan 2017 23:19:25 +0100 Subject: [PATCH 3/4] show base basal line --- .../plugins/Overview/OverviewFragment.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 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 7fc607095d..706f88685c 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 @@ -678,6 +678,7 @@ public class OverviewFragment extends Fragment { highLine = NSProfile.fromMgdlToUnits(OverviewPlugin.bgTargetHigh, units); } + LineGraphSeries basalsLineSeries = null; BarGraphSeries basalsSeries = null; LineGraphSeries seriesLow = null; LineGraphSeries seriesHigh = null; @@ -719,13 +720,21 @@ public class OverviewFragment extends Fragment { long now = new Date().getTime(); if (pump.getPumpDescription().isTempBasalCapable) { List basalArray = new ArrayList(); + List basalLineArray = new ArrayList(); + double lastBaseBasal = 0; for (long time = fromTime; time < now; time += 5 * 60 * 1000L) { TempBasal tb = MainApp.getConfigBuilder().getTempBasal(new Date(time)); + double basebasal = profile.getBasal(NSProfile.secondsFromMidnight(new Date(time))); Double basal = 0d; if (tb != null) basalArray.add(new BarDataPoint(time, basal = tb.tempBasalConvertedToAbsolute(new Date(time)), true)); - else - basalArray.add(new BarDataPoint(time, basal = profile.getBasal(NSProfile.secondsFromMidnight(new Date(time))), false)); + else { + basalArray.add(new BarDataPoint(time, basal = basebasal, false)); + } + if (basebasal != lastBaseBasal) + basalLineArray.add(new DataPoint(time, lastBaseBasal)); + basalLineArray.add(new DataPoint(time, basebasal)); + lastBaseBasal = basebasal; maxBasalValueFound = Math.max(maxBasalValueFound, basal); } BarDataPoint[] basal = new BarDataPoint[basalArray.size()]; @@ -739,6 +748,12 @@ public class OverviewFragment extends Fragment { else return Color.CYAN; } }); + DataPoint[] basalLine = new DataPoint[basalLineArray.size()]; + basalLine = basalLineArray.toArray(basalLine); + bgGraph.addSeries(basalsLineSeries = new LineGraphSeries(basalLine)); + basalsLineSeries.setColor(Color.CYAN); + basalsLineSeries.setDrawDataPoints(false); + basalsLineSeries.setThickness(2); } // set manual x bounds to have nice steps @@ -850,12 +865,11 @@ public class OverviewFragment extends Fragment { // set second scale if (pump.getPumpDescription().isTempBasalCapable) { bgGraph.getSecondScale().addSeries(basalsSeries); + bgGraph.getSecondScale().addSeries(basalsLineSeries); bgGraph.getSecondScale().setMinY(0); bgGraph.getSecondScale().setMaxY(maxBgValue / lowLine * maxBasalValueFound * 1.2d); bgGraph.getGridLabelRenderer().setVerticalLabelsSecondScaleColor(MainApp.instance().getResources().getColor(R.color.background_material_dark)); // same color as backround = hide } - - } //Notifications From f5f60bcd30eef4d2387698beb746cd28f7dc2459 Mon Sep 17 00:00:00 2001 From: viktoria Date: Tue, 10 Jan 2017 01:01:11 +0100 Subject: [PATCH 4/4] fix autosens adjust BG targets regarding to that: https://openaps.readthedocs.io/en/latest/docs/walkthrough/phase-3/beyond-low-glucose-suspend.html the autosens_adjust_targets setting is only for allow autosens to adjust the BG target not for enabling or disabling the wohle autosens feature --- app/src/main/java/info/nightscout/androidaps/Constants.java | 1 + .../plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/Constants.java b/app/src/main/java/info/nightscout/androidaps/Constants.java index 37e358f974..adcb7a883f 100644 --- a/app/src/main/java/info/nightscout/androidaps/Constants.java +++ b/app/src/main/java/info/nightscout/androidaps/Constants.java @@ -36,6 +36,7 @@ public class Constants { public static final int BOLUSSNOOZE_DIA_ADVISOR = 2; public static final double AUTOSENS_MAX = 1.2d; public static final double AUTOSENS_MIN = 0.7d; + public static final boolean AUTOSENS_ADJUST_TARGETS = false; public static final double MIN_5M_CARBIMPACT = 3d; // Circadian Percentage Profile diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java index 7cb680e68c..e09bac0f07 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java @@ -232,7 +232,7 @@ public class DetermineBasalAdapterAMAJS { mProfile.add("skip_neutral_temps", true); mProfile.add("current_basal", pump.getBaseBasalRate()); mProfile.add("temptargetSet", tempTargetSet); - mProfile.add("autosens_adjust_targets", MainApp.getConfigBuilder().isAMAModeEnabled()); + mProfile.add("autosens_adjust_targets", Constants.AUTOSENS_ADJUST_TARGETS); mProfile.add("min_5m_carbimpact", min_5m_carbimpact); mV8rt.add(PARAM_profile, mProfile);