From 34ed92f8aa976927eb256a5d54880383160dbae5 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 21 Feb 2017 10:00:08 +0100 Subject: [PATCH 1/3] fix displaying delta when not available --- .../androidaps/plugins/Overview/OverviewFragment.java | 3 +++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 4 insertions(+) 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 ac9035b7fd..f2b32d7033 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 @@ -720,6 +720,9 @@ public class OverviewFragment extends Fragment { deltaView.setText("Δ " + NSProfile.toUnitsString(glucoseStatus.delta, glucoseStatus.delta * Constants.MGDL_TO_MMOLL, units) + " " + units); avgdeltaView.setText("øΔ15m: " + NSProfile.toUnitsString(glucoseStatus.short_avgdelta, glucoseStatus.short_avgdelta * Constants.MGDL_TO_MMOLL, units) + " øΔ40m: " + NSProfile.toUnitsString(glucoseStatus.long_avgdelta, glucoseStatus.long_avgdelta * Constants.MGDL_TO_MMOLL, units)); + } else { + deltaView.setText(MainApp.sResources.getString(R.string.notavailable)); + avgdeltaView.setText(""); } BgReading.units = profile.getUnits(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c1e7737ac4..26d946581c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -541,4 +541,5 @@ Show detailed IOB Break down IOB into bolus and basal IOB on the watchface not successful - please check phone + Not available From 3f84a6321350fa84b9d8f0e5c3ad92c713fc8db2 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 21 Feb 2017 10:00:44 +0100 Subject: [PATCH 2/3] add delta sign --- .../androidaps/plugins/Overview/OverviewFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f2b32d7033..44494c0bbb 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 @@ -721,7 +721,7 @@ public class OverviewFragment extends Fragment { avgdeltaView.setText("øΔ15m: " + NSProfile.toUnitsString(glucoseStatus.short_avgdelta, glucoseStatus.short_avgdelta * Constants.MGDL_TO_MMOLL, units) + " øΔ40m: " + NSProfile.toUnitsString(glucoseStatus.long_avgdelta, glucoseStatus.long_avgdelta * Constants.MGDL_TO_MMOLL, units)); } else { - deltaView.setText(MainApp.sResources.getString(R.string.notavailable)); + deltaView.setText("Δ " + MainApp.sResources.getString(R.string.notavailable)); avgdeltaView.setText(""); } From 99b66ab3934307ffb7c616babb283ae762e2b77d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 21 Feb 2017 10:36:29 +0100 Subject: [PATCH 3/3] connect counter --- .../plugins/NSClientInternal/services/NSClientService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/services/NSClientService.java b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/services/NSClientService.java index 272959b21c..23a8eb0ae0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/services/NSClientService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/services/NSClientService.java @@ -79,6 +79,7 @@ public class NSClientService extends Service { public static boolean isConnected = false; public static boolean hasWriteAuth = false; private static Integer dataCounter = 0; + private static Integer connectCounter = 0; public static String nightscoutVersionName = ""; @@ -222,7 +223,8 @@ public class NSClientService extends Service { private Emitter.Listener onConnect = new Emitter.Listener() { @Override public void call(Object... args) { - MainApp.bus().post(new EventNSClientNewLog("NSCLIENT", "connect event. ID: " + mSocket.id())); + connectCounter++; + MainApp.bus().post(new EventNSClientNewLog("NSCLIENT", "connect #" + connectCounter + " event. ID: " + mSocket.id())); sendAuthMessage(new NSAuthAck()); } };