From 0fdcb862a67f141adcfa36a6f130ad9fe3a4a852 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Thu, 2 Jan 2020 00:11:09 +0100 Subject: [PATCH] - small logging so that we can fix this date parsing problem --- .../pump/omnipod/dialogs/PodHistoryActivity.java | 14 +++++++++----- .../omnipod/driver/db/PodHistoryEntryType.java | 4 +--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodHistoryActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodHistoryActivity.java index bc2d40a803..b8b8991897 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodHistoryActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodHistoryActivity.java @@ -243,7 +243,6 @@ public class PodHistoryActivity extends NoSplashActivity { if (record != null) { holder.timeView.setText(record.getDateTimeString()); holder.typeView.setText(record.getPodDbEntryType().getResourceId()); - //holder.valueView.setText(""); // TODO setValue(record, holder.valueView); } } @@ -255,8 +254,7 @@ public class PodHistoryActivity extends NoSplashActivity { case FillCannulaSetBasalProfile: { if (historyEntry.getData() != null) { - Profile profile = OmnipodUtil.getGsonInstance().fromJson(historyEntry.getData(), Profile.class); - valueView.setText(ProfileUtil.getProfileDisplayable(profile, PumpType.Insulet_Omnipod)); + setProfileValue(historyEntry.getData(), valueView); } } break; @@ -268,8 +266,7 @@ public class PodHistoryActivity extends NoSplashActivity { break; case SetBasalSchedule: { - Profile profile = OmnipodUtil.getGsonInstance().fromJson(historyEntry.getData(), Profile.class); - valueView.setText(ProfileUtil.getProfileDisplayable(profile, PumpType.Insulet_Omnipod)); + setProfileValue(historyEntry.getData(), valueView); } break; case GetPodStatus: @@ -301,6 +298,7 @@ public class PodHistoryActivity extends NoSplashActivity { case ResumeDelivery: case UnknownEntryType: default: + valueView.setText(""); break; } @@ -310,6 +308,12 @@ public class PodHistoryActivity extends NoSplashActivity { } + private void setProfileValue(String data, TextView valueView) { + LOG.debug("Profile json:\n" + data); + Profile profile = OmnipodUtil.getGsonInstance().fromJson(data, Profile.class); + valueView.setText(ProfileUtil.getProfileDisplayable(profile, PumpType.Insulet_Omnipod)); + } + @Override public int getItemCount() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/db/PodHistoryEntryType.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/db/PodHistoryEntryType.java index 0e7c3a9dc2..82db57d4ee 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/db/PodHistoryEntryType.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/db/PodHistoryEntryType.java @@ -1,6 +1,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.db; -import androidx.annotation.IdRes; import androidx.annotation.StringRes; import java.util.HashMap; @@ -37,8 +36,7 @@ public enum PodHistoryEntryType { SuspendDelivery(60, R.string.omnipod_cmd_suspend_delivery), ResumeDelivery(61, R.string.omnipod_cmd_resume_delivery), - UnknownEntryType(99, R.string.omnipod_cmd_umknown_entry) - ; + UnknownEntryType(99, R.string.omnipod_cmd_unknown_entry); private int code; private static Map instanceMap;