From 379e3f8ab1742a9e8b78067bb85c957782cd6954 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sun, 5 Feb 2017 02:18:13 +0100 Subject: [PATCH 1/3] rounding minutesago instead of truncating it --- .../java/info/nightscout/androidaps/data/GlucoseStatus.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java b/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java index 113b3dc25c..9a28e56359 100644 --- a/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/data/GlucoseStatus.java @@ -81,9 +81,9 @@ public class GlucoseStatus { BgReading then = data.get(i); long then_date = then.timeIndex; double avgdelta = 0; - int minutesago; + long minutesago; - minutesago = Math.round((now_date - then_date) / (1000 * 60)); + minutesago = Math.round((now_date - then_date) / (1000d * 60)); // multiply by 5 to get the same units as delta, i.e. mg/dL/5m change = now.value - then.value; avgdelta = change / minutesago * 5; From a43677e4b0f8a86193d830d93d5739769e79e40c Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 8 Feb 2017 20:36:30 +0100 Subject: [PATCH 2/3] fix pumpcontrol build crash --- .../java/info/nightscout/androidaps/PreferencesActivity.java | 2 +- wear/wear.iml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java index 10169a8d51..67723e9a74 100644 --- a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java @@ -90,7 +90,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre addPreferencesFromResource(R.xml.pref_closedmode); if (Config.OPENAPSENABLED) addPreferencesFromResource(R.xml.pref_openapsma); - if (MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class).isEnabled(PluginBase.APS)) + if (MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class) != null && MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class).isEnabled(PluginBase.APS)) addPreferencesFromResource(R.xml.pref_openapsama); addPreferencesFromResource(R.xml.pref_profile); if (Config.DANAR) { diff --git a/wear/wear.iml b/wear/wear.iml index d38c08321d..f2951e6bcf 100644 --- a/wear/wear.iml +++ b/wear/wear.iml @@ -122,6 +122,7 @@ + @@ -134,10 +135,14 @@ + + + + From 698ab31d71b9565df4ec34fb96c14b77b3e21206 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 8 Feb 2017 21:04:26 +0100 Subject: [PATCH 3/3] show temp targets only if APS enabled in config --- app/src/main/java/info/nightscout/androidaps/MainApp.java | 2 +- .../androidaps/plugins/Overview/OverviewFragment.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index e09c90fab8..415e30c1ce 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -90,7 +90,7 @@ public class MainApp extends Application { pluginsList.add(SimpleProfileFragment.getPlugin()); pluginsList.add(LocalProfileFragment.getPlugin()); pluginsList.add(CircadianPercentageProfileFragment.getPlugin()); - pluginsList.add(TempTargetRangeFragment.getPlugin()); + if (Config.APS) pluginsList.add(TempTargetRangeFragment.getPlugin()); pluginsList.add(TreatmentsFragment.getPlugin()); pluginsList.add(TempBasalsFragment.getPlugin()); pluginsList.add(SafetyFragment.getPlugin()); 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 fa1ef08986..e36bac93b7 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 @@ -532,7 +532,7 @@ public class OverviewFragment extends Fragment { // temp target NSProfile profile = MainApp.getConfigBuilder().getActiveProfile().getProfile(); TempTargetRangePlugin tempTargetRangePlugin = (TempTargetRangePlugin) MainApp.getSpecificPlugin(TempTargetRangePlugin.class); - if (tempTargetRangePlugin != null && tempTargetRangePlugin.isEnabled(PluginBase.GENERAL)) { + if (Config.APS && tempTargetRangePlugin != null && tempTargetRangePlugin.isEnabled(PluginBase.GENERAL)) { TempTarget tempTarget = tempTargetRangePlugin.getTempTargetInProgress(new Date().getTime()); if (tempTarget != null) { tempTargetView.setTextColor(Color.BLACK);